====== General ======
===== Integration Information =====
Integration information is available under the Sellers menu item on the website. Take a look at the [[https://www.payfast.co.za/c/std/integration|Integration page]] which will give you an overview of the process and link to some of the enhancements to our service (PDT and ITN). You can
also a look at the [[https://www.payfast.co.za/c/std/integration-guide|Integration guide]].
===== Sandbox credentials =====
Generic sandbox credentials are available with which you can test standard integration and PDT. These are detailed below
**Merchant account**
* Username: sbtm01@payfast.co.za
* Account Name: Sandbox Text
* Merchant ID: 10000100
* Merchant Key: 46f0cd694581a
* PDT: Enabled
* PDT Key: 0a1e2e10-03a7-4928-af8a-fbdfdfe31d43
* ITN: Disabled (Use notify_url to test ITN)
**User account**
* Username: sbtu01@payfast.co.za
* Password: clientpass
To test ITN, simply set the notify_url variable when posting to the sandbox. On the live site, you can set notify_url globally on your account such that it doesn't have to be set with each call to PayFast if you would prefer.
===== Signature generation =====
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 [[https://www.payfast.co.za/c/std/website-payments-variables|this page]].
Additionally, the values for the signature need to be URL encoded and all URL encoding needs to generate upper case encoding characters.
==== Signature generation example ====
**Payment form:**
**String used for MD5 generation (Not encoded):**
merchant_id=10000001&merchant_key=ABC123456789&return_url=http://www.widget.co.za/payment_finished&cancel_url=http://www.widget.co.za/payment_cancelled¬ify_url=http://www.widget.co.za/payment_notify&name_first=Bob&name_last=Smith&email_address=bob.smith@example.com&m_payment_id=TRN123456789&amount=200.00&item_name=Widget Model 123&item_description=Widget Model 123
**String used for MD5 generation(Encoded):**
merchant_id=10000001&merchant_key=ABC123456789&return_url=http%3A%2F%2Fwww.widget.co.za%2Fpayment_finished&cancel_url=http%3A%2F%2Fwww.widget.co.za%2Fpayment_cancelled¬ify_url=http%3A%2F%2Fwww.widget.co.za%2Fpayment_notify&name_first=Bob&name_last=Smith&email_address=bob.smith%40example.com&m_payment_id=TRN123456789&amount=200.00&item_name=Widget+Model+123&item_description=Widget+Model+123
**Resulting MD5 signature:**
99e69e784cb5a407a82434353f5d0d46
** Note **
- Only the **non-blank** name-value pairs must be used
- The name-value pairs must be in the **order** as detailed [[https://www.payfast.co.za/c/std/website-payments-variables|here]]
- Encoding must generate **upper-case chars** (eg. %3A and not %3a)