Class: GoCardlessPro::Resources::RedirectFlow
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::RedirectFlow
- Defined in:
- lib/gocardless_pro/resources/redirect_flow.rb
Overview
Deprecated: Redirect Flows are legacy APIs and cannot be used by new integrators. The Billing Request flow (https://developer.gocardless.com/api-reference/#billing-requests) API should be used for your payment flows.
Redirect flows enable you to use GoCardless' hosted payment pages (https://pay-sandbox.gocardless.com/AL000000AKFPFF) to set up mandates with your customers. These pages are fully compliant and have been translated into Danish, Dutch, French, German, Italian, Norwegian, Portuguese, Slovak, Spanish and Swedish.
The overall flow is:
- You create
(https://developer.gocardless.com/api-reference/#redirect-flows-create-a-redirect-flow)
a redirect flow for your customer, and redirect them to the returned
redirect url, e.g.
https://pay.gocardless.com/flow/RE123. - Your customer supplies their name, email, address, and bank account
details, and submits the form. This securely stores their details, and
redirects them back to your
success_redirect_urlwithredirect_flow_id=RE123in the querystring. - You complete (https://developer.gocardless.com/api-reference/#redirect-flows-complete-a-redirect-flow) the redirect flow, which creates a customer (https://developer.gocardless.com/api-reference/#core-endpoints-customers), customer bank account (https://developer.gocardless.com/api-reference/#core-endpoints-customer-bank-accounts), and mandate (https://developer.gocardless.com/api-reference/#core-endpoints-mandates), and returns the ID of the mandate. You may wish to create a subscription (https://developer.gocardless.com/api-reference/#core-endpoints-subscriptions) or payment (https://developer.gocardless.com/api-reference/#core-endpoints-payments) at this point.
Once you have completed
(https://developer.gocardless.com/api-reference/#redirect-flows-complete-a-redirect-flow)
the redirect flow via the API, you should display a confirmation page to
your customer, confirming that their Direct Debit has been set up. You can
build your own page, or redirect to the one we provide in the
confirmation_url attribute of the redirect flow.
Redirect flows expire 30 minutes after they are first created. You cannot complete an expired redirect flow. For an integrator this is shorter and they will expire after 10 minutes.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#confirmation_url ⇒ Object
readonly
Returns the value of attribute confirmation_url.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mandate_reference ⇒ Object
readonly
Returns the value of attribute mandate_reference.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#redirect_url ⇒ Object
readonly
Returns the value of attribute redirect_url.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#session_token ⇒ Object
readonly
Returns the value of attribute session_token.
-
#success_redirect_url ⇒ Object
readonly
Returns the value of attribute success_redirect_url.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ RedirectFlow
constructor
Initialize a redirect_flow resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the redirect_flow resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ RedirectFlow
Initialize a redirect_flow resource instance
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 76 def initialize(object, response = nil) @object = object @confirmation_url = object['confirmation_url'] @created_at = object['created_at'] @description = object['description'] @id = object['id'] @links = object['links'] @mandate_reference = object['mandate_reference'] @metadata = object['metadata'] @redirect_url = object['redirect_url'] @scheme = object['scheme'] @session_token = object['session_token'] @success_redirect_url = object['success_redirect_url'] @response = response end |
Instance Attribute Details
#confirmation_url ⇒ Object (readonly)
Returns the value of attribute confirmation_url.
63 64 65 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 63 def confirmation_url @confirmation_url end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
64 65 66 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 64 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
65 66 67 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 65 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
66 67 68 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 66 def id @id end |
#mandate_reference ⇒ Object (readonly)
Returns the value of attribute mandate_reference.
67 68 69 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 67 def mandate_reference @mandate_reference end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
68 69 70 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 68 def @metadata end |
#redirect_url ⇒ Object (readonly)
Returns the value of attribute redirect_url.
69 70 71 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 69 def redirect_url @redirect_url end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
70 71 72 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 70 def scheme @scheme end |
#session_token ⇒ Object (readonly)
Returns the value of attribute session_token.
71 72 73 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 71 def session_token @session_token end |
#success_redirect_url ⇒ Object (readonly)
Returns the value of attribute success_redirect_url.
72 73 74 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 72 def success_redirect_url @success_redirect_url end |
Instance Method Details
#api_response ⇒ Object
93 94 95 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 93 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
98 99 100 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 98 def links @redirect_flow_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the redirect_flow resource as a hash of all its readable attributes
103 104 105 |
# File 'lib/gocardless_pro/resources/redirect_flow.rb', line 103 def to_h @object end |