Use Case 1: Payments
This use case enables your consumer to choose EPS as a payment option on your webstore and to make a payment using their online bank.
Implementation
Call the following endpoints in sequence:
-
/paymenthub/v1/banks
Provides you with a list of banks supported by EPS so that your consumer can select their bank on your webstore. -
/paymenthub/v1/paymenthandles
Initializes the payment process and provides you with a URL to redirect the consumer to their chosen bank.
Redirect the consumer to the provided URL so that they can authorize payment using their online banking platform.
-
/paymenthub/v1/payments
Call the payments endpoint to complete the payment within 15 minutes.
NOTE: For code examples and detailed explanations of the parameters, refer to the Payments API Reference.
STEP 1: Call getBank
-
Call endpoint /paymenthub/v1/banks
- countryCode: AT
- currencyCode: EUR
- accountId: 12345612
- paymentType: EPS
-
Call endpoint /paymenthub/v1/paymenthandles
- transactionType: PAYMENT
- paymentType: EPS
-
Pass the required parameters in the EPS object (i.e. the code of the bank selected by the consumer).
-
Paysafe creates a payment handle and returns our standard gateway response, indicating either a positive or negative outcome.
Positive outcome: Happy path
Outcome Paysafe
HTTP
Status CodeNext
stepThe request succeeds and
a redirection link is returned
in the response.200
Redirect the consumer
to the redirection link.Negative outcome: Unhappy path - the request fails
For error codes, refer to the API Reference.
-
The payment handle status depends on the outcome of the request:
- For positive scenarios, the payment handle is created with status INITIATED.
- For negative scenarios, the payment handle is created with status FAILED.
STEP 2(b): Redirect consumer
-
Redirect the consumer to the URL provided in the payment handle response.
- The payment handle status changes to PROCESSING.
-
The consumer authorizes the payment with their online bank and agrees to connect their account with you.
-
Paysafe returns a webhook response, indicating either a positive or negative outcome.
-
The payment handle status depends on the consumer's action or outcome:
- For positive scenarios, where the consumer successfully authorizes the transaction, the status changes to PAYABLE.
- For negative scenarios, where the consumer abandons the transaction or the authorization fails, the status changes to FAILED.
NOTE: If the payment handle token is not used within 15 minutes, it expires, and the payment handle status changes to EXPIRED.
STEP 3: Call payments
-
Use the profile data returned in the response to the payment handle request to decide whether to proceed with the payment.
-
Call endpoint /paymenthub/v1/payments using the paymentHandleToken.
-
Paysafe returns our standard gateway response, indicating either a positive or negative outcome.
-
The payment status depends on the outcome of the request:
- For positive scenarios, the status changes to COMPLETED.
- For negative scenarios, the status changes to FAILED.