Table of Contents
Website Payment Variables
Detailes below are the variables sent during a payment request message to PayFast.
Notes:
- A variable can be specified globally on your account or overridden on a per transaction basis. The value provided during a transaction overrides the global setting.
- This is a Boolean variable whose value must be 1 (on) or 0 (off).
Receiver Details
| Name | Description | Required | Length | Notes |
| merchant_id | The Merchant ID as given by the PayFast system. Used to uniquely identify the receiving account. | |||
| merchant_key | The Merchant Key as given by the PayFast system. Used to uniquely identify the receiving account. This provides an extra level of certainty concerning the correct account as both the ID and the Key must be correct in order for the transaction to proceed. | |||
| return_url | The URL where the user is returned to after payment has been successfully taken. Default: PayFast homepage |
1 | ||
| cancel_url | The URL where the user should be redirected should they choose to cancel their payment while on the PayFast system. Default: PayFast homepage |
1 | ||
| notify_url | The URL which is used by PayFast to post the Instant Transaction Notifications (ITNs) for this transaction. | 1 |
Payer Details
While most of these fields are optional, it is highly recommended to provide this information (if available) as it is used to pre-populate any forms the user needs to fill in which decreases the time taken to complete the transaction.
| Name | Description | Required | Length | Notes |
| name_first | First name of the payer/sender. | 100 char | ||
| name_last | Last name of the payer/sender. | 100 char | ||
| email_address | Email address of the payer/sender. | 100 char |
Transaction Details
| Name | Description | Required | Length | Notes |
| m_payment_id | Unique payment ID on the merchant's system. | 100 char | ||
| amount | The amount which the payer must pay. | |||
| item_name | The name of the item being charged for. | 100 char | ||
| item_description | The description of the item being charged for. | 255 char | ||
| custom_str1..5 | A series of 5 custom string variables (custom_str1, custom_str2...) which can be used by the merchant as pass-through variables. They will be posted back to the merchant at the completion of the transaction. | 255 char | ||
| custom_int1..5 | A series of 5 custom integer variables (custom_int1, custom_int2...) which can be used by the merchant as pass-through variables. They will be posted back to the merchant at the completion of the transaction. |
Transaction Options
| Name | Description | Required | Length | Notes |
| email_confirmation | Whether to send email confirmation to the merchant of the transaction. Email confirmation is automatically sent to the payer. | 1, 2 | ||
| confirmation_address | The address to send the confirmation email to. | 100 char | 1 |
Security
| Name | Description | Required | Length | Notes |
| signature | A security signature of the transmitted data taking the form of an MD5 hash of the submitted variables. The string from which the hash is created, is the concatenation of the name value pairs of all the non-blank variables with '&' used as a separator eg. "name_first=John&name_last=Doe&email_address=..." where pairs are listed in the order in which they appear on this page. This hash will be regenerated by the PayFast engine and the values compared to ensure the integrity of the data transfer. | 32 char |