PHP code example of tje3d / payment

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

    

tje3d / payment example snippets


try {
    $transId = Payment::nextpay()->order([
        'orderId'     => '1',
        'amount'      => '1000',
        'callBackUrl' => 'http://matmag.ir',
    ]);

    Payment::nextpay()->verify([
        'orderId' => '1',
        'amount'  => '1000',
        'transId' => $transId,
    ]);

    echo 'Successful';
} catch (ConnectionFail $e) {
    echo $e->getMessage();
} catch (OrderException $e) {
    printf('Order Error, ID: %d - Message: %s', $e->getId(), $e->getMessage());
}