Class: Mercadopago::PreapprovalPlan

Inherits:
MPBase
  • Object
show all
Defined in:
lib/mercadopago/resources/preapproval_plan.rb

Overview

Instance Method Summary collapse

Methods inherited from MPBase

#_check_headers, #_check_request_options, #_delete, #_get, #_post, #_put, #initialize

Constructor Details

This class inherits a constructor from Mercadopago::MPBase

Instance Method Details

#create(preapproval_plan_data, request_options: nil) ⇒ Object

Raises:

  • (TypeError)


24
25
26
27
28
# File 'lib/mercadopago/resources/preapproval_plan.rb', line 24

def create(preapproval_plan_data, request_options: nil)
  raise TypeError, 'Param preapproval_plan_data must be a Hash' unless preapproval_plan_data.is_a?(Hash)

  _post(uri: '/preapproval_plan/', data: preapproval_plan_data, request_options: request_options)
end

#get(preapproval_plan_id, request_options: nil) ⇒ Object



20
21
22
# File 'lib/mercadopago/resources/preapproval_plan.rb', line 20

def get(preapproval_plan_id, request_options: nil)
  _get(uri: "/preapproval_plan/#{preapproval_plan_id}", request_options: request_options)
end

#search(filters: nil, request_options: nil) ⇒ Object

Raises:

  • (TypeError)


14
15
16
17
18
# File 'lib/mercadopago/resources/preapproval_plan.rb', line 14

def search(filters: nil, request_options: nil)
  raise TypeError, 'Param filters must be a Hash' unless filters.nil? || filters.is_a?(Hash)

  _get(uri: '/preapproval_plan/search', filters: filters, request_options: request_options)
end

#update(preapproval_plan_id, preapproval_plan_data, request_options: nil) ⇒ Object

Raises:

  • (TypeError)


30
31
32
33
34
# File 'lib/mercadopago/resources/preapproval_plan.rb', line 30

def update(preapproval_plan_id, preapproval_plan_data, request_options: nil)
  raise TypeError, 'Param preapproval_plan_data must be a Hash' unless preapproval_plan_data.is_a?(Hash)

  _put(uri: "/preapproval_plan/#{preapproval_plan_id}", data: preapproval_plan_data, request_options: request_options)
end