Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Supporting Multiple Payment types

Adrian Singer, 09-23-2008
The SoftwareProjects Shopping Cart was designed to make supporting multiple payment types as easy as possible.

Allowing your customers to use more than one payment option, can greatly increase your conversion rates.

As part of this post, I will walk you through the process of setting up support for payments by PayPal in addition to the built-in default payment by credit cards.

Step 1: Setup PayPal payment gateway

Login to your SoftwareProjects account, click on 'Product Manager', select 'Payment Gateways' and add a new Payment Gateway for PayPal.

All you really have to specify here is your PayPal Email address:



Step 2: Associate new Payment Gateway with a store

While still logged-in to the Product Manager module, click on 'Stores', select your primary store and associate the new PayPal gateway with your store.



Step 3: Update checkout HTML screen

Your checkout screen (you can have more than one), needs to allow users to choose between the different payment options you offer.

Edit the checkout screen - under the 'System Branding' interface, adding a radio button named "payment_method" to control whether the payment type is "creditcard", "paypal", "echeck", "westernunion" or "wiretransfer"

It is important to name this field payment_method as it is retrieved by the shopping cart.

In the example below, I am using a checkout form that has two options - payment by Credit Card or PayPal.



Step 4: Update shopping-cart calling code

We're just about done. The last step of this process, is to add a 'self' variable to the code that calls the SoftwareProjects Shopping cart.

The self variable should point to the full-path of the calling page. When using a third party payment gateway (such as PayPal), this variable is passed over to PayPal so that PayPal knows where to redirect the user after they've successfully completed the payment.

You'll have to update calls to do_checkout and do_backgroundcheckout similar to the example below:


 
// Do one click order of resellerproduct
 
$input = array();
 
$input['self']    = "https://www.mydomain.com/mypage.php";
 
$input['store_id']    = $store_id;
 
$input['product_codename']  = $product_name;

 
// Checkout
 
if (do_checkout($input, &$output, &$ResultStr))
  {
  }


 
// Do one click order of resellerproduct
 
$input = array();
 
$input['self']    = "https://www.mydomain.com/mypage.php";
 
$input['store_id']    = $store_id;
 
$input['product_codename']  = $product_name;
 
// Note we have to pass the payment_method to background checkout
 
$input['payment_method']  = "paypal";

 
// Checkout
 
if (do_backgroundcheckout($input, &$output, &$ResultStr))
  {
  }

Important Tips

* Make sure you are using the latest version of the SoftwareProjects Shopping cart API. If unsure, login to your account, click on 'Product Manager' and then 'Settings' to download the latest version.

* Always place calls to do_checkout() and do_backgroundcheckout() at the top of your scripts, BEFORE any output is sent to the browser. This is important because otherwise the Header redirect command sending the user to the third-party payment page, will not work properly

Any questions? Please post your comments here or Contact us directly.
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions