Saturday, September 29 2018
In this article we have explained about How to Integrate Paytm Payment Gateway in PHP. Paytm payment gateway is a easy to integrate with PHP. In many peoples are using Paytm in India. Paytm is a famous for online transaction in India.
See our demo video on Youtube:
First create a merchant account in Paytm
Get your sandbox and live credentials.
Download Paytm payment gateway kit for integration. Click here to download paytm script php
Update your sandbox keys in lib/config_paytm.php
define('PAYTM_ENVIRONMENT', 'TEST'); // PROD define('PAYTM_MERCHANT_KEY', 'xxxxxxxxxxxxxxxxx'); //Change this constant's value with Merchant key downloaded from portal define('PAYTM_MERCHANT_MID', 'xxxxxxxxxxxxxxxxx'); //Change this constant's value with MID (Merchant ID) received from Paytm define('PAYTM_MERCHANT_WEBSITE', 'WEB_STAGING'); //Change this constant's value with Website name received from Paytm
Paytm for website use WEB_STAGING
Paytm for Mobile App use APP_STAGING
Enable below codes in config_paytm.php
define('PAYTM_REFUND_URL', 'https://'.$PAYTM_DOMAIN.'/oltp/HANDLER_INTERNAL/REFUND'); define('PAYTM_STATUS_QUERY_URL', 'https://'.$PAYTM_DOMAIN.'/oltp/HANDLER_INTERNAL/TXNSTATUS'); define('PAYTM_STATUS_QUERY_NEW_URL', 'https://'.$PAYTM_DOMAIN.'/oltp/HANDLER_INTERNAL/getTxnStatus'); define('PAYTM_TXN_URL', 'https://'.$PAYTM_DOMAIN.'/oltp-web/processTransaction');
Set callback url in pgRedirect.php
$paramList["CALLBACK_URL"] = "http://localhost/paytm/PaytmKit/pgResponse.php";
Basic form available in TxnTest.php. Here we can send amount and other custom parameters to Paytm payment process.
Checkout the form.
Paytm Test Credentials
For Credit card/Debit card Credentials
For Wallet Credentials:
In response page you will receive Paytm Txn ID then you can that transaction status in TxnStatus.php
Thanks for reading this article. If you have any queries and please comment in the below.