Class: UnivapayClientSdk::MerchantWebhookInstallmentPlanConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::MerchantWebhookInstallmentPlanConfiguration
- Defined in:
- lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb
Overview
Installment plan configuration.
Instance Attribute Summary collapse
-
#card_processor ⇒ CardProcessorInstallmentConfig
Card-processor capabilities available for installment payments.
-
#enabled ⇒ TrueClass | FalseClass
Enables installment plan features for eligible payments.
-
#max_payout_period ⇒ String
Maximum payout delay allowed for installment settlements.
-
#min_charge_amount ⇒ MerchantWebhookMoneyAmount
Monetary amount object serialized by backend config models.
-
#only_with_processor ⇒ TrueClass | FalseClass
Restricts installment use to processor-backed flows.
-
#supported_payment_types ⇒ Array[String]
Payment types that can use installment plans.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(enabled: SKIP, card_processor: SKIP, supported_payment_types: SKIP, min_charge_amount: SKIP, max_payout_period: SKIP, only_with_processor: SKIP, additional_properties: nil) ⇒ MerchantWebhookInstallmentPlanConfiguration
constructor
A new instance of MerchantWebhookInstallmentPlanConfiguration.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(enabled: SKIP, card_processor: SKIP, supported_payment_types: SKIP, min_charge_amount: SKIP, max_payout_period: SKIP, only_with_processor: SKIP, additional_properties: nil) ⇒ MerchantWebhookInstallmentPlanConfiguration
Returns a new instance of MerchantWebhookInstallmentPlanConfiguration.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 70 def initialize(enabled: SKIP, card_processor: SKIP, supported_payment_types: SKIP, min_charge_amount: SKIP, max_payout_period: SKIP, only_with_processor: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @enabled = enabled unless enabled == SKIP @card_processor = card_processor unless card_processor == SKIP @supported_payment_types = supported_payment_types unless supported_payment_types == SKIP @min_charge_amount = min_charge_amount unless min_charge_amount == SKIP @max_payout_period = max_payout_period unless max_payout_period == SKIP @only_with_processor = only_with_processor unless only_with_processor == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#card_processor ⇒ CardProcessorInstallmentConfig
Card-processor capabilities available for installment payments.
18 19 20 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 18 def card_processor @card_processor end |
#enabled ⇒ TrueClass | FalseClass
Enables installment plan features for eligible payments.
14 15 16 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 14 def enabled @enabled end |
#max_payout_period ⇒ String
Maximum payout delay allowed for installment settlements.
30 31 32 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 30 def max_payout_period @max_payout_period end |
#min_charge_amount ⇒ MerchantWebhookMoneyAmount
Monetary amount object serialized by backend config models.
26 27 28 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 26 def min_charge_amount @min_charge_amount end |
#only_with_processor ⇒ TrueClass | FalseClass
Restricts installment use to processor-backed flows.
34 35 36 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 34 def only_with_processor @only_with_processor end |
#supported_payment_types ⇒ Array[String]
Payment types that can use installment plans.
22 23 24 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 22 def supported_payment_types @supported_payment_types end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enabled = hash.key?('enabled') ? hash['enabled'] : SKIP card_processor = CardProcessorInstallmentConfig.from_hash(hash['card_processor']) if hash['card_processor'] supported_payment_types = hash.key?('supported_payment_types') ? hash['supported_payment_types'] : SKIP min_charge_amount = MerchantWebhookMoneyAmount.from_hash(hash['min_charge_amount']) if hash['min_charge_amount'] max_payout_period = hash.key?('max_payout_period') ? hash['max_payout_period'] : SKIP only_with_processor = hash.key?('only_with_processor') ? hash['only_with_processor'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. MerchantWebhookInstallmentPlanConfiguration.new(enabled: enabled, card_processor: card_processor, supported_payment_types: supported_payment_types, min_charge_amount: min_charge_amount, max_payout_period: max_payout_period, only_with_processor: only_with_processor, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['enabled'] = 'enabled' @_hash['card_processor'] = 'card_processor' @_hash['supported_payment_types'] = 'supported_payment_types' @_hash['min_charge_amount'] = 'min_charge_amount' @_hash['max_payout_period'] = 'max_payout_period' @_hash['only_with_processor'] = 'only_with_processor' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 64 65 66 67 68 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 61 def self.nullables %w[ enabled supported_payment_types max_payout_period only_with_processor ] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 49 def self.optionals %w[ enabled card_processor supported_payment_types min_charge_amount max_payout_period only_with_processor ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
130 131 132 133 134 135 136 137 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled.inspect}, card_processor: #{@card_processor.inspect},"\ " supported_payment_types: #{@supported_payment_types.inspect}, min_charge_amount:"\ " #{@min_charge_amount.inspect}, max_payout_period: #{@max_payout_period.inspect},"\ " only_with_processor: #{@only_with_processor.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 127 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled}, card_processor: #{@card_processor},"\ " supported_payment_types: #{@supported_payment_types}, min_charge_amount:"\ " #{@min_charge_amount}, max_payout_period: #{@max_payout_period}, only_with_processor:"\ " #{@only_with_processor}, additional_properties: #{@additional_properties}>" end |