Module: Payment::Manager::Client
- Defined in:
- lib/payment/manager/client.rb,
lib/payment/manager/client/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/payment/manager/client.rb', line 10 def config @config end |
Class Method Details
.configure {|config| ... } ⇒ Object
12 13 14 15 |
# File 'lib/payment/manager/client.rb', line 12 def configure self.config = Payment::Manager::Config yield(config) end |
.payment_url(plan_id, resource_id) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/payment/manager/client.rb', line 17 def payment_url(plan_id, resource_id) params = { client_id: config.client_id, client_secret: config.client_secret, plan_id: plan_id, resource_id: resource_id } response = Payment::Manager::Request.get(config.api_url + '/api/checkout', params) JSON.parse(response.body)['url'] end |