Anda di halaman 1dari 3

Globalnetpay Api for integrating Globalnetpay on a third party sites:

The integration comprises of 2 parts: 1. On Globalnetpay 2. On Third party (e.g: ServeLinked.com/ContestStage.com) The third part company must have a registered account on Globalnetpay.com for integration and has a unique userid and password. Sample form code to pay via Globalnetpay from Third party site: <form action="https://www.globalnetpay.com/members/gnppayment.htm" method="post" id="gnp_form" name="gnp_form"> <input type="hidden" name="dtype" value="gnp"> <input type="hidden" name="business" value="servelinked"> <input type="hidden" name="item_name" value="#76 - Serve Gift Card (Gift of choice)"> <input type="hidden" name="item_number" value="76"> <input type="hidden" name="userid" value="103"> <input type="hidden" name="amount" value="10.55"> <input type="hidden" name="fee" value="0.55"> <input type="hidden" name="gnpcurrtime" value="1327243803"> <input type="hidden" name="currency_code" value="EUR"> <input type="hidden" name="return" value="https://www.servelinked.com/order?id=76"> <input type="hidden" name="cancel_return" value="https://www.servelinked.com/order?id=76">

</form>

Descriptions:

1. Form action URL - https://www.globalnetpay.com/members/gnppayment.htm 2. dtype - gnp 3. business Username on GNP (here servelinked) 4. item_name service name 5. item_number service id 6. userid the logged in userid. 7. amount order total 8. fee fees 9. gnpcurrtime current timestamp 10.currency_code currency code 11.return return url on transaction completion 12.cancel_return url to return to when cancel

On globalnetpay, the code and logic are on 2 pages:

1. /public_html/templates/members/template.gnppayment.htm 2. /public_html/members/gnppayment.htm

When transaction is successful, a trncode is generated based on the password stored in GNP database for the merchant.

Now the user is returned to Servelinked.

Servelinked Verification: The following code verifies that the payment is successful and thre is no hacking. if $_GET['trncode'] is equal to md5($config['gnp_secret'].$gnpcurrtime.$gnpamount. $USERID), then the transaction is valid and orders are created in database accordingly.

$config['gnp_secret'] is the gnp password (This is known only to the merchant and GNP) $gnpcurrtime This is the timestamp which was post to GNP in the form explained above (Var 9). $ gnpamount This is the total amount which was post to GNP in the form explained above (Var 7). $USERID The logged in userid which was post to GNP in the form explained above (Var 9).

Anda mungkin juga menyukai