Class: MercadoPago::CustomCheckout::PaymentMethod
- Defined in:
- lib/mercadopago/custom_checkout/payment_method.rb
Instance Attribute Summary collapse
-
#extras ⇒ Object
readonly
Returns the value of attribute extras.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#thumb ⇒ Object
readonly
Returns the value of attribute thumb.
Instance Method Summary collapse
- #bin ⇒ Object
- #card_issuers ⇒ Object
-
#initialize(account, id:, name:, status:, **extras) ⇒ PaymentMethod
constructor
A new instance of PaymentMethod.
- #installments ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(account, id:, name:, status:, **extras) ⇒ PaymentMethod
Returns a new instance of PaymentMethod.
6 7 8 9 10 11 12 13 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 6 def initialize(account, id:, name:, status:, **extras) @account = account @id = id.to_sym @name = name @status = status @thumb = extras[:secure_thumbnail] @extras = extras end |
Instance Attribute Details
#extras ⇒ Object (readonly)
Returns the value of attribute extras.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4 def extras @extras end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4 def status @status end |
#thumb ⇒ Object (readonly)
Returns the value of attribute thumb.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4 def thumb @thumb end |
Instance Method Details
#bin ⇒ Object
31 32 33 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 31 def bin extras[:settings][0] && extras[:settings][0][:bin] end |
#card_issuers ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 15 def card_issuers return @card_issuers unless @card_issuers.nil? || @card_issuers.empty? if (response = @account.card_issuers_for(@id)).is_a?(Array) @card_issuers = response end end |
#installments ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 23 def installments return @installments unless @installments.nil? || @installments.empty? if (response = @account.installments_for(@id)).is_a?(Array) @installments = response end end |