Class: UnivapayClientSdk::MerchantWebhookRecurringTokenConfiguration

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb

Overview

Recurring token configuration inherited by the merchant.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(recurring_type: SKIP, charge_wait_period: SKIP, card_charge_cvv_confirmation: SKIP, additional_properties: nil) ⇒ MerchantWebhookRecurringTokenConfiguration

Returns a new instance of MerchantWebhookRecurringTokenConfiguration.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 50

def initialize(recurring_type: SKIP, charge_wait_period: SKIP,
               card_charge_cvv_confirmation: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @recurring_type = recurring_type unless recurring_type == SKIP
  @charge_wait_period = charge_wait_period unless charge_wait_period == SKIP
  unless card_charge_cvv_confirmation == SKIP
    @card_charge_cvv_confirmation =
      card_charge_cvv_confirmation
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#card_charge_cvv_confirmationMerchantWebhookRecurringCvvConfirmationConfig

CVV confirmation rules for recurring token charges.



22
23
24
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 22

def card_charge_cvv_confirmation
  @card_charge_cvv_confirmation
end

#charge_wait_periodString

ISO-8601 duration to wait before first recurring charge.

Returns:

  • (String)


18
19
20
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 18

def charge_wait_period
  @charge_wait_period
end

#recurring_typeString

Merchant recurring-token privilege.

Returns:

  • (String)


14
15
16
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 14

def recurring_type
  @recurring_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  recurring_type =
    hash.key?('recurring_type') ? hash['recurring_type'] : SKIP
  charge_wait_period =
    hash.key?('charge_wait_period') ? hash['charge_wait_period'] : SKIP
  if hash['card_charge_cvv_confirmation']
    card_charge_cvv_confirmation = MerchantWebhookRecurringCvvConfirmationConfig.from_hash(hash['card_charge_cvv_confirmation'])
  end

  # 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.
  MerchantWebhookRecurringTokenConfiguration.new(recurring_type: recurring_type,
                                                 charge_wait_period: charge_wait_period,
                                                 card_charge_cvv_confirmation: card_charge_cvv_confirmation,
                                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['recurring_type'] = 'recurring_type'
  @_hash['charge_wait_period'] = 'charge_wait_period'
  @_hash['card_charge_cvv_confirmation'] = 'card_charge_cvv_confirmation'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
46
47
48
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 43

def self.nullables
  %w[
    recurring_type
    charge_wait_period
  ]
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 34

def self.optionals
  %w[
    recurring_type
    charge_wait_period
    card_charge_cvv_confirmation
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



101
102
103
104
105
106
107
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 101

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} recurring_type: #{@recurring_type.inspect}, charge_wait_period:"\
  " #{@charge_wait_period.inspect}, card_charge_cvv_confirmation:"\
  " #{@card_charge_cvv_confirmation.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



93
94
95
96
97
98
# File 'lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb', line 93

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} recurring_type: #{@recurring_type}, charge_wait_period:"\
  " #{@charge_wait_period}, card_charge_cvv_confirmation: #{@card_charge_cvv_confirmation},"\
  " additional_properties: #{@additional_properties}>"
end