Class: GoCardlessPro::Services::BillingRequestFlowsService
- Inherits:
-
BaseService
- Object
- BaseService
- GoCardlessPro::Services::BillingRequestFlowsService
- Defined in:
- lib/gocardless_pro/services/billing_request_flows_service.rb
Overview
Service for making requests to the BillingRequestFlow endpoints
Instance Method Summary collapse
-
#create(options = {}) ⇒ Object
Creates a new billing request flow.
-
#initialise(identity, options = {}) ⇒ Object
Returns the flow having generated a fresh session token which can be used to power integrations that manipulate the flow.
Methods inherited from BaseService
#initialize, #make_request, #sub_url
Constructor Details
This class inherits a constructor from GoCardlessPro::Services::BaseService
Instance Method Details
#create(options = {}) ⇒ Object
Creates a new billing request flow. Example URL: /billing_request_flows
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/gocardless_pro/services/billing_request_flows_service.rb', line 16 def create( = {}) path = '/billing_request_flows' params = .delete(:params) || {} [:params] = {} [:params][envelope_key] = params [:retry_failures] = true response = make_request(:post, path, ) return if response.body.nil? Resources::BillingRequestFlow.new(unenvelope_body(response.body), response) end |
#initialise(identity, options = {}) ⇒ Object
Returns the flow having generated a fresh session token which can be used to power integrations that manipulate the flow. Example URL: /billing_request_flows/:identity/actions/initialise
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gocardless_pro/services/billing_request_flows_service.rb', line 39 def initialise(identity, = {}) path = sub_url('/billing_request_flows/:identity/actions/initialise', { 'identity' => identity }) params = .delete(:params) || {} [:params] = {} [:params]['data'] = params [:retry_failures] = false response = make_request(:post, path, ) return if response.body.nil? Resources::BillingRequestFlow.new(unenvelope_body(response.body), response) end |