Creating a Payment Session Tutorial
This tutorial is for your back-end server.
In this tutorial, we will cover creating a payment session, by calling the Judopay Transaction API. The purpose of the payment session is to verify the identity of the cardholder, to prevent fraudulent transactions and refunds.
The payment session reference is used when calling our Web SDK’s payment functions from your client side.
In this tutorial, we will be using PHP as our server-side scripting language. You may use any server-side language you wish, as we have a REST API (which responds with JSON).
We have created video chapters from the full tutorial, to help you easily re-watch different parts of the tutorial. We have included an overview and example code snippets for each section below:
When using the code snippets, ensure to replace any field values with your own values.
Payment Flow:
To make a request to Judopay’s Transaction API we first need to define:
- The request headers
- The environment server URL
- The request endpoint
- The request body
Ensure that the data used here, is also used later when calling Web SDK functions from your client side. For example judoId, API Token / Secret, yourConsumerReference.
Pulling together everything we have defined, to make a POST request to Judopay’s Transaction API payment session endpoint.
For a successful response, the payment session reference value should be stored in your backend server. This value should be passed to your client side when it is calling Web SDK functions (where the reference value is passed as a parameter).