An error occurred fetching the project authors.
- 06 Jan, 2020 1 commit
-
-
alessio authored
-
- 30 Dec, 2019 1 commit
-
-
Rik ter Beek authored
* PW-1190 add magento info into request * PW-1190 add unit tests and fix current ones. Add codesniffer and magento/magento-coding-standard to easy validate code within the repo. Add paypal reference as we have a depencency to paypal module as we need it for billing agreements. * [WIP] Feature/pw 1190 travis (#606) * add travis file * add credentials encrypted will only work for local branches * fix commands * add ruleset * update travis to execute all plugin code * remove params as it is declared into the ruleset. and update version codesniffer * only fail and show errors not warnings * added arguments p and n for better visibility and ignoring warning in ruleset xml * use relative path to fix local check
-
- 09 Aug, 2019 1 commit
-
-
attilak authored
-
- 08 Aug, 2019 1 commit
-
-
attilak authored
Add POS instalments Refactor instalments on the frontend (credit cards, pos cloud) If no terminal is available show message
-
- 26 Jun, 2019 1 commit
-
-
attilak authored
Enable place order when there are terminals connected only Require php library v2.1.0
-
- 21 Jun, 2019 1 commit
-
-
attilak authored
-
- 31 Dec, 2018 1 commit
-
-
attilak authored
php doc description
-
- 21 Dec, 2018 1 commit
-
-
stefank authored
-
- 11 Dec, 2018 1 commit
-
-
Rik ter Beek authored
-
- 29 Nov, 2018 1 commit
-
-
attilak authored
- Pass api key to initializeClient function isntead of setting the key directly
-
- 15 Nov, 2018 1 commit
-
-
attilak authored
-
- 13 Nov, 2018 1 commit
-
-
Alessio Zampatti authored
* removed customerCollectionFactory * do not expose storemanager, storeid mandatory for getAdyenMerchantAccount * phpdoc fix
-
- 12 Nov, 2018 4 commits
-
-
Aleffio authored
-
Aleffio authored
Remove customer prefix, re-add 1 minute delay on notifications, re-add store_id on query Billing Agreements
-
Aleffio authored
-
stkams authored
* customer reference prefix * added java doc; made customer_reference_prefix only available in default * workaround for adyen notification processing delay * updated the module version to that of master * Allow to retrieve api key for a specified store
-
- 09 Nov, 2018 13 commits
-
-
Rik ter Beek authored
-
Aleffio authored
PW-560: changed JSON status request to array, added new total_timeout value in config, reverted serviceID to previous dateformat
-
Aleffio authored
-
Aleffio authored
-
Rik ter Beek authored
-
Rik ter Beek authored
-
Rik ter Beek authored
-
Rik ter Beek authored
-
Rik ter Beek authored
diff --git a/Model/AdyenInitiateTerminalApi.php b/Model/AdyenInitiateTerminalApi.php index 464ae2e..a21c9c9 100644 --- a/Model/AdyenInitiateTerminalApi.php +++ b/Model/AdyenInitiateTerminalApi.php @@ -22,11 +22,14 @@ * Author: Adyen <magento@adyen.com> */ + namespace Adyen\Payment\Model; + use Adyen\Payment\Api\AdyenInitiateTerminalApiInterface; use Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider; use Adyen\Util\Util; +use Magento\Payment\Gateway\Http\ClientInterface; class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface { @@ -90,9 +93,7 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface /** * Trigger sync call on terminal - * * @return mixed - * @throws \Magento\Framework\Exception\LocalizedException */ public function initiate() { @@ -106,69 +107,71 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface $poiId = $this->_adyenHelper->getPoiId(); $serviceID = date("dHis"); $timeStamper = date("Y-m-d") . "T" . date("H:i:s+00:00"); + + // if custom is logged in send data accross $customerId = $quote->getCustomerId(); - $request = [ - 'SaleToPOIRequest' => - [ - 'MessageHeader' => - [ - 'MessageType' => 'Request', - 'MessageClass' => 'Service', - 'MessageCategory' => 'Payment', - 'SaleID' => 'Magento2Cloud', - 'POIID' => $poiId, - 'ProtocolVersion' => '3.0', - 'ServiceID' => $serviceID, - ], - 'PaymentRequest' => - [ - 'SaleData' => - [ - 'TokenRequestedType' => 'Customer', - 'SaleTransactionID' => - [ - 'TransactionID' => $reference, - 'TimeStamp' => $timeStamper, - ], - ], - 'PaymentTransaction' => - [ - 'AmountsReq' => - [ - 'Currency' => $quote->getCurrency()->getQuoteCurrencyCode(), - 'RequestedAmount' => $quote->getGrandTotal(), - ], - ], - 'PaymentData' => - [ - 'PaymentType' => $transactionType, - ], - ], - ], - ]; - - // If customer exists add it into the request to store request + + $newStructureValue = ""; +// $oldValueStructure = ""; if (!empty($customerId)) { $shopperEmail = $quote->getCustomerEmail(); $recurringContract = $this->_adyenHelper->getAdyenPosCloudConfigData('recurring_type'); - if (!empty($recurringContract)) { - $jsonValue = '{ + $jsonValue = '{ "shopperEmail": "' . $shopperEmail . '", "shopperReference": "' . $customerId . '", "recurringContract": "' . $recurringContract . '" }'; - $request['SaleToPOIRequest']['PaymentRequest']['SaleData']['SaleToAcquirerData'] = base64_encode($jsonValue); - } + $jsonValueBase64 = base64_encode($jsonValue); + + $newStructureValue = '"SaleToAcquirerData":"' . $jsonValueBase64 . '",'; +// $oldValueStructure = '"SaleToAcquirerData":"shopperEmail=' . $shopperEmail . '&shopperReference=' . $customerId . '&recurringContract=' . $recurringContract . '",'; } + $json = '{ + "SaleToPOIRequest": { + "MessageHeader": { + "MessageType": "Request", + "MessageClass": "Service", + "MessageCategory": "Payment", + "SaleID": "Magento2Cloud", + "POIID": "' . $poiId . '", + "ProtocolVersion": "3.0", + "ServiceID": "' . $serviceID . '" + }, + "PaymentRequest": { + "SaleData": { + ' . $newStructureValue . ' + "TokenRequestedType":"Customer", + "SaleTransactionID": { + "TransactionID": "' . $reference . '", + "TimeStamp": "' . $timeStamper . '" + }, + "TokenRequestedType": "Customer" + }, + "PaymentTransaction": { + "AmountsReq": { + "Currency": "' . $quote->getCurrency()->getQuoteCurrencyCode() . '", + "RequestedAmount": ' . $quote->getGrandTotal() . ' + } + }, + "PaymentData": { + "PaymentType": "' . $transactionType . '" + } + } + } + } + '; + + $params = json_decode($json, true); //Create associative array for passing along + $quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation('serviceID', $serviceID); try { - $response = $service->runTenderSync($request); + $response = $service->runTenderSync($params); } catch (\Adyen\AdyenException $e) { //Not able to perform a payment $this->_adyenLogger->addAdyenDebug("adyenexception");
-
Rik ter Beek authored
-
Rik ter Beek authored
-
Rik ter Beek authored
-
Alessio Zampatti authored
* PW-489: Added Initiate call before placing the order * PW-489: Construct sync call request on Magento instead of on the Util Library, add encryptor on pos api key * PW-489: Removed logger/comments * PW-458: Implemented status call every 5 seconds, added timeout on Initiate call * PW-458: Fixed terminalAPI guest checkout, added configuration for pos_timeout, return immediately if response from Initiate call * PW-458: Do not show pos_timeout in config * PW-458: Retrieve quoteid from the backend, added PHP library version requirement, using settimeout instead of setinterval, removed pos_timeout from adyen_pos_cloud xml, renamed Initiate button label back to Place Order, replaced the .done().fail() flow with .always() on the frontend
-