PayPal

From PhpCOIN Documentation

Jump to: navigation, search

Using PayPal as a payment method is a simple process:

  1. Goto http://www.paypal.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


Contents

Admin -> Vendors

If PayPal 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 PayPal 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:  	PayPal (for the drop-down lists)
Buy Return Param Name:  	paypal (notice it is lowercase)
Buy Return Param Value:  	1
URL / Website:  	http://www.paypal.com
Use IPN:  	No (YES if you want to use the IPN option)
Notes:  	(whatever you want, this is for your eyes only)


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" field, changing the parameters shown in bold:

Vendor Product Id:  	(Auto-created by phpCOIN)
Vendor ID:  	(From the drop-down, choose "PayPal")
Product ID:  	(From the drop-down, choose the product that this
               PayLink applies to)
Description:  	PayPal Product x (for listing)
Order Link:  	(This is for the "pay link" html provided by
               PayPal, such as:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business"
                     value="YOURPAYPALEMAIL@YOURDOMAIN.COM">
<input type="hidden" name="item_name" value="<prod_desc>">
<input type="hidden" name="item_number" value="<prod_desc>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="<total_amt>">
<input type="hidden" name="invoice" value="<invoice_id>">
<input type="hidden" name="return" value="<return_link_buy>">
<input type="hidden" name="cancel_return"
                     value="<return_link_cancel>">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif"
            border="0" name="submit"
            alt="Make payment - it is fast, free and secure!">
</form>

In the above PayLink, the <> tells phpCOIN that it should replace the variable name with the actual value at run-time. For example, leaving <return_link_buy> means that phpCOIN will enter the actual return URL when it displays an order PayLink. It also means that you could move your site to another URL entirely but would not need to adjust your PayLinks.

The sample link will let the customer come back to your site upon payment completion so the orders module can finish processing (by calling the WHM add-on to create the server account, for example).


IPN

If you are using IPN you should still use the above sample PayLink, but also add one line to it:

 <input type="hidden" name="notify_url"
    value="<return_link_ipn>paypal.php">

By adding the above line to your PayLinks, a customer can still return to your site as before and PayPal will also send the payment info to the IPN module so it can be matched against invoices just in case the customer does not come back. If you are using the phpCOIN IPN, do NOT setup IPN or any sort of return URL on PayPal site ~ simply let the PayLink pass the parameters.

If you use IPN, you will need to set Admin -> Vendors -> PayPal -> Use IPN to YES and then edit your IPN configuration in Admin -> Parameters -> xxxxxx -> ipn


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 PayPal as a payment method.

Personal tools

Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com