PHP code example of traknpay / checkout

1. Go to this page and download the library: Download traknpay/checkout 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/ */

    

traknpay / checkout example snippets


    Checkout::post([
        'order_id'       => '10',
        'amount'         => '201.00',
        'name'           => 'Payer Name',
        'email'          => '[email protected]',
        'phone'          => '9876543210',
    ]);

    
        use TraknPay\Checkout\Facades\Checkout;
    
        class PaymentController extends Controller
        {
            public  function handleResponse(Request $request) {
                if(Checkout::checkResponseHash($request->all())){
                    // if checkResponseHash returns true, continue to save the response.
                } else {
                    // if checkResponseHash returns false , then it means that response might be tampered
                }
            }
        }
    

        Route::post('/paymentresponse','PaymentController@handleResponse');
    

        'app_url'    => 'http://your-site.com'
        'return_url' => '/paymentresponse'