/** * @param array $config * * @throws Exception * @return Gateway */ public static function newInstance($config = null) { if (!function_exists('curl_init')) { throw new Exception('Curl required'); } $gateway = new self(); if (null !== $config) { Config::setAll($config); } return $gateway; }
} if (class_exists('\\FintechFab\\BankEmulatorSdk\\OnlineFormWidget') && class_exists('\\FintechFab\\BankEmulatorSdk\\Config')) { ?> <div class="row container"> <div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">[<?php echo Type::PAYMENT; ?> ] Платеж одной кнопкой (Bank Emulator SDK)</h3> </div> <div class="panel-body"> <?php \FintechFab\BankEmulatorSdk\Config::setAll(array('terminalId' => $terminal->id, 'secretKey' => $terminal->secret, 'endpointUrl' => URL::route('ff-bank-em-endpoint'), 'currency' => 'RUB', 'callbackUrl' => URL::current())); \FintechFab\BankEmulatorSdk\OnlineFormWidget::render(12345, 123.45, 'Example', 'Example Online Order'); $gateway = new \FintechFab\BankEmulatorSdk\Gateway(); $fields = $gateway->endpoint(array('orderId' => 12345, 'orderAmount' => 123.45, 'orderName' => 'Example', 'orderDesc' => 'Example Online Order')); ?> </div> </div> </div> </div> <?php } ?> <div class="row container"> <div class="col-md-12">