Payment flow summary


The Redirect-based Checkout sample project enables you to experiment with Redirect-based Checkout and produce a working prototype with minimal changes.

Step 1: Generate signature

After you have collected all relevant transaction information, you need to generate and add a signature to your request for authentication. The signature uses the HMAC SHA256 algorithm and all 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 Hosted Checkout and redirect customer

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

  • Redirect
  • Form POST


For the form POST method, you must sign the data on the backend and execute the POST from the browser.

Run in Postman

Redirect-based Checkout

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

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 checkout status

After payment processing completes, Checkout redirects the customer to your shopperResultUrl. That redirect is a POST request which has the same structure as that of the webhook. You can make a request to get the status of a Checkout request by using the checkoutId parameter as a reference to the payment.

The webhook notification and the POST redirect to the shopperResultUrl include the checkoutId.

import requests

url = ""

payload = {}
headers= {}

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

curl --location --request GET ''

Run in Postman