Class: Mercadopago::SDK
- Inherits:
-
Object
- Object
- Mercadopago::SDK
- Defined in:
- lib/mercadopago/sdk.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#http_client ⇒ Object
Returns the value of attribute http_client.
Instance Method Summary collapse
- #advanced_payment ⇒ Object
- #card ⇒ Object
- #card_token ⇒ Object
- #customer ⇒ Object
- #disbursement_refund ⇒ Object
- #identification_type ⇒ Object
-
#initialize(access_token, http_client: nil, request_options: nil) ⇒ SDK
constructor
A new instance of SDK.
- #merchant_order ⇒ Object
- #payment ⇒ Object
- #payment_methods ⇒ Object
- #preapproval ⇒ Object
- #preapproval_plan ⇒ Object
- #preference ⇒ Object
- #refund ⇒ Object
- #request_options ⇒ Object
- #request_options=(value) ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(access_token, http_client: nil, request_options: nil) ⇒ SDK
Returns a new instance of SDK.
8 9 10 11 12 |
# File 'lib/mercadopago/sdk.rb', line 8 def initialize(access_token, http_client: nil, request_options: nil) self.access_token = access_token self.http_client = http_client.nil? ? HttpClient.new : http_client self. = .nil? ? RequestOptions.new(access_token: access_token) : end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/mercadopago/sdk.rb', line 6 def access_token @access_token end |
#http_client ⇒ Object
Returns the value of attribute http_client.
6 7 8 |
# File 'lib/mercadopago/sdk.rb', line 6 def http_client @http_client end |
Instance Method Details
#advanced_payment ⇒ Object
14 15 16 |
# File 'lib/mercadopago/sdk.rb', line 14 def advanced_payment AdvancedPayment.new(, http_client) end |
#card ⇒ Object
18 19 20 |
# File 'lib/mercadopago/sdk.rb', line 18 def card Card.new(, http_client) end |
#card_token ⇒ Object
22 23 24 |
# File 'lib/mercadopago/sdk.rb', line 22 def card_token CardToken.new(, http_client) end |
#customer ⇒ Object
26 27 28 |
# File 'lib/mercadopago/sdk.rb', line 26 def customer Customer.new(, http_client) end |
#disbursement_refund ⇒ Object
30 31 32 |
# File 'lib/mercadopago/sdk.rb', line 30 def disbursement_refund DisbursementRefund.new(, http_client) end |
#identification_type ⇒ Object
38 39 40 |
# File 'lib/mercadopago/sdk.rb', line 38 def identification_type IdentificationType.new(, http_client) end |
#merchant_order ⇒ Object
42 43 44 |
# File 'lib/mercadopago/sdk.rb', line 42 def merchant_order MerchantOrder.new(, http_client) end |
#payment ⇒ Object
46 47 48 |
# File 'lib/mercadopago/sdk.rb', line 46 def payment Payment.new(, http_client) end |
#payment_methods ⇒ Object
50 51 52 |
# File 'lib/mercadopago/sdk.rb', line 50 def payment_methods PaymentMethods.new(, http_client) end |
#preapproval ⇒ Object
62 63 64 |
# File 'lib/mercadopago/sdk.rb', line 62 def preapproval Preapproval.new(, http_client) end |
#preapproval_plan ⇒ Object
66 67 68 |
# File 'lib/mercadopago/sdk.rb', line 66 def preapproval_plan PreapprovalPlan.new(, http_client) end |
#preference ⇒ Object
54 55 56 |
# File 'lib/mercadopago/sdk.rb', line 54 def preference Preference.new(, http_client) end |
#refund ⇒ Object
58 59 60 |
# File 'lib/mercadopago/sdk.rb', line 58 def refund Refund.new(, http_client) end |
#request_options ⇒ Object
88 89 90 91 |
# File 'lib/mercadopago/sdk.rb', line 88 def @request_options.access_token = @access_token if @request_options.access_token.nil? @request_options end |
#request_options=(value) ⇒ Object
82 83 84 85 86 |
# File 'lib/mercadopago/sdk.rb', line 82 def (value) raise TypeError, 'Param request_options must be a RequestOptions object' unless value.is_a?(RequestOptions) @request_options = value end |