wmateam/payir

Pay.ir php package

1.1 2018-05-28 13:46 UTC

This package is not auto-updated.

Last update: 2024-11-10 04:53:26 UTC


README

Build Status License

Pay.ir php package

Wiki and Docs

New payment

$apiKey = 'test';
$redirectUrl = 'http://localhost:2030/verify.php';
$payIr = new \wmateam\payIr\PayIr($apiKey, $redirectUrl);

$factorNumber = 'testFactorNumber';//Optional
$amount = 1000;//Rial

$transaction = $payIr->newPayment($amount, $factorNumber);
$transactionID = $transaction->getTransactionID();
$gateway = $transaction->getGateway();

verify transaction

$apiKey = 'test';
$redirectUrl = 'http://localhost:2030/verify.php';
$payIr = new \wmateam\payIr\PayIr($apiKey, $redirectUrl);

$verify = $payIr->verifyPayment($_POST['transId']);
$status = $verify->status;
$amount = $verify->amount;