Class: MercadoPago::CustomCheckout::PaymentMethod

Inherits:
Resource
  • Object
show all
Defined in:
lib/mercadopago/custom_checkout/payment_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#inspect

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(, id:, name:, status:, **extras)
  @account = 
  @id = id.to_sym
  @name = name
  @status = status
  @thumb = extras[:secure_thumbnail]
  @extras = extras
end

Instance Attribute Details

#extrasObject (readonly)

Returns the value of attribute extras.



4
5
6
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4

def extras
  @extras
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 4

def status
  @status
end

#thumbObject (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

#binObject



31
32
33
# File 'lib/mercadopago/custom_checkout/payment_method.rb', line 31

def bin
  extras[:settings][0] && extras[:settings][0][:bin]
end

#card_issuersObject



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

#installmentsObject



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