Home : Digital Asset Management : Programming OpenEdit : ECommerce Setup : Credit Card Gateway
Credit Card Gateway
OpenEdit can be customised to integrate it with a variety of 3rd part Credit Card Gateways.
See the sub-menu for instructions for the integrations done so far.
- Authorize.net
- Echo
- Paypal
- Making a new gateway interface
Paypal
There are various integration options available for PayPal. The following example replaces the checkout button with PayPal's own and passes all the required info to PayPal.
Each item in the OpenEdit cart is listed as a line item in PayPal, so you can use PayPal's features such as packing slip printing.
Example sites with PayPal integration include:
The basic steps are:
- Copy the file:
/base/store/layout/shoppingcartsummary.html
to
/store/layout/shoppingcartsummary.html
- At the bottom of the file add a loop that builds the required PayPal form:
<div align="right">
<form action="https://www.paypal.com/cgi-bin/webscr/" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="MYACCOUNT@MYDOMAIN.COM">
#foreach( $item in $cart.getItems() )
#set( $product = $item.getProduct() )
<input type="hidden" name="item_name_$velocityCount" value="${product.name}">
<input type="hidden" name="item_number_$velocityCount" value="${product.id}">
<input type="hidden" name="amount_$velocityCount" value="$item.getTotalPrice()">
<input type="hidden" name="quantity_$velocityCount" value="$item.getQuantity()">
#end
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.MYSITE.com/messages/paymentThankyou.html">
<input type="hidden" name="cancel_return" value="http://www.MYSITE.com/messages/paymentCancel.html">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="bn" value="PP-BuyNowBF">
Where did you here about us?<select name=”custom”>
<option value=”Word of Mouth”>Word of Mouth
<option value=”Rotary”>Rotary
<option value=”Other”>Other</select>
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div> - Change the bold section to your username and password, and then delete the existing "checkout" button from the HTML earlier in the page.
- Create the return pages in the form (check bold again)
Feel free to experiment with further refinements of this integration (PayPal publish an API to encourage this) and share your experiences on the forum or by updating this documentation.
