> For the complete documentation index, see [llms.txt](https://patryqhyper.gitbook.io/polish_payments_api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://patryqhyper.gitbook.io/polish_payments_api/online-payments/dpay-direct-billing.md).

# Dpay direct billing

Base:

```php
$dpay = $payment->online(
    new DpayDirectbillingPayment(
        'guid (service id from dpay panel)', 
        'secretKey'
    )
);
```

Generate payment:

```php
$dpay->setAmount(1.23);
$dpay->setSuccessUrl('https://google.com');
$dpay->setFailUrl('https://google.com');
$dpay->setCustom('customParameter');

$dpayPayment = $dpay->generatePayment();
$dpayPayment->getTransactionId(); //transaction id
$dpayPayment->getTransactionUrl(); //transaction url
```
