Payment flow summary

Step 1: Generate signature

After you have collected all relevant information pertaining to the transaction, you need to generate and add a signature to your request for authentication. The signature uses the HMAC SHA256 algorithm and all of the payment parameters in the request. The secret token provided to you by Peach Payments acts as the key to generate the signature.

For more details on how to generate the signature, see the Authentication and authorisation section.

Step 2: Initialise Checkout and redirect customer

After you have generated the signature, you can initialise Checkout using your request parameters and signature and redirect the user to the payment page using one of the following methods:

  • Redirect
  • Form POST

Redirect-based Checkout

Execute the redirect-based Checkout call and redirect the user to the URL that is returned.

Form POST Checkout

Execute the Checkout call and use a form POST to redirect the user to the payment page:

<!doctype html>
<form name="form" action="" method="POST" accept-charset="utf-8">
    <input type="hidden" name="amount" value="2" />
    <input type="hidden" name="authentication.entityId" value="8ac7a4ca68c22c4d0168c2caab2e0025" />
    <input type="hidden" name="currency" value="ZAR" />
    <input type="hidden" name="merchantTransactionId" value="TESTING002" />
    <input type="hidden" name="nonce" value="Test1234" />
    <input type="hidden" name="paymentType" value="DB" />
    <input type="hidden" name="shopperResultUrl" value="" />
    <input type="hidden" name="signature" value="311ed8e11e2da00d98c7479ca390a5396fe643e13629d850243dada877963afd" />
    <input type="submit" value="Continue to Payment Method"/></form>

Step 3: Query payment status

When the payment has been processed, the customer is redirected to your shopperResultUrl. That redirect is a POST request which has the exact same structure as that of the webhook. A request can be made to obtain the status of a Checkout payment request by using the checkoutId parameter as a reference to the payment.

The checkoutId is provided in both the webhook notification and the POST redirect to the shopperResultUrl.


API endpoint

The API base URL for querying the payment status differs from that of payment initiation in step 2 above. This API forms part of our back office APIs.

import requests

url = ""

payload = {}
headers= {}

response = requests.request("GET", url, headers=headers, data = payload)

curl --location --request GET ''