Class: UnivapayClientSdk::MerchantWebhookSubscriptionPlanConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::MerchantWebhookSubscriptionPlanConfiguration
- Defined in:
- lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb
Overview
Subscription plan configuration.
Instance Attribute Summary collapse
-
#enabled ⇒ TrueClass | FalseClass
Enables limited-cycle subscription plans.
-
#fixed_cycle ⇒ TrueClass | FalseClass
Allows plans limited by a fixed number of cycles.
-
#fixed_cycle_amount ⇒ TrueClass | FalseClass
Allows plans limited by a total target amount.
-
#max_payout_period ⇒ String
Maximum payout delay allowed for subscription plan settlements.
-
#min_charge_amount ⇒ MerchantWebhookMoneyAmount
Monetary amount object serialized by backend config models.
-
#supported_payment_types ⇒ Array[String]
Payment types that can use subscription 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, fixed_cycle: SKIP, fixed_cycle_amount: SKIP, supported_payment_types: SKIP, min_charge_amount: SKIP, max_payout_period: SKIP, additional_properties: nil) ⇒ MerchantWebhookSubscriptionPlanConfiguration
constructor
A new instance of MerchantWebhookSubscriptionPlanConfiguration.
-
#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, fixed_cycle: SKIP, fixed_cycle_amount: SKIP, supported_payment_types: SKIP, min_charge_amount: SKIP, max_payout_period: SKIP, additional_properties: nil) ⇒ MerchantWebhookSubscriptionPlanConfiguration
Returns a new instance of MerchantWebhookSubscriptionPlanConfiguration.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 71 def initialize(enabled: SKIP, fixed_cycle: SKIP, fixed_cycle_amount: SKIP, supported_payment_types: SKIP, min_charge_amount: SKIP, max_payout_period: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @enabled = enabled unless enabled == SKIP @fixed_cycle = fixed_cycle unless fixed_cycle == SKIP @fixed_cycle_amount = fixed_cycle_amount unless fixed_cycle_amount == 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 @additional_properties = additional_properties end |
Instance Attribute Details
#enabled ⇒ TrueClass | FalseClass
Enables limited-cycle subscription plans.
14 15 16 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 14 def enabled @enabled end |
#fixed_cycle ⇒ TrueClass | FalseClass
Allows plans limited by a fixed number of cycles.
18 19 20 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 18 def fixed_cycle @fixed_cycle end |
#fixed_cycle_amount ⇒ TrueClass | FalseClass
Allows plans limited by a total target amount.
22 23 24 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 22 def fixed_cycle_amount @fixed_cycle_amount end |
#max_payout_period ⇒ String
Maximum payout delay allowed for subscription plan settlements.
34 35 36 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 34 def max_payout_period @max_payout_period end |
#min_charge_amount ⇒ MerchantWebhookMoneyAmount
Monetary amount object serialized by backend config models.
30 31 32 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 30 def min_charge_amount @min_charge_amount end |
#supported_payment_types ⇒ Array[String]
Payment types that can use subscription plans.
26 27 28 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 26 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 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_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 fixed_cycle = hash.key?('fixed_cycle') ? hash['fixed_cycle'] : SKIP fixed_cycle_amount = hash.key?('fixed_cycle_amount') ? hash['fixed_cycle_amount'] : SKIP 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 # 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. MerchantWebhookSubscriptionPlanConfiguration.new(enabled: enabled, fixed_cycle: fixed_cycle, fixed_cycle_amount: fixed_cycle_amount, supported_payment_types: supported_payment_types, min_charge_amount: min_charge_amount, max_payout_period: max_payout_period, 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_subscription_plan_configuration.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['enabled'] = 'enabled' @_hash['fixed_cycle'] = 'fixed_cycle' @_hash['fixed_cycle_amount'] = 'fixed_cycle_amount' @_hash['supported_payment_types'] = 'supported_payment_types' @_hash['min_charge_amount'] = 'min_charge_amount' @_hash['max_payout_period'] = 'max_payout_period' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 64 65 66 67 68 69 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 61 def self.nullables %w[ enabled fixed_cycle fixed_cycle_amount supported_payment_types max_payout_period ] 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_subscription_plan_configuration.rb', line 49 def self.optionals %w[ enabled fixed_cycle fixed_cycle_amount supported_payment_types min_charge_amount max_payout_period ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 135 136 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 129 def inspect class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled.inspect}, fixed_cycle: #{@fixed_cycle.inspect},"\ " fixed_cycle_amount: #{@fixed_cycle_amount.inspect}, supported_payment_types:"\ " #{@supported_payment_types.inspect}, min_charge_amount: #{@min_charge_amount.inspect},"\ " max_payout_period: #{@max_payout_period.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
120 121 122 123 124 125 126 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb', line 120 def to_s class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled}, fixed_cycle: #{@fixed_cycle}, fixed_cycle_amount:"\ " #{@fixed_cycle_amount}, supported_payment_types: #{@supported_payment_types},"\ " min_charge_amount: #{@min_charge_amount}, max_payout_period: #{@max_payout_period},"\ " additional_properties: #{@additional_properties}>" end |