2Checkout

From PhpCOIN Documentation

Jump to: navigation, search

Using 2Checkout as a payment method is a simple process:

  1. Goto http://www.2checkout.com and set yourself up with an account
  2. Log into phpCOIN on your website as an admin
  3. Add the vendor
  4. Add paylinks

Admin -> Vendors

If 2Checkout exists in the list of available vendors, you can simply edit the existing record. If it does not exist, then click [Add New] to add 2Checkout as a payment method that you will accept. The info should look like the following:

Vendor ID:  	(will be auto-completed by phpCOIN)
Status:  	On (Off to disable this payment method)
Vendor Name:  	2Checkout (for the drop-down lists)
Buy Return Param Name:  credit_card_processed (IMPORTANT)
Buy Return Param Value: Y (IMPORTANT)
URL / Website:  	http://www.2checkout.com
Use IPN:  	No
Notes:

Admin -> PayLinks

Select the PayLink you want to edit, or click [Create New] to create a new one. Paste the following code into the order link, changing the parameters shown in bold:

Vendor Product Id:  	(Auto-created by phpCOIN)
Vendor ID:  	(From the drop-down, choose "2Checkout")
Product ID:  	(From the drop-down, choose the product that
               this paylink applies to)
Description:  	2Checkout Product x (for listing)
Order Link:  	(This is for the "pay link" html provided by
               2Checkout, such as:
 <form action="https://www.2checkout.com/2co/buyer/purchase" method="post">
 <input type="hidden" name="id_type" value="1">
 <input type="hidden" name="sid" value="XXXXX">
 <input type="hidden" name="c_prod" value="YYYYY">
 <input type="hidden" name="c_name" value="<prod_name>">
 <input type="hidden" name="c_description" value="<prod_desc>">
 <input type="hidden" name="c_price" value="<prod_unit_cost>">
 <input type="hidden" name="c_tangible" value="N">
 <input type="hidden" name="cart_order_id" value="<order_id>">
 <input type="hidden" name="total" value="<total_amt>">
 <input type="submit" value="Click to pay thru 2CheckOut">
 </form>

In the above link, the <> tells phpCOIN that it should replace the tag name with the actual value at run-time. It means that you could move your site to another URL entirely but would not need to adjust your paylinks. XXXXX is your 2Checkout SID, and YYYYY is the product_id as stored on 2Checkout website.


For 2Checkout you enter return URL's at 2Checkout, so only use:

http://my.phpcoin.com/mod.php?mod=orders&mode=return

or https://my.phpcoin.com/mod.php?mod=orders&mode=return as appropriate to your site. Other fields are passed from 2Checkout to determine if the sale was completed or canceled.

An important note: Once your account at 2Checkout is set up, login to their site at https://www.2checkout.com/va/home/ and go to Account -> Site Management and set Direct Return to "Given links back to my site". The direct return option will NOT work with phpCOIN due to the way it operates.

Lather, Rinse, Repeat

Repeat the above steps as many times as necessary, so that you end up with one PayLink for each product or service that will allow 2Checkout as a payment method.

RackSpace Hosting

Personal tools