Forum OpenACS Q&A: Integration of payment gateway

Collapse
Posted by Yusuf Rajkotwala on
Hello,

I am relatively new to openacs ecommerce and would like to know how exactly is the payment gateway integrated with the exommerce module.

I would also appreciate any help regarding the communication of the ecommerce module with the payment gateway.

Thanks in advance.

Collapse
Posted by Torben Brosten on
Yusuf Rajkotwala,

ecommerce calls the payment-gateway procedures using service-contract[1] methods from this file:

service0/packages/ecommerce/tcl/ecommerce-credit-procs.tcl

The payment-gateway is a service that forwards calls to a specific payment gateway package, such as authorize-gateway[2].

1. https://openacs.org/doc/current/acs-service-contract/

2. https://openacs.org/doc/current/authorize-gateway/

Collapse
Posted by tomy orange on
Paysat Merchant API

Overview

API integration is a solution provided by PaySat Inc. to all merchants that have their own orders database, and desire to keep the order page under their identity.

Paysat offers two solutions that vary according to the environment of the merchant site:
 CGI script (platform independent).
 Managed .Net DLL, for integration with .Net web projects.

This document illustrate the .Net integration module

.Net API Integration

To use the .Net DLL API, the following steps must be performed:

a. The merchant will download .Net API version from his Paysat Merchant Profile which will contain 3 files (MerchantApiWebService.dll , MerchantAPIClient.dll & MAPIConfig.xml)
b. The merchant will include those file in his shopping Cart Web Project and add a reference to them so that he can use the classes included in them.
c. Using (MerchAPIClient) class which is included in (MerchantAPIClient) namespace the merchant will create an order object.
d. This object will contain the 5 Functions that will be used.
SingleOrder
AmountOrder
RecurringOrder
SpecialOrder
GetStatus
Merchant will pass the required parameters for each Function, this function return a string which will contain the Response to ordering operation.

AmountOrder

The parameters will be passed to this function are:

( loginName , loginPassword , orderID , merchantID , DomainID , amount , currency , orderDescription , cardType , cardNo , ValidityMonth , validityYear , cardCVV , cardHolderName , countryID , billingState , billingAddress , billilngZipCode , billingEmail , billingPhone , billingCity , buyerIP )

SingleOrder

The parameters will be passed to this function are:

( loginName , loginPassword , orderID , productID , merchantID , DomainID , cardType , cardNo , ValidityMonth , validityYear , cardCVV , cardHolderName , countryID , billingState , billingAddress , billilngZipCode , billingEmail , billingPhone , billingCity , buyerIP )

RecurringOrder

The parameters will be passed to this function are:

( loginName , loginPassword , orderID , productID , merchantID , DomainID , cardType , cardNo , ValidityMonth , validityYear , cardCVV , cardHolderName , countryID , billingState , billingAddress , billilngZipCode , billingEmail , billingPhone , billingCity , buyerIP )

SpecialOrder

The parameters will be passed to this function are:

( loginName , loginPassword , orderID , productID , merchantID , DomainID , cardType , cardNo , ValidityMonth , validityYear , cardCVV , cardHolderName , countryID , billingState , billingAddress , billilngZipCode , billingEmail , billingPhone , billingCity , buyerIP , recurringPeriodInDays )

GetStatus

This function is used to get the order status (Authorized, Captured, etc.)

Merchant can design his Web Application so that he can pass the parameters using a Web Page that contain the required Fields and assign every field to the function desired.

For instance you can use this syntax

private void Recurring()
{
MerchantAPIClient.MerchAPIClient Order_Object = new MerchantAPIClient.MerchAPIClient();
string Return_Text = Order_Object.RecurringOrder(login.Text,password.Text,order.Text,product.Text,merchant.Text,domain.Text,cardtype.Text,cardno.Text,vmonth.Text,vyear.Text,cvv.Text,hname.Text,country.Text,state.Text,address.Text,zipcode.Text,email.Text,phone.Text,city.Text,ip.Text);


}

Where:

1-
Order_Object is the Object was instantiated from (MerchAPIClient) class


2-(login,password,order,product,merchant,domain,cardtype,cardno,vmonth,vyear,cvv,hname,country,state,address,zipcode,email,phone,city,ip) are the text boxes that are used in merchant web form and they will be passed to the Function (Order_Object.RecurringOrder)

Please note that the XML included with API is unique for every merchant, it contains an important data that is essential for Communication between PaySat & the Merchant.

Collapse
Posted by tomy orange on
CGI Merchant Application Program Interface
Paysat®

Paysat Merchant API

Overview

API integration is a solution provided by PaySat Inc. to all merchants that have their own orders database, and desire to keep the order page under their identity.

Paysat offers two solutions that vary according to the environment of the merchant site:
    CGI script (platform independent).
    Managed .Net DLL, for integration with .Net web projects.

This document illustrate the CGI integration module

CGI Script API Integration

To use the CGI Script API, the following steps must be performed:

a.    The merchant will download CGI API version from his Paysat Merchant Profile which will contain 4 files (asci.cgi, merchant.cgi,  psmain.cgi, rsa.cgi & testing_paysat_apis.htm)
b.    These Scripts must be deployed on the hosting environment (e.g. /cgi-bin under Apache/Tomcat web server or IIS using ISAPI extension for CGI) and they must place into the scripts Directory that will be configured for this purpose.
c.    The Code in these Scripts needs to be modified to work on your Server

In psmain.cgi you need to change the following:

my $path = 'http://localhost:8080/cgi-bin';;

This line of Code refers to the location of the scripts folder, you will change it to the path in which your scripts are located in.

my $weburl = url('http://localhost:8080/cgi-bin/Merchant.cgi ?

This line of Code refers to the location of the Merchant.cgi Script.

In merchant.cgi you need to change the following:

my $url = url("http://localhost:8080/cgi-bin/rsa.cgi"." ?m=".$m."&e=".$e."&n=".$n);

This line of Code refers to the location of the rsa.cgi Script which will be responsible of encrypting the data being sent to PaySat.

You will find the file (testing_paysat_apis.htm) attached with Merchant API Package, it is a sample Html page that user can enter his Data in and it will pass the data to the Script psmain.cgi through this Code

<form method="get" action="http://localhost:8080/cgi-bin/psmain.cgi">

And you will need to change this Path also referring to (psmain.cgi) location on your Server.

You need also to change this line of Code to refer to your Return page

<input type="hidden" name="returnpath" id="returnpath" value="http://www.paysat.com/default.aspx" size="31">

Please note that the following Parameters will be sent to PaySat without Encryption

In case of Amount Order if($DropDown == '0')
(orderID, domainID, countryID, state, address, zipCode, email, phone, city, ip, amount, currency & orderDesc)

In case of Amount Order if($DropDown == '1')
(orderID, domainID, countryID, state, address, zipCode, email, phone, city, ip, productID)

In case of Recurring Order if($DropDown == '2')
(orderID, domainID, countryID, state, address, zipCode, email, phone, city, ip, productID)

Please note that the following Parameters will be sent to PaySat with Encryption
(login, password, cardType, cardNo, validateMonth, validateYear, cvv, holderName)

There is also a function that will be executed if($DropDown == '3') it is used to know the status of Order.