"Secure" part

Base namespace:

use PatryQHyper\Dpay\Secure\ClassName();

General operations

$operations = $dpay->secure(new GeneralOperations());
$operations->getLicenseNumber();
$operations->getPrivacyPolicyUrl();
$operations->getTermsUrl();
$operations->getRegulations();
$pblOperations = $dpay->secure(new PaybylinkPayment('serviceName', 'serviceHash'));;

Generate payment:

//required parameters
$pblOperations->setAmount(15);
$pblOperations->setSuccessUrl('https://example.com');
$pblOperations->setFailUrl('https://example.com');
$pblOperations->setIpnUrl('https://webhook.site/78d28431-e5e6-418e-8605-871c138c0884');
//optional parameters
$pblOperations->setCustom('Custom');
$pblOperations->setInstallment(bool);
$pblOperations->setCreditCard(bool);
$pblOperations->setPaypal(bool);
$pblOperations->setPaysafecard(bool);
$pblOperations->setNoBanks(bool);
$pblOperations->setChannel('channelId');
$pblOperations->setEmail('client@example.com');
$pblOperations->setClientName('Jan');
$pblOperations->setClientSurname('Kowalski');
$pblOperations->setDescription('Payment for FOO');
$pblOperations->setStyle(new \PatryQHyper\Dpay\Secure\Styles\DefaultStyle()); //see below
$payment = $pblOperations->generate();
echo $payment->getTransactionId() . PHP_EOL;
echo $payment->getTransactionUrl() . PHP_EOL;

Setting style class

Available classes:

DirectBilling operations

Register payment:

Validate Instant Payment Notification

You may call verify() function to verify parameters, http method and signature. On failure it throws DpayNotificationException.

You may also verify notification by yourself, and only call function generateSignature() which returns string of generated signature, you have to manually verify it.

You may also use specific getters:

responseOk function

This function should be used everytime in notifications because of strange Dpay parsing responses, it sometimes contains blank spaces, which will fail IPN on dpay's side. I've received this solution from Dpay's staff.

Last updated