Get started in two steps
In this quickstart, we will walk-through building a project using Klyme’s SDK. By the time you’re done, you’ll be ready to start accepting payments confidently.Prerequisite: Credentials
Before you get started, you must have a set of Klyme credentials which consist of:Merchant UUID Username Password
If you don’t, not to worry. You can request a set of credentials here.
Step 1: Add Klyme SDK to your project
Import the Klyme SDK into your project and add the Klyme HTML element, leaving theid parameter empty.
index.html
Language
Thelang parameter is optional but can be used to preload the Klyme Widget with a specific language pre-selected by default.
Options available are: en de es fi fr it nl pt se
Country (EUR Only)
Thecountry parameter is also optional but can be used to preload the Klyme Widget with banks from a specific region as opposed to displaying the entire European banks list.
Alternatively, you can simply pass through auto as the country parameter and let the Klyme Widget handle everything — automatically detecting the user’s location and displaying region-specific banks.
Options available are: be es fr it nl pt auto
Step 2: Create the Payment Authorisation request
Call theCreate Payment Authorisation endpoint to create a payment authorisation request and generate a unique uuid that you then insert into the id parameter of the
Klyme HTML element.
Request Example
Response Example
uuid's as each one serves as a unique Klyme reference for its corresponding payment.
If everything is set up correctly, you should see something similar to the following.
Payment Status
Once a user has gone through the entire payment flow and successfully authorised a payment with their bank, they will be redirected back to theredirectUrl you will have specified in Step 2 when making the call to Create Payment Authorisation.
When a user is redirected back to the specified redirectUrl, there will be three query parameters appended to it.
uuid status status_code
Example:
https://your-redirect-url.com?uuid=eb2de72be97c464a3c293a57fe7a8f64&status=1&status_code=ACCCYou can use the
status parameter to determine whether the payment was successful, failed or has gone into a pending state.
- Status
1implies the payment flow has been successful and the funds have left the users bank account. - Status
0implies the payment was rejected or failed due to technical issues on the banks side. - Status
2implies the payment is in a pending state and the customers bank has further checks to complete before the payment is authorised.
Complete Payload (Optional)
If you wish to receive the complete payload of a payment, you have two options. Either leverage our Webhook Notifications functionality or you can make an API call to ourGet Payment Status endpoint.
If you choose not to use webhook notifications, you may wish to monitor the status of a payment until it has reached the COMPLETED or FAILED state by polling the Get Payment Status endpoint.
