PHP code example of princealikhan / paytm-payment

1. Go to this page and download the library: Download princealikhan/paytm-payment library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

princealikhan / paytm-payment example snippets


'providers' => [
	// ...
	'Princealikhan\PaytmPayment\PaytmServiceProvider',
];

'aliases' => [
	// ...
	'Paytm' => 'Princealikhan\PaytmPayment\Facades\Paytm',
];

$request = array('CUST_ID' => 1 ,'TXN_AMOUNT'=> 1 );
Paytm::pay($request);

Route::post("payment/callback", "PaymentController@callback");

public function callback(Request $Request)
{
$paymentResponse =  $Request->all();
$paymentData     = Paytm::verifyPayment($paymentResponse);
}

Paytm::transactionStatus($orderID);

Paytm::initiateTransactionRefund($orderID,$amount,$txnType);