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.
How it works
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 with a form-encoded body (Content-Type: application/x-www-form-urlencoded). See Request Encoding for examples in several languages. 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 and time for the prepared payment token, e.g. 2026-11-30T23:59:00+00:00. Must be in the future. | O | V | 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 | VTaaDoPZM61g7JTHLpU6Nw!fhuHLJWFcPPpKXTVy4akzdMYIhvDlBzod4ZxzU5CVmoHiEGaHR74bi0x2C1pnWjPXuei-IyNWGGv3Ha3kaEJemr2C8Gx4s7hdYnaRpViSy3Y0UeYxueTC7KjX-SDUooo |
| XML | <?xml version="1.0" encoding="UTF-8"?><PreparedPayment><Token>s74SwcWttJNGh_RJA2yMug!nIbPKJerkXC0AQuOVCdAwDWBVrmnLEh5Q8SkkU4UJ6RP6C-mSMtb26zTSLgzGLwx7xmfmNS7yFgfrPCTm9yo0tsjJ1mxXnptC1yQd9FLi6BnWALuTh8kjnsRNvQVtT1s</Token><ExpiryDate>2026-11-03T13:56:14.3807959+00:00</ExpiryDate></PreparedPayment> |
| JSON | {"Token":"ros0r__702oH-XcyyZgmyQ!5CrFNkEJ-r53YBpWXQq11lOkElVHgdPCPyyKYn20WuQ6N69AC7s4ivZRRwrf9oMU3TzHDTrxXbmvJ6l2h-8QPVXx2Xgz16L9I6vaIyZyW2e-adMurPcPFq-g8YPVXE2M","ExpiryDate":"2026-11-03T13:56:14.4865936+00: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, redirect the customer to the Checkout Page (Checkout.aspx or CheckoutLite.aspx), 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 | V | A |
e.g., https://elite.monek.com/Secure/Checkout.aspx?PaymentToken=ros0r__702oH-XcyyZgmyQ!5CrFNkEJ-r53YBpWXQq11lOkElVHgdPCPyyKYn20WuQ6N69AC7s4ivZRRwrf9oMU3TzHDTrxXbmvJ6l2h-8QPVXx2Xgz16L9I6vaIyZyW2e-adMurPcPFq-g8YPVXE2M