nattreid / b-payment
B-Payment for Nette Framework
1.1.12
2019-02-05 09:46 UTC
Requires
- php: >= 7.1
- nattreid/form: ~1.0
- nattreid/utils: ~1.0
- nette/application: ~2.4
- nette/di: ~2.4
Requires (Dev)
- nattreid/web-manager: ~1.0
- nette/tester: ~1.7
- tracy/tracy: ~2.4
README
Nastavení v config.neon
extensions: bPayments: NAttreid\BPayment\DI\BPaymentExtension bPayments: secretKey: 'xxx1234x4xx54x65x456x4x88x9x987x' url: 'https://securepay.borgun.is/securepay/default.aspx' merchantId: 1234567 gatewayId: 12345
Použití
/** @var \NAttreid\BPayment\IBPaymentClientFactory @inject */ public $bPaymentFactory; protected function createComponentBPayment($name) { $bPayment = $this->bPaymentFactory->create($this, $name); $bPayment->setOrderId(123456); $bPayment->setCurrency('CZK'); $bPayment->setLanguage('CZ'); $bPayment->addItem('Polozka', 4, 999.9); $bPayment->onSuccess[] = function($orderId, $authorizationCode) { } $bPayment->onError[] = function($errorCode, $errorDescription) { } $bPayment->onCancel[] = function() { } return $bPayment; }
{control bPayment, 'Pay', [class => button]}