setBank($this->config['bank']); $gateway->setClientId($this->config['clientId']); $gateway->setStoreKey($this->config['storeKey']); return $gateway; } public function getGatewayOptions(Order $order): array { $returnUrl = $this->getGenericPaymentUrl(5); $options = [ 'amount' => $this->order->convertPriceToEUR(roundPrice($this->order->getRemainingPayment())->asFloat()), 'currency' => $this->config['currency'], 'orderid' => $this->order->order_no, 'returnUrl' => $returnUrl, 'cancelUrl' => $returnUrl, 'shopUrl' => $returnUrl, 'lang' => $this->config['lang'], ]; if (!empty($this->order->invoice_name)) { $options['billToName'] = $this->order->invoice_name.' '.$this->order->invoice_surname; } if (!empty($this->order->invoice_firm)) { $options['billToCompany'] = $this->order->invoice_firm; } return $options; } protected function createPaymentFromResponse(Omnipay\Common\Message\ResponseInterface $response) { $this->createPayment( $response->getTransactionReference(), $this->order->convertPriceFromEUR($response->getData()['amount']), [] ); } }