Class: MercadoPago::CustomCheckout::CardToken
- Defined in:
- lib/mercadopago/custom_checkout/card_token.rb
Instance Attribute Summary collapse
-
#card_id ⇒ Object
readonly
Returns the value of attribute card_id.
-
#cardholder ⇒ Object
readonly
Returns the value of attribute cardholder.
-
#extras ⇒ Object
readonly
Returns the value of attribute extras.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_digits ⇒ Object
readonly
Returns the value of attribute last_digits.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #create(payload) ⇒ Object
-
#initialize(client, id:, **extras) ⇒ CardToken
constructor
A new instance of CardToken.
- #retrieve ⇒ Object
- #update(payload) ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(client, id:, **extras) ⇒ CardToken
Returns a new instance of CardToken.
6 7 8 9 10 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 6 def initialize(client, id:, **extras) @client = client @id = id process_hash(extras) if extras end |
Instance Attribute Details
#card_id ⇒ Object (readonly)
Returns the value of attribute card_id.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 4 def card_id @card_id end |
#cardholder ⇒ Object (readonly)
Returns the value of attribute cardholder.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 4 def cardholder @cardholder end |
#extras ⇒ Object (readonly)
Returns the value of attribute extras.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 4 def extras @extras end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 4 def id @id end |
#last_digits ⇒ Object (readonly)
Returns the value of attribute last_digits.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 4 def last_digits @last_digits end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 4 def status @status end |
Instance Method Details
#create(payload) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 12 def create(payload) response = @client.call(:card_tokens, :create, payload) if response.key?(:error) response else process_hash(response) self end end |
#retrieve ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 22 def retrieve response = @client.call(:card_tokens, :retrieve, { id: id }) if response.key?(:error) response else process_hash(response) self end end |
#update(payload) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/mercadopago/custom_checkout/card_token.rb', line 32 def update(payload) response = @client.call(:card_tokens, :update, payload) if response.key?(:error) response else process_hash(response) self end end |