Class: Mercadopago::Card
- Inherits:
-
MPBase
- Object
- MPBase
- Mercadopago::Card
show all
- Defined in:
- lib/mercadopago/resources/card.rb
Overview
Instance Method Summary
collapse
Methods inherited from MPBase
#_check_headers, #_check_request_options, #_delete, #_get, #_post, #_put, #initialize
Instance Method Details
#create(customer_id, card_data, request_options: nil) ⇒ Object
17
18
19
20
21
|
# File 'lib/mercadopago/resources/card.rb', line 17
def create(customer_id, card_data, request_options: nil)
raise TypeError, 'Param card_data must be a Hash' if card_data.nil? || !card_data.is_a?(Hash)
_post(uri: "/v1/customers/#{customer_id}/cards/", data: card_data, request_options: request_options)
end
|
#delete(customer_id, card_id, request_options: nil) ⇒ Object
23
24
25
|
# File 'lib/mercadopago/resources/card.rb', line 23
def delete(customer_id, card_id, request_options: nil)
_delete(uri: "/v1/customers/#{customer_id}/cards/#{card_id}", request_options: request_options)
end
|
#get(customer_id, card_id, request_options: nil) ⇒ Object
13
14
15
|
# File 'lib/mercadopago/resources/card.rb', line 13
def get(customer_id, card_id, request_options: nil)
_get(uri: "/v1/customers/#{customer_id}/cards/#{card_id}", request_options: request_options)
end
|
#list(customer_id, request_options: nil) ⇒ Object
27
28
29
|
# File 'lib/mercadopago/resources/card.rb', line 27
def list(customer_id, request_options: nil)
_get(uri: "/v1/customers/#{customer_id}/cards", request_options: request_options)
end
|