Link to plugin page: https://zeroqode.com/plugin/truelayer--1603890102683x450263958728849300
TrueLayer Platform is integrated with UK and EU banks which offer Payment Initiation APIs and provides a single public API that enables clients to request payment via all integrated banks. With this plugin, users can manage payments through Truelayer directly from the Bubble app.
Prerequisites:
You must have a Truelayer developer account to interact with the plugin, which you can easily create here. After that, you can already fully test the Truelayer Payments plugin in a sandbox environment.
At the launch, the plugin supports UK payments (GBP currency) only.
Note: To use the Truelayer Payments plugin in a production (live) environment, you would also have to be approved for access to the Payments API by the Truelayer team.
PAYMENT: Generate Payments Token - generates the payments api access token for the api calls.
Action properties:
For every API Call you have to indicate the following proprieties (environment -sandbox or live), for Create Single Immediate Payment (GBP), Get Single Immediate Payment Statuses, and Get Single Immediate Payment Info API calls you also have to provide the following parameter:
environment: fill it in with ‘-sandbox’ when working in a Sandbox environment, or leave it blank when working in a Live environment
Authorization: string in the following format:
Bearer <access token value>
Use the access token you got from PAYMENT: Generate Payments Token action earlier:
Besides these, for each API call, you have to fill in other properties. Refer to each call properties documentation for more details
Properties:
- amount: the amount of money you are requesting in pennies (mandatory)
- currency: the currency code of the payment in three characters (mandatory, currently only GBP is supported)
- remitter_reference: the reference that will appear on the sender’s bank statement. Note: this can only be 18 characters or less (mandatory)
- beneficiary_name: the name on the receiving account (mandatory)
- beneficiary_sort_code: the sort code of the payer, specify this if you want to lock the account from which the payment is being made if the account is a UK account (mandatory)
- beneficiary_account_number: the account number of the receiving account if the account is a UK account (mandatory)
- beneficiary_reference: the reference that will appear on your bank statement. Note: this can only be 18 characters or less (mandatory)
- redirect_uri: the URL the user should be redirected to after authorizing the payment (mandatory)
Returned values:
error: in case of error, will contain the error message
access_token: access token to be used for all your subsequent calls to Truelayer Payments API
expires_in: the number of seconds until the access token expires
3. Save the access token obtained in the previous step, for later use in API calls:
- step 1:
Log the user out
- step 2:
Clear all the necessary states. For example, on our demo page, we clear the payment_id and
payment_status states:
The Create Single Immediate Payment workflow should include 2 following steps:
Make sure to set all the required fields. Also, make sure to use for redirect_uri the URL where you want the user to be redirected after the payment has been authorized:
2. Open an external website. Make sure to use as the destination the result’s auth_uri obtained in the previous step: