iMoje transfer

Base:

$imoje = $payments->online(
    new IMojePayment(
        'merchantId',
        'serviceId',
        'apiKey',
        IMojePayment::ENVIRONMENT_SANDBOX or IMojePayment::ENVIRONMENT_PRODUCTION
    )
);

Generate payment:

//required parameters
$imoje->setAmount(15);
$imoje->setCustomerFirstName('John');
$imoje->setCustomerLastName('Doe');
$imoje->setCustomerEmail('test@wp.pl');
$imoje->setOrderId('ORDERID');
//optional parameters
$imoje->setTitle('');
$imoje->setVisibleMethod('');
$imoje->setReturnUrl('');
$imoje->setSuccessReturnUrl('');
$imoje->setFailureReturnUrl('');
$imoje->setSimp('');
$imoje->setValidTo(time() + (60 * 60)); //as unix timestamp

$payment = $imoje->generatePayment();

$payment->getTransactionUrl();
$payment->getTransactionId();

Verify notification signature:

$header = '';
foreach(getallheaders() as $name => $value)
{
    if($name == 'X-Imoje-Signature')
        $header = $value;
}

$imoje->verifySignature($payUHeader, file_get_contents('php://input'), 'serviceKey'); //returns boolean

Get transaction info:

$imoje->getTransactionInfo('transactionId');

Last updated