The PayPal payment gateway and 4D Business Kit 2.2



Similar documents
Instant Payment Notification Guide

MONETA.Assistant API Reference

Payflow Link User s Guide

Direct Post. Integration Guide

Order Management Integration Guide

Amazon Simple Pay Getting Started Guide API Version

Checkout FAQs. What are my Pay Now Button Options? These options define the end user experience of your buyers during checkout.

LiteCommerce 2Checkout.com Module

Website Payments Standard Integration Guide

Selling Digital Goods Online

CyberSource PayPal Services Implementation Guide

PayPal Payments Standard Integration Guide

Hosting Controller 7C Gateway Open API Manual

Cardsave Payment Gateway

Shopping Cart Interface Version 1.03

Recurring Payments. A step by step guide to integrating Nochex with your website. All the information you need to be up and running with your account

Bitcoin Payment Gateway API

PaperCut Payment Gateway Module PayPal Website Payments Standard Quick Start Guide

Implementation guide - Interface with the payment gateway PayZen 2.5

Chapter 19: Shopping Carts

Paya Card Services Payment Gateway Extension. Magento Extension User Guide

PROCESS TRANSACTION API

Stripe Payment Module Magento 2 USER MANUAL MAGEDELIGHT.COM SUPPORT E: SUPPORT@MAGEDELIGHT.COM P: +1-(248)

CPAY MERCHANT INTEGRATION SPECIFICATION

PayPal Express Checkout Integration Guide

Website Payments Pro Hosted Solution Integration Guide. United Kingdom

Standard Checkout. Button Creation Wizard Implementation Guide. U.S. Version

Twinfield Single Sign On

Payment Response Guide. Version 4.3 September 2012 Business Gateway

ANZ egate Virtual Payment Client

Shopping Cart Add-On Help. for. Price Comparison Script. April 9, 2015

API Integration Payment21 Recurring Billing

Secure Hosting and Payments Technical Integration Guide

Setup Guide for PrestaShop and BlueSnap

Payment module integration for Magento 2. Version 2.0.0

Mandiri e-cash Online

PayPal Integration in Magento Jefferson Blvd. Suite 200, Culver City, CA Magento.com

Subscriptions and Recurring Payments Guide

InstaMember USER S GUIDE

itransact Gateway Fast Start Guide

Using Authorize.net for Credit Card Processing in YogaReg

Setup Guide for Magento and BlueSnap

PaperCut Payment Gateway Module - PayPal Payflow Link - Quick Start Guide

Product Name: ANZ egate Connect Version: Document Type: Help doc Author: Milople Inc.

Payflow Link User s Guide

payment solutions The DirectOne E-Commerce System Technical Manual

Payment Page Integration Guide

WEEPAY V2 INTEGRATION DOCUMENT (BASIC INTEGRATION)

JOINUS AG. PowerPay Checkout. Magento Module User Manual. Support:

Integration Guide Last Revision: July 2004

PayPal PRO Sandbox Testing

CHAPTER 26 - SHOPPING CART

3. From the Merchant Administration drop down select VCS Interfacing (page1)

United Payment Services My Merchant Console Connect SecurePAY User Guide

Cofred Automated Payments Interface (API) Guide

Process Transaction API

DalPay Internet Billing. Technical Integration Overview

Cart66 Lite Overview! 3. Managing Products! 3. Digital Products! 4. Digital Products Folder! 4. Product Variations! 4. Custom Fields! 5. Promotions!

PayWay. PayWay Net Developer's Guide

Pasarela Integral Integration Guide. Spain

PaperCut Payment Gateway Module - PayPal Payflow Link - Quick Start Guide

CHARGE Anywhere Universal Shopping Cart

Streamlining Purchases with Website Payment Preferences

Authorize.net modules for oscommerce Online Merchant.

Morningtime Ogone Pro Manual (manual v1.0) Step 1 - Preparations Step 2 - unpack and copy files... 2

Subscriptions and Recurring Payments Guide

IPN User Guide PAYTABS INSTANT PAYMENT NOTIFICATION USER GUIDE VERSION 1.1. PAYTABS

1: 2: : 3.1: 3.2: 4: 5: & CAPTCHA

INSTALLATION AND SETUP HANDBOOK OF PAYU LATAM s PLUGIN FOR WOOCOMMERCE

Add a new payment method plugin

PayPal By PayDollar. Setup Guide

Getting Started with Mal s. Adding Buy Now buttons to your web page

Merchant Overview for Website Payments and Payments

Setup Amazon Payments for Woocommerce

Website Payments Pro Hosted Solution Integration Guide. Hong Kong

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

How To Use Paypal Online Currency With A Credit Card And Bank Account On A Pc Or Credit Card On A Website From A Pc (Paypal) On A Paypal Website (Online) On Pc Or Paypal On A Computer Or Pc (

Fraud Management Filters

LiteCommerce Authorize.Net Module. Version 2.4

Learn.ITRAUMA.org Purchasing & Managing Licenses for Group Registration

Website Payments Plus Integration Guide

erms for Business Owners & Directors

PayPal Usage Document

Shopping Cart Setup & Configuration Guide

Merchant Overview for Website Payments Standard and Payments

Best Practices Guide. A reference guide for merchants who want to set up their websites to use Amazon Payments

PayPal Integration Instructions

E-Commerce: Designing And Creating An Online Store

Paynow 3rd Party Shopping Cart or Link Integration Guide

OpenGlobal WorldPay Recurring Payments (FuturePay) for VirtueMart

Login and Pay with Amazon - extension for Magento

PaperCut Payment Gateway Module CyberSource Quick Start Guide

CHEXpedite - Online Electronic Check (OEC) (Online Payment Option Internet Check) User s Guide and Technical Specifications

INTEGRATION PROCEDURES AND SPECIFICATIONS

Transcription:

The PayPal payment gateway and 4D Business Kit 2.2 Useful informations This document describes how to integrate 4D Business Kit 2.2 with the PayPal payment gateway. In this documentation, we suppose that the owner of the TEST shop has a PayPal merchant account whose login is: merchant@shop.com. You will need to replace this login by your own PayPal merchant account in the example pages. NB: For a PayPal account to receive payment with credit cards, the PayPal account needs to be a Premier or Business account. PayPal gives some documentation about its payment gateway. Two manuals are used here. 1. The PayPal Shopping Cart Manual https://www.paypal.com/en_us/pdf/shopping_cart.pdf In this manual, we use the following chapter: Add PayPal Checkout to Your 3 rd Party Cart. Method 1. Passing the Aggregate Cart Amount to PayPal. 2. The PayPal Instant Payment Notification (IPN) Manual https://www.paypal.com/en_us/pdf/ipn.pdf Part I: Add PayPal Checkout to 4D Business Kit According to The PayPal Shopping Cart Manual: You may aggregate your entire shopping cart and pass the total amount into PayPal s Buy Now Code (that is, you will need to post a single name for the entire cart and the total price of the cart s contents as though it were a purchase of a single item). 4D Business Kit provides an example page called payment_paypal.htm (NB: This page is linked to the TEST shop). This page describes a way to pass information to PayPal through an html form. Content of the payment_paypal.htm html page: <!--#4DBK//Currency--> <!--#4DBKVarSet/VT02=4DBKField/CdCurrency--> <!--#4DBK//Amount--> <!--#4DBKVarSet/VT01=4DBKField/PrOrderINV.4DBKVar/VT02,#####0.00--> <!--#4DBK//business field--> <!--#4DBKVarSet/VT15= merchant@shop.com --> <!--#4DBK//Transaction ID for 4D Business Kit--> <!--#4DBKOrderCodeNew-->

<!--#4DBKVarSet/VT16=4DBKOrderCode--> <!--#4DBK//Custom CallBack Parameter--> <!--#4DBKVarSet/VT17=4DBKField/SessionID,X--> <form method="post" action="https://www.paypal.com/cgi-bin/webscr"> <!--Allow posting extended variables--> <input type=hidden name="cmd" value="_ext-enter"> <input type=hidden name="redirect_cmd" value="_xclick"> <input type=hidden name="business" value="<!--#4dbkvar/vt15-->"> <input type=hidden name="item_name" value="<!--#4dbkvar/vt14-->"> <input type=hidden name="amount" value="<!--#4dbkvar/vt01-->"> <input type=hidden name="currency_code" value="<!--#4dbkvar/vt02-->"> <input type=hidden name="return" value="http://<!--#4dbkfield/host-- >/Test_Site/WebPagesUS/home.htm<!--#4DBKField/SessionID-->"> <input type=hidden name="item_number" value="<!--#4dbkvar/vt16-->"> <input type=hidden name="custom" value="<!--#4dbkvar/vt17-->"> <input type=hidden name="notify_url" value="http://<!--#4dbkfield/host-- >/4daction/4DBKHttpPostCallBack/custom/payment_PayPal_cb.htm/1"> <!--Extended variables--> <input type=hidden name="email" value="<!--#4dbkfield/cusemail-->"> <input type=hidden name="first_name" value="<!--#4dbkfield/cuslabelship,lst&1&space-- >"> <input type=hidden name="last_name" value="<!--#4dbkfield/cuslabelship,lst&2&space-- >"> <input type=hidden name="address1" value="<!--#4dbkfield/cusstreetship,lst&1&cr-->"> <input type=hidden name="address2" value="<!--#4dbkfield/cusstreetship,lst&2&cr-->"> <input type=hidden name="city" value="<!--#4dbkfield/cuscityinvo-->"> <input type=hidden name="state" value="<!--#4dbkfield/cusstateinvo-->"> <input type=hidden name="zip" value="<!--#4dbkfield/cuszipinvo-->"> <input type=hidden name="night_phone_a" value="<!--#4dbkfield/cusphone,sub&1&3-->"> <input type=hidden name="night_phone_b" value="<!--#4dbkfield/cusphone,sub&4&3-->"> <input type=hidden name="night_phone_c" value="<!--#4dbkfield/cusphone,sub&7&3-->"> <input type=image" src="http://images.paypal.com/images/x-click-but01.gif" name="submit" alt="make payment with PayPal - it's fast, free and secure!" > </form> Explanations about the hidden fields used in this form: Some parameters are required for the payment gateway, they are: - business : Email address on your PayPal account. - Item_name : this will be the name for the whole shopping Cart (127 characters limit). Here we are using a summary of our shopping cart but we could also use the number of the order to avoid the 127 characters limitation. - amount : this will be the total price of all items in the Shopping Cart. - image : The image for the button your buyer will press to initiate the PayPal payment process. You can substitute your own image by replacing the src with the URL of your image. Others additional parameters used by 4D Business Kit: - custom: Described in in the PayPal Shopping Cart Manual as an Optional passthrough variable that will never be presented to your customer. 256-character limit. In fact, we need to use a custom field in order to store the client s session

ID. This way, the gateway will send us back this session ID with the result of the transaction and we will be able to acknowledge the payment. - return : the internet URL where your customer will be returned after completing payment. - notify_url: This hidden field allows to set a call-back URL. This URL will be used by PayPal to warn 4D Business Kit of the result of a transaction through PayPal Instant Payment Notification process. - item_number: we use this field to store the number of the order in 4D Business Kit The callback URL used by PayPal to send the result of the transaction is: http://<!--#4dbkfield/host-- >/4daction/4DBKHttpPostCallBack/custom/payment_PayPal_cb.htm/1 About parameters used with the 4DBKHttpPostCallBack entry point: - «custom» : this is the name of the field posted by the payment gateway in which the session ID is stored. - «payment_paypal_cb.htm» : this is the name of the script that will be triggered by the 4DBKHttpPostCallBack entry point. - «1» : this parameter means that 4D Business Kit will create a debug file associated to the excution of the script. This file will be found in a subfolder Gateway of the Logs folder of the current site. Part II : Use PayPal Instant Payment Notification According to PayPal Instant Payment Notification Manual (IPN): Instant Payment Notification allows you to integrate your PayPal payments with your website s back-end operations, so you get immediate notification and authentication of the PayPal payments you receive. Content of the script payment_paypal_cb.htm which is the target of PayPal Instant Payment Notification <!--#4DBKStoreSet/TEST--> <!--#4DBKVarSet/VT10=4DBKHttpPostParms/payment_status--> payment_status:<!--#4dbkvar/vt10--> <!--#4DBKVarSet/VT11=4DBKHttpPostParms/txn_id--> txn_id:<!--#4dbkvar/vt11--> <!--#4DBKVarSet/VT12=4DBKHttpPostParms/receiver_email--> receiver_email:<!--#4dbkvar/vt12--> <!--#4DBKVarSet/VT13=4DBKHttpPostParms/mc_gross--> mc_gross:<!--#4dbkvar/vt13--> <!--#4DBKVarSet/VT14=4DBKHttpPostParms/mc_currency--> mc_currency:<!--#4dbkvar/vt14--> <!--#4DBKVarSet/VT15=4DBKHttpPostParms/item_name--> item_name:<!--#4dbkvar/vt15--> <!--#4DBKVarSet/VT16=4DBKHttpPostParms/item_number--> item_number:<!--#4dbkvar/vt16--> <!--#4DBKVarSet/VT20=4DBKHttpPostParms--> Full POST sent by the IPN:<!--#4DBKVar/VT20--> <!--#4DBKVarSet/VT20+="cmd=_notify-validate&"--> Modified POST:<!--#4DBKVar/VT20-->

We have to confirm to PayPal that 4DBK has received the Instant Payment Notification by constructing an HTTP POST <!--#4DBKScriptProcess/US_PayPal.txt,4DBKVar/VT20,,,,,1--> PAYPAL RESPONSE :<!--#4DBKScriptText--> <!--#4DBKHttpPostResponse/OK--> <!--#4DBKVarSet/VT17=4DBKOrderCode--> Order Code (has to be the same as item_number):<!--#4dbkvar/vt17--> <!--#4DBKVarSet/VT18=4DBKField/PrOrderINV,#####0.00--> Total amount of the order (has to be the same as mc_gross): <!--#4DBKVar/VT18--> <!--#4DBKVarSet/VT30=4DBKScriptText--> <!--#4DBKIf("4DBKVar/VT30"="VERIFIED")--> <!--#4DBKIf("4DBKVar/VT10"="Completed")--> <!--#4DBKIf("4DBKVar/VT12"="merchant@shop.com")--> <!--#4DBKIf("4DBKVar/VT13"="4DBKVar/VT18")--> <!--#4DBKIf("4DBKVar/VT16"="4DBKVar/VT17")--> ORDER VALIDATED <!--#4DBKOrderValidate--> <!--#4DBKOrderClear--> ITEM NUMBER IS NOT CORRECT PRICE IS NOT CORRECT FOR THE ORDER Receiver_email is not correct Payment_status is not completed INVALID ANSWER Explanations about what is done in this script file: First, we use the 4DBKHttpPostParms command to get the value of some of the fields send by the payment gateway through its POST. The value of those fields are mandatory to do some checking before validating the order. According to PayPal Instant Payment Notification Manual (IPN), here is what is to be done after our server has received the Instant Payment Notification: Once your server has received the Instant Payment Notification, you will need to confirm it by constructing an HTTP POST to PayPal. Your POST should be sent to https://www.paypal.com/cgi-bin/webscr You must post all of the form variables you received exactly as you received them. You will also need to append a variable named cmd with the value _notifyvalidate (e.g. cmd=_notify-validate) to the POST string. PayPal will respond to the post with a single word, VERIFIED or INVALID, in the body of the response. In our script, the 4DBKHttpPostParms command allows us to get the whole POST coming from PayPal

We use the 4DBKScriptProcess command to post-back the IPN data. This command will execute an HTTP request depending on what has been specified in the parameter script file US_PayPal.txt. In this script file we will trigger 4D Business Kit to do a POST in secured mode at the following addres: www.paypal.com/cgi-bin/webscr. The content of this POST will be specified through the arg1 parameter which store the original modified POST. Content of the script file US_PayPal.txt ####################################### # Payment gateway script for 4D Business Kit # # PayPal # ####################################### # 4DBKScriptText returns "VERIFIED" or "INVALID" # definition [platform=]win # how to send the request [mode=]http [host=]www.paypal.com [port=]443 # end of request : if one of these string is found (PayPal does not use Content-Length) [erx=]verified [erx2=]invalid # result processing [res_start=] [res_offset=] [res_end=] # fields processing [res_fields=][crlf] [res_code1=] [res_code2=] [res_text=]11 [res_tid=] # the request to send [req=]post /cgi-bin/webscr HTTP/1.1[crlf] Host: www.paypal.com[crlf] Content-type: application/x-www-form-urlencoded[crlf] Content-length: [length][crlf][crlf] [arg1] After the 4DBKScriptProcess command has executed, the 4DBKScriptText variable will contain PayPal response: either VERIFIED or INVALID. When a VERIFIED response is received, the following checks are performed: - We Check that the payment_status is Completed. - We make sure the receiver_email is an email address registered in our PayPal account.

- We Check that the price ( mc_gross ) and item ( item_number ) are correct for the order. As soon as those checks are validated, we can validate the order.