We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

  1. 30 Nov, 2018 1 commit
  2. 29 Nov, 2018 2 commits
  3. 27 Nov, 2018 1 commit
  4. 26 Nov, 2018 1 commit
  5. 22 Nov, 2018 1 commit
  6. 16 Nov, 2018 5 commits
  7. 15 Nov, 2018 1 commit
  8. 13 Nov, 2018 1 commit
  9. 12 Nov, 2018 7 commits
  10. 09 Nov, 2018 20 commits
    • Aleffio's avatar
      PW-560: refactor · 3ecb944b
      Aleffio authored
      3ecb944b
    • Aleffio's avatar
      PW-560: added logging for errored responses · 86764cbc
      Aleffio authored
      86764cbc
    • Rik ter Beek's avatar
    • Aleffio's avatar
      PW-560: changed JSON status request to array, added new total_timeout value in... · fd46e3cc
      Aleffio authored
      PW-560: changed JSON status request to array, added new total_timeout value in config, reverted serviceID to previous dateformat
      fd46e3cc
    • Aleffio's avatar
      PW-560: removed legacy DataTest file · 6ba9e902
      Aleffio authored
      6ba9e902
    • Aleffio's avatar
    • Aleffio's avatar
      PW-560: fix and refactor the handler · 5459801d
      Aleffio authored
      5459801d
    • Aleffio's avatar
      PW-560: Rebuild the validator · ce46eacd
      Aleffio authored
      ce46eacd
    • Aleffio's avatar
      8d275529
    • Aleffio's avatar
    • Rik ter Beek's avatar
      99f4ac9b
    • Rik ter Beek's avatar
    • Rik ter Beek's avatar
      add default to ONECLICK · 253f750e
      Rik ter Beek authored
      253f750e
    • Rik ter Beek's avatar
      Optimize request · ab65338e
      Rik ter Beek authored
      ab65338e
    • Rik ter Beek's avatar
      optimize code · 916b0cf1
      Rik ter Beek authored
      916b0cf1
    • Rik ter Beek's avatar
      store card on adyen side for pos payments · 2ac407f2
      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");
      2ac407f2
    • Rik ter Beek's avatar
      Optimize request · c202c694
      Rik ter Beek authored
      c202c694
    • Rik ter Beek's avatar
      optimize code · 36ae37bf
      Rik ter Beek authored
      36ae37bf
    • Rik ter Beek's avatar
      store card on adyen side for pos payments · f4c67f1f
      Rik ter Beek authored
      f4c67f1f
    • Alessio Zampatti's avatar
      PW-503: Parse Payment receipt from TerminalAPI PaymentResponse (#304) · 1c9b2899
      Alessio Zampatti authored
      * PW-503: Parse Payment receipt from TerminalAPI PaymentResponse
      
      * PW-503: call formatTerminalAPIReceipt from the validator
      
      * PW-503: removed redundant html tags, added custom table class
      
      * PW-503: removed redundant table, refactor, added nbsp if empty
      1c9b2899