General
Integration Information
Integration information is available under the Sellers menu item on the website. Take a look at the 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 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 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:
<!-- Receiver Details --> <input type="hidden" name="merchant_id" value="10000001"> <input type="hidden" name="merchant_key" value="ABC123456789"> <input type="hidden" name="return_url" value="http://www.widget.co.za/payment_finished"> <input type="hidden" name="cancel_url" value="http://www.widget.co.za/payment_cancelled"> <input type="hidden" name="notify_url" value="http://www.widget.co.za/payment_notify"> <!-- Payer Details --> <input type="hidden" name="name_first" value="Bob"> <input type="hidden" name="name_last" value="Smith"> <input type="hidden" name="email_address" value="bob.smith@example.com"> <!-- Transaction Details --> <input type="hidden" name="m_payment_id" value="TRN123456789"> <input type="hidden" name="amount" value="200.00"> <input type="hidden" name="item_name" value="Widget Model 123"> <input type="hidden" name="item_description" value="Widget Model 123"> <!-- Transaction Options --> <input type="hidden" name="email_confirmation" value="">
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@example.com&m_payment_id=TRN123456789&amount=200.00&item_name=Widget+Model+123&item_description=Widget+Model+123
Resulting MD5 signature:
dbd8fb88517c0a2a74a043f8b8a4ad14
Note
- Only the non-blank name-value pairs must be used
- The name-value pairs must be in the order as detailed here
- Encoding must generate uppercase chars (eg. %3A and not %3a)
Trace: » whmcs » instant_eft » my_account » payment_confirmation_emails » shopping_cart_systems » ukash » start » php » wp_e-commerce » integration