[ 'shopID' => [ 'title' => 'Shop ID', 'type' => 'text', ], 'secretKey' => [ 'title' => 'Secret key', 'type' => 'text', ], ], ]; } /** * @param Omnipay\WsPay\Gateway $gateway */ public function configureGateway(Omnipay\Common\GatewayInterface $gateway, Order $order): Omnipay\Common\GatewayInterface { $gateway->setTestMode(false); if (isDevelopment()) { $gateway->setTestMode(true); } $returnUrl = $this->getGenericPaymentUrl(5); $totalAmount = str_replace('.', ',', $order->total_price->printFloatValue(2)); $gateway ->setShopId($this->config['shopID']) ->setSecretKey($this->config['secretKey']) ->setShoppingCartId($order->order_no) ->setSignature($this->config['shopID'], $this->config['secretKey'], $order->order_no, $totalAmount) ->setTotalAmount($totalAmount) ->setCurrency($order->getCurrency()) ->setReturnUrl($returnUrl) ->setReturnErrorURL($returnUrl) ->setCancelURL($returnUrl) ->setLang($order->getLanguage()) ->setCustomerEmail($this->order->invoice_email) ->setCustomerFirstName($this->order->invoice_name) ->setCustomerLastName($this->order->invoice_surname) ->setCustomerCountry($this->order->invoice_country) ->setCustomerCity($this->order->invoice_city) ->setCustomerAddress($this->order->invoice_street) ->setCustomerZIP($this->order->invoice_zip) ->setCustomerPhone($this->order->invoice_phone); return $gateway; } public function hasOnlinePayment() { return true; } }