PayLinks

From PhpCOIN Documentation

Jump to: navigation, search

Contents

PayLink Basics

A PayLink is the information presented to a web-surfer when it is time for them to pay.

It could be simple instructions such as to where to mail a cheque, or it could be a hyperlink that enables the web-surfer to make payment by credit card. The hyperlink could goto another website such as PayPal or 2Checkout or another "billing vendor", or it could goto a form you created on your site for collecting and processing credit card info, etc. Parameters are passed along in a hyperlink so the other site will know how much to charge, what for, and other things.

When a user is sent back to the orders page by a billing vendor, the incoming data from the billing vendor is scanned for a "buy" parameter. If found, the invoice is marked paid and a "thanks" message is displayed. If the "buy" parameter is not found or not set, the invoice is obviously not marked as paid, and a "sorry" message is displayed. You may read the billing Vendors section for more information on these parameters.

If the Admin -> Vendor -> xxxxx -> Use IPN flag is YES then an order return will not mark an invoice as paid. This is because phpCOIN expects an incoming payment advice connection at a later time, and it would be illogical to have two separate functions at two separate times trying to apply a payment.

In Admin -> Parameters -> PayLinks you will need to create one paylink for each product that will be payable by a specific billing vendor. For instance, if you have two products and one billing vendor, you will need two paylinks. If you have five products and four billing vendors, and want each product payable by any of the four billing vendors, you will need twenty paylinks.

PayLink Operation ~ Orders

When a surfer places an "order", at the end of the process phpCOIN will automatically display a paylink for them to click on in order to pay you. Before displaying the paylink on-screen, phpCOIN will parse the paylink and will replace any variables in the paylink with actual values from this order. Variables that can be used in paylinks are as follows:

 <ord_start_date>
 <ord_domain>
 <prod_id>
 <prod_name>
 <prod_desc>
 <prod_unit_cost>
 <order_id>
 <invoice_id>
 <ord_unit_cost>
 <ord_company>
 <ord_name_first>
 <ord_name_last>
 <ord_name_full>
 <ord_addr_01>
 <ord_addr_02>
 <ord_city>
 <ord_state_prov>
 <ord_country>
 <ord_zip_code>
 <ord_phone>
 <ord_email>
 <ord_optfld_01>
 <ord_optfld_02>
 <ord_optfld_03>
 <ord_optfld_04>
 <ord_optfld_05>
 <tax1_amt>            ~ Tax 1 amount, if any
 <tax2_amt>            ~ Tax 2 amount, if any
 <total_amt>           ~ Total order amount, including taxes
 %CLIENT_ACCOUNT%      ~ IF the function return_client_account_number() exists, phpCOIN will
                         call it and pass the data array to it, then replace the tag with
                         whatever is returned. This would be a custom function that you create
 <return_link_buy>     ~ URL to orders module "successful sale"
 <return_link_cancel>  ~ URL to orders module "cancelled sale"
 <return_link_ipn>     ~ URL to main IPN vendor_files directory. You must append the
                         actual vendor filename to the url, for example:
             <input type="hidden" name="url_notify" value="<return_link_ipn>paypal.php"> 

Simply place the desired variable(s), including the opening and closing brackets, wherever in the paylink that you want the corresponding values to appear. For example, here is a PayPal paylink:

 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
 <input type="hidden" name="cmd" value="_xclick">
 <input type="hidden" name="business" value="YourPaypalEmailAddress@YourDomain.com">
 <input type="hidden" name="item_name" value="<prod_desc>">
 <input type="hidden" name="item_number" value="<prod_id>">
 <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="return" value="<return_link_buy>">
 <input type="hidden" name="cancel_return" value="<return_link_cancel>">
 <input type="hidden" name="url_notify" value="<return_link_ipn>paypal.php">
 <input type="image" src="coin_images/paypal.gif" border="0" name="submit"
        alt="PayPal ~ fast, free and secure!">
</form>

Here is a "combined" paylink that can be used for cheque and/or online banking

 Please remit your cheque or money order for $<total_amt> to:
    Cantex WebServices
    101 Dorchester Street
    Glace Bay, NS  B1A 3E8
    Canada
 
 or
 If you have online banking with Royal Bank or Bank of Montreal or ScotiaBank
 or CIBC, search the list of vendors for "Cantex Consulting Group, Inc." or
 "Cantex CGi". Your account number to pay via online banking is %CLIENT_ACCOUNT%
 and you should pay $<total_amt>

phpCOIN will append the paylink to the order in the database, and if auto-invoice-from-order is enabled, phpCOIN will also append the paylink to the invoice for this order. Note that this PayPal link is also setup to accommodate IPN.

When a site has "show payment method on order form" turned OFF, you must specify the default payment method that phpCOIN will use. Goto Admin -> Parameters -> ordering-> orders -> Default Payment Method On Order Form and set it to whatever you would like.

PayLink Operation ~ Invoices

When you create an invoice manually, phpCOIN will not add a paylink. This is so you can manually enter whatever you want. If you copy/paste an existing paylink, be aware that phpCOIN will not parse the paylink and replace variables on an invoice as it would for an order. When you manually enter a paylink you know what the values should be, so there is no need for phpCOIN to do any variable parsing.

When an invoice is auto-copied by the phpCOIN cron-jobs, any paylink on that invoice will be copied as-is to the new invoice.

When an invoice is auto-created by phpCOIN during the order process, whatever paylink is used for the order will automatically be inserted as-is after parsing into the invoice.


PayLink Encryption

Immediately after phpCOIN parses a paylink to replace variables with values on an order, it checks for the existence of a function called do_encrypt_paylink() If this function exists, phpCOIN will call it, passing in the paylink as it exists at that point in time. You need to create the function and have it perform whatever encryption is needed, returning the encrypted output. While there are several files that could hold the function, we recommend the Custom_Functions override file so it will not be lost with phpCOIN upgrades. If the file does not exist, create it.


Sample PayLinks

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