Use Case 1: Payments
This use case enables your consumer to choose an Openbucks payment method as a payment option on your webstore and to make a payment.
Implementation
Call the following endpoints in sequence:
-
/paymenthub/v1/paymenthandles
Initializes the payment process and provides you with a URL to redirect the consumer.
Redirect the consumer to the provided URL so that they can complete the payment by providing the gift card number and PIN.
-
/paymenthub/v1/payments
Call the payments endpoint to complete the payment within 15 minutes - after this, the payment handle expires.
NOTE: For code examples and detailed explanations of the parameters, refer to the Payments API Reference.
-
Call endpoint /paymenthub/v1/paymenthandles
- transactionType: PAYMENT
- paymentType: GIFTCARDS/ CVS/ DOLLAR_GENERAL/ OPENBUCKS
-
Pass the required parameters in the profile object.
-
Paysafe creates a payment handle and returns our standard gateway response, indicating either a positive or negative outcome.
Happy path: consumer initiates payment
Outcome Paysafe
HTTP
Status CodeLPM Error
Code/ MessageCan be
simulated?How to
simulate?Payment
handle
statusNext
actionThe consumer
initiates a payment
request.201
YES
Pass INTERNAL
as the simulator
field value in your
request header.INITIATED
Go to step 2 to
redirect and
complete the
payment. -
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: Redirect consumer
-
Redirect the consumer to the URL provided in the payment handle response.
- The payment handle status changes to PROCESSING.
-
The consumer completes the transaction by providing the gift card number and PIN.
- The payment handle status changes to PAYABLE.
NOTE: When the paymentType is set to GIFTCARDS, the consumer is first redirected to select an available Openbucks payment method (i.e. CVS, Dollar General, or Obucks). After selecting a payment method, they are then redirected to that payment method’s payment page, such as the CVS payment page.
-
Paysafe returns our standard gateway response, indicating either a positive or negative outcome:
Happy path: the payment was successful
Outcome Paysafe
HTTP
Status CodeLPM Error
Code/ MessageCan be
simulated?How to
simulate?Payment
handle
statusNext
actionThe payment
is authorized.YES
Pass INTERNAL
as the simulator
field value in your
request header.Select COMPLETED
in the payment
status dropdown.PAYABLE
Go to step 3 to
process the
payment.Unhappy path: the payment was declined by Skrill's provider/ internal fraud engine
Outcome Paysafe
HTTP
Status CodeLPM Error
Code/ MessageCan be
simulated?How to
simulate?Payment
handle
statusNext
actionThe payment
is declined
i.e. it fails.YES
Pass INTERNAL
as the simulator
field value in your
request header.Select FAILED
in the payment
status
dropdown.FAILED
-
The payment handle status depends on the outcome:
- For positive scenarios, the status changes to PAYABLE.
- For negative scenarios, the status changes to FAILED.
-
Call endpoint /paymenthub/v1/payments using the paymentHandleToken.
-
Paysafe returns our standard gateway response, indicating either a positive or negative outcome:
Happy path: the payment is successfully submitted
Outcome Paysafe
HTTP
Status CodeLPM Error
Code/ MessageCan be
simulated?How to
simulate?Payment
handle
statusNext
actionThe payment
is completed.201
YES
Pass INTERNAL
as the simulator
field value in your
request header.Select COMPLETED
in the payment
status dropdown.COMPLETED
-
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.
- For negative scenarios where the token expires after 15 minutes, the status changes to EXPIRED.