Class: UnivapayClientSdk::CheckoutSupportedBrand

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

Overview

Feature support and capability flags for a single payment-type / brand combination the store can accept.

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(payment_type: SKIP, brand: SKIP, card_brand: SKIP, qr_brand: SKIP, online_brand: SKIP, dynamic_info: SKIP, support_auth_capture: SKIP, requires_full_name: SKIP, requires_cvv: SKIP, countries_allowed: SKIP, supported_currencies: SKIP, cvv_auth: SKIP, installment_capable: SKIP, mcp_capable: SKIP, mcp_only: SKIP, additional_properties: nil) ⇒ CheckoutSupportedBrand

Returns a new instance of CheckoutSupportedBrand.



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 138

def initialize(payment_type: SKIP, brand: SKIP, card_brand: SKIP,
               qr_brand: SKIP, online_brand: SKIP, dynamic_info: SKIP,
               support_auth_capture: SKIP, requires_full_name: SKIP,
               requires_cvv: SKIP, countries_allowed: SKIP,
               supported_currencies: SKIP, cvv_auth: SKIP,
               installment_capable: SKIP, mcp_capable: SKIP, mcp_only: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_type = payment_type unless payment_type == SKIP
  @brand = brand unless brand == SKIP
  @card_brand = card_brand unless card_brand == SKIP
  @qr_brand = qr_brand unless qr_brand == SKIP
  @online_brand = online_brand unless online_brand == SKIP
  @dynamic_info = dynamic_info unless dynamic_info == SKIP
  @support_auth_capture = support_auth_capture unless support_auth_capture == SKIP
  @requires_full_name = requires_full_name unless requires_full_name == SKIP
  @requires_cvv = requires_cvv unless requires_cvv == SKIP
  @countries_allowed = countries_allowed unless countries_allowed == SKIP
  @supported_currencies = supported_currencies unless supported_currencies == SKIP
  @cvv_auth = cvv_auth unless cvv_auth == SKIP
  @installment_capable = installment_capable unless installment_capable == SKIP
  @mcp_capable = mcp_capable unless mcp_capable == SKIP
  @mcp_only = mcp_only unless mcp_only == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#brandString

Brand identifier for payment_type. For card and apple_pay, one of the common CardBrand values (visa, mastercard, american_express, maestro, discover, jcb, diners_club, private_label, unionpay) or an unmapped_<raw value> fallback. For qr_scan, a QR-CPM brand (e.g. pay_pay, we_chat, qq, line_pay, au_pay, alipay_china). For qr_merchant, a QR-MPM brand (e.g. rakuten_pay_merchant, alipay_merchant_qr, pay_pay_merchant, d_barai_mpm, we_chat_mpm). For online, an online-redirect brand (e.g. alipay_online, pay_pay_online, we_chat_online, d_barai_online, kakaopay). For konbini, a convenience-store brand (e.g. seven_eleven, family_mart, lawson). For paidy and bank_transfer, the payment type's own identifier. The full brand catalogue is large and gateway-dependent — treat this as an open string, not a fixed set.

Returns:

  • (String)


31
32
33
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 31

def brand
  @brand
end

#card_brandString

Legacy alias of brand. Present only when payment_type is card or apple_pay.

Returns:

  • (String)


36
37
38
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 36

def card_brand
  @card_brand
end

#countries_allowedArray[String]

ISO 3166-1 alpha-2 country codes allowed for this brand. null when unrestricted.

Returns:

  • (Array[String])


66
67
68
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 66

def countries_allowed
  @countries_allowed
end

#cvv_authTrueClass | FalseClass

Whether this brand supports CVV-only authorization.

Returns:

  • (TrueClass | FalseClass)


74
75
76
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 74

def cvv_auth
  @cvv_auth
end

#dynamic_infoTrueClass | FalseClass

Whether the brand's supported feature set is resolved dynamically.

Returns:

  • (TrueClass | FalseClass)


49
50
51
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 49

def dynamic_info
  @dynamic_info
end

#installment_capableTrueClass | FalseClass

Whether this brand supports installment plans.

Returns:

  • (TrueClass | FalseClass)


78
79
80
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 78

def installment_capable
  @installment_capable
end

#mcp_capableTrueClass | FalseClass

Whether this brand supports multi-currency pricing.

Returns:

  • (TrueClass | FalseClass)


82
83
84
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 82

def mcp_capable
  @mcp_capable
end

#mcp_onlyTrueClass | FalseClass

Whether this brand is only available through multi-currency pricing.

Returns:

  • (TrueClass | FalseClass)


86
87
88
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 86

def mcp_only
  @mcp_only
end

#online_brandString

Legacy alias of brand. Present only when payment_type is online.

Returns:

  • (String)


45
46
47
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 45

def online_brand
  @online_brand
end

#payment_typeCheckoutPaymentType

Payment type identifier used throughout the checkout configuration.

Returns:



15
16
17
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 15

def payment_type
  @payment_type
end

#qr_brandString

Legacy alias of brand. Present only when payment_type is qr_merchant.

Returns:

  • (String)


41
42
43
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 41

def qr_brand
  @qr_brand
end

#requires_cvvTrueClass | FalseClass

Whether the brand requires a CVV.

Returns:

  • (TrueClass | FalseClass)


61
62
63
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 61

def requires_cvv
  @requires_cvv
end

#requires_full_nameTrueClass | FalseClass

Whether the brand requires the cardholder's full name.

Returns:

  • (TrueClass | FalseClass)


57
58
59
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 57

def requires_full_name
  @requires_full_name
end

#support_auth_captureTrueClass | FalseClass

Whether the brand supports separate authorization and capture.

Returns:

  • (TrueClass | FalseClass)


53
54
55
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 53

def support_auth_capture
  @support_auth_capture
end

#supported_currenciesArray[String]

ISO-4217 currency codes supported by this brand. null when unrestricted.

Returns:

  • (Array[String])


70
71
72
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 70

def supported_currencies
  @supported_currencies
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 167

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP
  brand = hash.key?('brand') ? hash['brand'] : SKIP
  card_brand = hash.key?('card_brand') ? hash['card_brand'] : SKIP
  qr_brand = hash.key?('qr_brand') ? hash['qr_brand'] : SKIP
  online_brand = hash.key?('online_brand') ? hash['online_brand'] : SKIP
  dynamic_info = hash.key?('dynamic_info') ? hash['dynamic_info'] : SKIP
  support_auth_capture =
    hash.key?('support_auth_capture') ? hash['support_auth_capture'] : SKIP
  requires_full_name =
    hash.key?('requires_full_name') ? hash['requires_full_name'] : SKIP
  requires_cvv = hash.key?('requires_cvv') ? hash['requires_cvv'] : SKIP
  countries_allowed =
    hash.key?('countries_allowed') ? hash['countries_allowed'] : SKIP
  supported_currencies =
    hash.key?('supported_currencies') ? hash['supported_currencies'] : SKIP
  cvv_auth = hash.key?('cvv_auth') ? hash['cvv_auth'] : SKIP
  installment_capable =
    hash.key?('installment_capable') ? hash['installment_capable'] : SKIP
  mcp_capable = hash.key?('mcp_capable') ? hash['mcp_capable'] : SKIP
  mcp_only = hash.key?('mcp_only') ? hash['mcp_only'] : 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.
  CheckoutSupportedBrand.new(payment_type: payment_type,
                             brand: brand,
                             card_brand: card_brand,
                             qr_brand: qr_brand,
                             online_brand: online_brand,
                             dynamic_info: dynamic_info,
                             support_auth_capture: support_auth_capture,
                             requires_full_name: requires_full_name,
                             requires_cvv: requires_cvv,
                             countries_allowed: countries_allowed,
                             supported_currencies: supported_currencies,
                             cvv_auth: cvv_auth,
                             installment_capable: installment_capable,
                             mcp_capable: mcp_capable,
                             mcp_only: mcp_only,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 89

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_type'] = 'payment_type'
  @_hash['brand'] = 'brand'
  @_hash['card_brand'] = 'card_brand'
  @_hash['qr_brand'] = 'qr_brand'
  @_hash['online_brand'] = 'online_brand'
  @_hash['dynamic_info'] = 'dynamic_info'
  @_hash['support_auth_capture'] = 'support_auth_capture'
  @_hash['requires_full_name'] = 'requires_full_name'
  @_hash['requires_cvv'] = 'requires_cvv'
  @_hash['countries_allowed'] = 'countries_allowed'
  @_hash['supported_currencies'] = 'supported_currencies'
  @_hash['cvv_auth'] = 'cvv_auth'
  @_hash['installment_capable'] = 'installment_capable'
  @_hash['mcp_capable'] = 'mcp_capable'
  @_hash['mcp_only'] = 'mcp_only'
  @_hash
end

.nullablesObject

An array for nullable fields



131
132
133
134
135
136
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 131

def self.nullables
  %w[
    countries_allowed
    supported_currencies
  ]
end

.optionalsObject

An array for optional fields



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 110

def self.optionals
  %w[
    payment_type
    brand
    card_brand
    qr_brand
    online_brand
    dynamic_info
    support_auth_capture
    requires_full_name
    requires_cvv
    countries_allowed
    supported_currencies
    cvv_auth
    installment_capable
    mcp_capable
    mcp_only
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 231

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type.inspect}, brand: #{@brand.inspect},"\
  " card_brand: #{@card_brand.inspect}, qr_brand: #{@qr_brand.inspect}, online_brand:"\
  " #{@online_brand.inspect}, dynamic_info: #{@dynamic_info.inspect}, support_auth_capture:"\
  " #{@support_auth_capture.inspect}, requires_full_name: #{@requires_full_name.inspect},"\
  " requires_cvv: #{@requires_cvv.inspect}, countries_allowed: #{@countries_allowed.inspect},"\
  " supported_currencies: #{@supported_currencies.inspect}, cvv_auth: #{@cvv_auth.inspect},"\
  " installment_capable: #{@installment_capable.inspect}, mcp_capable:"\
  " #{@mcp_capable.inspect}, mcp_only: #{@mcp_only.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



219
220
221
222
223
224
225
226
227
228
# File 'lib/univapay_client_sdk/models/checkout_supported_brand.rb', line 219

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type}, brand: #{@brand}, card_brand:"\
  " #{@card_brand}, qr_brand: #{@qr_brand}, online_brand: #{@online_brand}, dynamic_info:"\
  " #{@dynamic_info}, support_auth_capture: #{@support_auth_capture}, requires_full_name:"\
  " #{@requires_full_name}, requires_cvv: #{@requires_cvv}, countries_allowed:"\
  " #{@countries_allowed}, supported_currencies: #{@supported_currencies}, cvv_auth:"\
  " #{@cvv_auth}, installment_capable: #{@installment_capable}, mcp_capable: #{@mcp_capable},"\
  " mcp_only: #{@mcp_only}, additional_properties: #{@additional_properties}>"
end