OpenPayU transfer

Base:

$payU = $payment->online(
    new OpenPayUPayment(
        'posId, as int',
        'md5Key',
        'clientId as int',
        'clientSecret',
        OpenPayUPayment::ENVIRONMENT_SANDBOX or OpenPayUPayment::ENVIRONMENT_PRODUCTION
    )
);
$payU->oauthAuthorize();

Generate payment:

//at first we must declare at least one product:
$payU->setProductName('productName')
    ->setProductQuantity(1)
    ->setProductUnitPrice(15.00)
    ->addProduct();

//required
$payU->setNotifyUrl('https://ipn-url.com');
$payU->setCustomerIp('127.0.0.1');
$payU->setDescription('description');
$payU->setBuyerEmail('email@domain.tld');

//optional
$payU->setBuyerLanguage('pl');
$payU->setBuyerPhone('phone');
$payU->setBuyerFirstname('firstname');
$payU->setBuyerLastname('lastname');
$payU->setCurrencyCode('PLN');
$payU->setExtOrderId('customParam');
$payU->setVisibleDescription('visible description shown on payU checkout page');
$payU->setContinueUrl('https://google.com');

$payUPayment = $payU->generatePayment();
$payUPayment->getTransactionUrl();
$payUPayment->getTransactionId();

Verify notification signature:

Last updated