Module: EPayCo::Client::Plans
- Included in:
- EPayCo::Client
- Defined in:
- lib/epayco/client/plans.rb
Overview
Defines methods related to Plans
Instance Method Summary collapse
-
#plan_all(params = {}) ⇒ Array
Returns all the Plans registered.
-
#plan_create(options = {}) ⇒ Hashie::Mash
Creates a new plan.
-
#plan_details(plan_id, params = {}) ⇒ Hash
Returns the details of a plan.
-
#plan_update(plan_id, fields = {}) ⇒ Hashie::Mash
Updates a new plan.
Instance Method Details
#plan_all(params = {}) ⇒ Array
Returns all the Plans registered
36 37 38 39 40 |
# File 'lib/epayco/client/plans.rb', line 36 def plan_all(params={}) path = "/recurring/v1/plans/#{public_key}" = { return_object: true } get(path, params, ) end |
#plan_create(options = {}) ⇒ Hashie::Mash
Creates a new plan
66 67 68 69 70 |
# File 'lib/epayco/client/plans.rb', line 66 def plan_create(={}) path = "/recurring/v1/plan/create" = { return_object: 'data' } post(path, .merge(public_key: public_key), ) end |
#plan_details(plan_id, params = {}) ⇒ Hash
Returns the details of a plan
108 109 110 111 112 |
# File 'lib/epayco/client/plans.rb', line 108 def plan_details(plan_id, params={}) path = "/recurring/v1/plan/#{public_key}/#{plan_id}" = { return_object: true } get(path, params, ) end |
#plan_update(plan_id, fields = {}) ⇒ Hashie::Mash
Updates a new plan
84 85 86 87 88 |
# File 'lib/epayco/client/plans.rb', line 84 def plan_update(plan_id, fields={}) path = "/recurring/v1/plan/edit/#{public_key}/#{plan_id}" = { return_object: 'data' } put(path, fields, ) end |