Home » API » Payment Gateway » Web » Integrate G2S Payment Gateway

Integrate G2S Payment Gateway

Posted in API, Payment Gateway, Web Tagged , , , ,

Problem Statement

Integrate G2S Payment gateway into a forex signals provider website. The forex website manages membership data using Amember. The website has monthly plans and each plan will be of recurring type. The user should be signed up directly into the website upon purchase of a plan.

Solution Provided



The details of the payment gateway were taken from the client. The G2S gateway provides the merchant id, merchant site id, secret key, payment URLs to redirect the user. The monthly recurring plans along with their frequency were defined in the G2S merchant login. Each plan has a product id and rebilling id. The product ids were mapped with the amember product plans.

On the Order page the POST buttons were created for each of the plans. When a particular plan was selected , the information associated with the plan was posted to the G2S payment URL. This URL also needed a valid checksum generated for security purpose which was composed of secret key, merchant key, rebilling product id, rebilling template id, time stamp. Upon successfully posting the data to the G2S server the user would see a payment form. On that form the personal information of the user and the credit card / banking information was captured and payment was completed.

G2S was provided with 3 URLs of the website. These were the
1) Success URL (called on post payment success)
2) Cancel / Failure URL (called on post payment failure)
3) Payment Notification URL (called on post payment)

The data captured from the Payment Notification URL was used for updating the records into the website database. The user profile information (name,email,mobile) was also captured from it and he was registered as a member with a random password, with the information sent on email and sms . In case the Post payment notification had information that the record was of type recurring then the database was updated accordingly. The logic was also built to capture each notification from the G2S server for every recurring payment made successfully or cancelled. Validations were done to ensure that while signup, the users email is unique in the system.


The client benefited with a huge number of sales of his monthly recurring plans by integrating G2S gateway with amember on his forex website.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>