/** * @return string */ public function getLaunchLink() { $launchlink = ""; try { if ($this->_order->getPayment()) { $realOrderId = $this->_order->getRealOrderId(); $orderCurrencyCode = $this->_order->getOrderCurrencyCode(); $amount = $this->_adyenHelper->formatAmount($this->_order->getGrandTotal(), $orderCurrencyCode); $shopperEmail = $this->_order->getCustomerEmail(); $customerId = $this->_order->getCustomerId(); $callbackUrl = $this->_urlBuilder->getUrl('adyen/process/resultpos', ['_secure' => $this->_getRequest()->isSecure()]); $addReceiptOrderLines = $this->_adyenHelper->getAdyenPosConfigData("add_receipt_order_lines"); $recurringContract = $this->_adyenHelper->getAdyenPosConfigData('recurring_type'); $currencyCode = $orderCurrencyCode; $paymentAmount = $amount; $merchantReference = $realOrderId; $shopperReference = !empty($customerId) ? $customerId : self::GUEST_ID . $realOrderId; $shopperEmail = $shopperEmail; $recurringParams = ""; if ($this->_order->getPayment()->getAdditionalInformation("store_cc") != "") { $recurringParams = "&recurringContract=" . urlencode($recurringContract) . "&shopperReference=" . urlencode($shopperReference) . "&shopperEmail=" . urlencode($shopperEmail); } $receiptOrderLines = ""; if ($addReceiptOrderLines) { $orderLines = base64_encode($this->_getReceiptOrderLines($this->_order)); $receiptOrderLines = "&receiptOrderLines=" . urlencode($orderLines); } // extra parameters so that you alway's return these paramters from the application $extraParamaters = urlencode("/?originalCustomCurrency=" . $currencyCode . "&originalCustomAmount=" . $paymentAmount . "&originalCustomMerchantReference=" . $merchantReference . "&originalCustomSessionId=" . session_id()); $launchlink = "adyen://payment?sessionId=" . session_id() . "&amount=" . $paymentAmount . "¤cy=" . $currencyCode . "&merchantReference=" . $merchantReference . $recurringParams . $receiptOrderLines . "&callback=" . $callbackUrl . $extraParamaters; // cash not working see ticket // https://youtrack.is.adyen.com/issue/IOS-130#comment=102-20285 // . "&transactionType=CASH"; $this->_adyenLogger->addAdyenDebug(print_r($launchlink, true)); } } catch (Exception $e) { // do nothing for now throw $e; } return $launchlink; }