Prepared Payments
Prepared Payments is a TransactDirect feature that converts a hosted page transaction request into a token that can be used later to render the payment page.
The ability to tokenise the payment request provides many benefits.
- Higher security for transaction request details
- Concise redirect URLs or Iframe links
- Pay-by-Link functionality
A prepared payment token will be valid for the specified period or until an authorised transaction has been completed, whichever comes first.
Creating a Prepared Payment Token
To create a payment token, you can use all the same parameters from a normal Checkout Page request, just send them to the iPayPrepare.ashx
endpoint instead using HTTP POST
. This will return a Prepared Payment Token that can be used to instantiate the Checkout Page without exposing any of the sensitive transaction data.
- Staging:
https://staging.monek.com/Secure/iPayPrepare.ashx
- Production:
https://elite.monek.com/Secure/iPayPrepare.ashx
iPayPrepare supports all standard Checkout Page parameters including Basket Details, 3-D Secure, and customisations.
The iPayPrepare method supports different return formats and validity periods for the requested token and can be configured with the following additional parameters.
Field Name | Description | Req'd | Size | Type |
---|---|---|---|---|
PreparedPaymentAction | Specifies the return type for the prepared payment transaction token. Options are: - Raw - XML - JSON Defaults to Raw if not supplied. | O | 4 max. | A |
PreparedPaymentMinutes | Validity period for the prepared payment token in minutes. | O | 6 | N |
PreparedPaymentExpiry | Specific expiry date for the prepared payment token. | O | 6 | ISO 8601 |
Note: If no expiry details are supplied the prepared payment token will default to 30 minutes.
Token Response Format
Response Type | Description |
---|---|
Raw | 5qw2tBz--9qH_E6PlfSC3R8E3tD4AdDpobpkTSF-HI34CsQzW7iVfLyUdfQPx79KkoCTiSOJBf6zZXNo3OSnuGwCuTUE-RK7F2B6LLesdDE. |
XML | <?xml version="1.0" encoding="UTF-8"?><PreparedPayment><Token>EDG1jdjWAvmOIWYT-pmwvMGUU22yonkUwe1ZiY9qL8GChXzBPfhz5OfOCTgf5IQQ45f1eZVuN5ltb9MmVwQUOZgqHMGvFIs86QmlHIxsx2YM,</Token><ExpiryDate>2018-05-03T12:03:06.8872848+01:00</ExpiryDate></PreparedPayment> |
JSON | {"Token":"Up3giZ1FjQcKx-lac4GjlC9jwnpFzX7HSsrH18r3j1MI5k4H-pYqnfwlGWZkAjVv2DVppDqLq_9lWmdk785QVH-C2tr-Rvh6Ivsd_CuLu2eo","ExpiryDate":"2018-05-03T12:03:00.4680920+01:00"} |
Note: XML and JSON formats will also confirm the exact expiry date and time of the generated token.
Using a Prepared Payment Token
To use the prepared payment token, call the preferred iPay payment page passing the generated token in the PaymentToken
field as GET or POST.
Field Name | Description | Req'd | Size | Type |
---|---|---|---|---|
PaymentToken | Specifies the prepared payment token used to process the payment. | M | 108 | A |
e.g., https://staging.monek.com/Secure/Checkout.aspx?PaymentToken=5qw2tBz--9qH_E6PlfSC3R8E3tD4AdDpobpkTSF-HI34CsQzW7iVfLyUdfQPx79KkoCTiSOJBf6zZXNo3OSnuGwCuTUE-RK7F2B6LLesdDE.