class GoCardlessPro::Resources::RedirectFlow

Redirect flows enable you to use GoCardless' [hosted payment pages](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:

  1. You [create](redirect-flows-create-a-redirect-flow) a redirect flow

for your customer, and redirect them to the returned redirect url, e.g. `pay.gocardless.com/flow/RE123`.

  1. 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_url` with `redirect_flow_id=RE123` in the querystring.

  1. You [complete](redirect-flows-complete-a-redirect-flow) the redirect

flow, which creates a [customer](core-endpoints-customers), [customer bank account](core-endpoints-customer-bank-accounts), and [mandate](core-endpoints-mandates), and returns the ID of the mandate. You may wish to create a [subscription](core-endpoints-subscriptions) or [payment](core-endpoints-payments) at this point.

Once you have [completed](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.

Attributes

confirmation_url[R]
created_at[R]
description[R]
id[R]
metadata[R]
redirect_url[R]
scheme[R]
session_token[R]
success_redirect_url[R]

Public Class Methods

new(object, response = nil) click to toggle source

Initialize a redirect_flow resource instance @param object [Hash] an object returned from the API

# File lib/gocardless_pro/resources/redirect_flow.rb, line 60
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']
  @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

Public Instance Methods

api_response() click to toggle source
# File lib/gocardless_pro/resources/redirect_flow.rb, line 76
def api_response
  ApiResponse.new(@response)
end
to_h() click to toggle source

Provides the redirect_flow resource as a hash of all its readable attributes

# File lib/gocardless_pro/resources/redirect_flow.rb, line 86
def to_h
  @object
end