Class: GoCardlessPro::Resources::PayerAuthorisation
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::PayerAuthorisation
- Defined in:
- lib/gocardless_pro/resources/payer_authorisation.rb
Overview
Don't use Payer Authorisations for new integrations. It is deprecated in favour of
Billing Requests
(https://developer.gocardless.com/getting-started/billing-requests/overview/). Use Billing Requests to build any future integrations.
Payer Authorisation resource acts as a wrapper for creating customer, bank account and mandate details in a single request. PayerAuthorisation API enables the integrators to build their own custom payment pages.
The process to use the Payer Authorisation API is as follows:
- Create a Payer Authorisation, either empty or with already available information
- Update the authorisation with additional information or fix any mistakes
- Submit the authorisation, after the payer has reviewed their information
- [coming soon] Redirect the payer to the verification mechanisms from the response of the Submit request (this will be introduced as a non-breaking change)
- Confirm the authorisation to indicate that the resources can be created
After the Payer Authorisation is confirmed, resources will eventually be created as it's an asynchronous process.
To retrieve the status and ID of the linked resources you can do one of the following:
- Listen to payer_authorisation_completed webhook (https://developer.gocardless.com/api-reference/#appendix-webhooks) (recommended)
- Poll the GET endpoint (https://developer.gocardless.com/api-reference/#payer-authorisations-get-a-single-payer-authorisation)
- Poll the GET events API #id&action=completed">https://api.gocardless.com/events?payer_authorisation=#id&action=completed
Note that the create and update endpoints behave differently than
other existing create and update endpoints. The Payer Authorisation is
still saved if incomplete data is provided.
We return the list of incomplete data in the incomplete_fields along
with the resources in the body of the response.
The bank account details(account_number, bank_code & branch_code) must be
sent together rather than splitting across different request for both
create and update endpoints.
The API is designed to be flexible and allows you to collect information
in multiple steps without storing any sensitive data in the browser or in your servers.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#bank_account ⇒ Object
readonly
Returns the value of attribute bank_account.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#incomplete_fields ⇒ Object
readonly
Returns the value of attribute incomplete_fields.
-
#mandate ⇒ Object
readonly
Returns the value of attribute mandate.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ PayerAuthorisation
constructor
Initialize a payer_authorisation resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the payer_authorisation resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ PayerAuthorisation
Initialize a payer_authorisation resource instance
78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 78 def initialize(object, response = nil) @object = object @bank_account = object['bank_account'] @created_at = object['created_at'] @customer = object['customer'] @id = object['id'] @incomplete_fields = object['incomplete_fields'] @links = object['links'] @mandate = object['mandate'] @status = object['status'] @response = response end |
Instance Attribute Details
#bank_account ⇒ Object (readonly)
Returns the value of attribute bank_account.
68 69 70 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 68 def bank_account @bank_account end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
69 70 71 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 69 def created_at @created_at end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
70 71 72 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 70 def customer @customer end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
71 72 73 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 71 def id @id end |
#incomplete_fields ⇒ Object (readonly)
Returns the value of attribute incomplete_fields.
72 73 74 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 72 def incomplete_fields @incomplete_fields end |
#mandate ⇒ Object (readonly)
Returns the value of attribute mandate.
73 74 75 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 73 def mandate @mandate end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
74 75 76 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 74 def status @status end |
Instance Method Details
#api_response ⇒ Object
92 93 94 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 92 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
97 98 99 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 97 def links @payer_authorisation_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the payer_authorisation resource as a hash of all its readable attributes
102 103 104 |
# File 'lib/gocardless_pro/resources/payer_authorisation.rb', line 102 def to_h @object end |