nattreid/b-payment

B-Payment for Nette Framework

1.1.12 2019-02-05 09:46 UTC

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]}