public class RedirectFlowService
extends java.lang.Object
Service class for working with redirect flow resources.
Redirect flows enable you to use GoCardless’ hosted payment pages to set up mandates with your customers. These pages are fully compliant and have been translated into Dutch, French, German, Italian, Portuguese, Spanish and Swedish.
The overall flow is:
You create 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_url
with redirect_flow_id=RE123
in the querystring.
You complete the redirect flow, which creates a customer, customer bank account, and mandate, and returns the ID of the mandate. You may wish to create a subscription or payment at this point.
Once you have completed 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.
Modifier and Type | Class and Description |
---|---|
static class |
RedirectFlowService.RedirectFlowCompleteRequest
Request class for
complete(java.lang.String) . |
static class |
RedirectFlowService.RedirectFlowCreateRequest
Request class for
create() . |
static class |
RedirectFlowService.RedirectFlowGetRequest
Request class for
get(java.lang.String) . |
Constructor and Description |
---|
RedirectFlowService(HttpClient httpClient)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
RedirectFlowService.RedirectFlowCompleteRequest |
complete(java.lang.String identity)
This creates a customer, customer bank account, and mandate using the details supplied by your customer and returns the ID of the created mandate.
|
RedirectFlowService.RedirectFlowCreateRequest |
create()
Creates a redirect flow object which can then be used to redirect your customer to the GoCardless hosted payment pages.
|
RedirectFlowService.RedirectFlowGetRequest |
get(java.lang.String identity)
Returns all details about a single redirect flow
|
public RedirectFlowService(HttpClient httpClient)
Constructor. Users of this library should have no need to call this - an instance of this class can be obtained by calling GoCardlessClient.redirectFlows()
.
public RedirectFlowService.RedirectFlowCreateRequest create()
Creates a redirect flow object which can then be used to redirect your customer to the GoCardless hosted payment pages.
public RedirectFlowService.RedirectFlowGetRequest get(java.lang.String identity)
Returns all details about a single redirect flow
public RedirectFlowService.RedirectFlowCompleteRequest complete(java.lang.String identity)
This creates a customer, customer bank account, and mandate using the details supplied by your customer and returns the ID of the created mandate.
This will return a redirect_flow_incomplete
error if your customer has not yet been redirected back to your site, and a redirect_flow_already_completed
error if your integration has already completed this flow. It will return a bad_request
error if the session_token
differs to the one supplied when the redirect flow was created.