Using payfast payment system in South Africa

Problems installing or using the NOP Design Free Shopping Cart that do not fit into one of the above categories.

Moderators: Stefko, Randy, Koibito

Using payfast payment system in South Africa

Postby keesmarcha » Mon Nov 04, 2013 10:31 pm

I need to go from my managecart.html to payfast. Everything works up to managecart, then when u submit, it want to send a email with the information.
1. When you press Check Out i need it to go to Payfast with all the info for the customer to pay for goods. We cannot use paypal in South Africa
2. payfast wrote a small script to work via paypal back to them. This script must be on every selling page ( the script was for Simplecart)
3. can some help to change the script to work with nopcart.

This is what mySelling page looks like :

<!--Shopping Cart Product Begin-->
<P><FORM NAME=order>
<input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1">
<input type=hidden name="PRICE" value="582.00">
<input type=hidden name="NAME" value=" Boxes Pinotage">
<input type=hidden name="ID_NUM" value="ID 001">
<input type=hidden name="SHIPPING" value="95.95">

<input type=image value=img src="scbut03.gif" alt=""' onClick='AddToCart(this.form)'</a>
<a href="managecart.html"><br><br><img src="checkout.gif" alt=""></a>
<!--Shopping Cart Product End -->

It opens managecart.html and all the items and prices and shipping is like it should be. From there it must go to Payfast. Their script looks like this.

<script type="text/javascript">
checkout: {
type: "SendForm" ,
url: "" ,

// HTTP method for form, "POST"
method: "POST" ,

// URL to redirect browser to after successful checkout
success: "" ,

// URL to redirect browser to after checkout was cancelled by buyer
cancel: "" ,

extra_data: {
currency_code: "ZAR",
merchant_id: "10000100",
merchant_key: "46f0cd694581a",
notify_url: "", //this is the ITN or callback URL
amount:, // Total amount = item1 + item2 + item3 etc
name_first: "Buyer first name",
name_last: "Buyer last name",
beforeCheckout: function( data ){
data.currency = "ZAR";
data.cancel_url = data.cancel_return;
data.return_url = data.return;
var payfast_description = '';
for (var key in data)
if (key.match(/^item_name/))
payfast_description += ' '+data[key];
data.item_description = data.item_name = payfast_description;

Hope some one can help me sort this out. My knowlege of Java Script is far less than my IQ. Im building a wine store and am still using the Nopcart I downloaded in 2010.
Thanking you Kees Meyer
Posts: 2
Joined: Tue Mar 29, 2011 3:45 pm

Return to Help: Cart / General

Who is online

Users browsing this forum: No registered users and 2 guests