Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleTechnical refinement
  • We will recover the user action at the click moment to close the popup

    • path: src/hooks/use-paycomet-pay-link-popup/use-paycomet-pay-link-popup.ts

  • There is the openWebModalmethod and openNativeModal methods when our new code will be.

    • When the user clicks to popup’s close will generate the event: e.data = 'payment-pay-link-closed'

      image-20240619-105139.pngimage-20240619-105226.png
      • Inside this condition, we will create a redirect code:

        • navigate((routes.cart), { replace: true });

    • When the user clicks to cancel, inside the iframe, will generate the event: e.data = 'payment-pay-link-closed'

      image-20240619-105856.pngimage-20240619-105952.png

      image-20240619-105809.png

      Code Block
      languagejson
      {
          "type": "payment-outcome",
          "body": {
              "type": "Failed",
              "code": 1425,
              "messages": {
                  "errorCode": 0,
                  "error": {
                      "amount": "1029",
                      "amountDisplay": "10,29 €",
                      "amountEur": "0.00",
                      "amountEurDisplay": "-",
                      "costumerCountry": "PT",
                      "currency": "EUR",
                      "errorCode": 1425,
                      "errorDescription": "PayPal - Operación cancelada por el usuario",
                      "feeEuro": "0",
                      "feePercent": "0",
                      "methodId": "10",
                      "operationId": 241447100,
                      "operationName": "Autorización",
                      "operationType": 1,
                      "order": "e281e9ec-3ae5-47d8-84d3-80858eb9eec0",
                      "originalIp": "89.114.65.195",
                      "paycometId": "241663819",
                      "response": "KO",
                      "state": 0,
                      "stateName": "Fallida",
                      "terminal": 51647,
                      "terminalCurrency": "EUR",
                      "terminalName": "www.burgerking.es - BANKSTORE (TEST)",
                      "timestamp": "20240619125924",
                      "user": "Zu2SJQBx",
                      "history": [
                          {
                              "amount": "1029",
                              "amountDisplay": "10,29 €",
                              "amountEur": "0.00",
                              "amountEurDisplay": "-",
                              "costumerCountry": "PT",
                              "currency": "EUR",
                              "errorCode": 1425,
                              "errorDescription": "PayPal - Operación cancelada por el usuario",
                              "feeEuro": "0",
                              "feePercent": "0",
                              "methodId": "10",
                              "operationId": 241447100,
                              "operationName": "Autorización",
                              "operationType": 1,
                              "order": "e281e9ec-3ae5-47d8-84d3-80858eb9eec0",
                              "originalIp": "89.114.65.195",
                              "paycometId": "241663819",
                              "productDescription": "Menu The Cheesy Onion Large",
                              "response": "KO",
                              "state": 0,
                              "stateName": "Fallida",
                              "terminal": 51647,
                              "terminalCurrency": "EUR",
                              "terminalName": "www.burgerking.es - BANKSTORE (TEST)",
                              "timestamp": "20240619125924",
                              "user": "Zu2SJQBx"
                          }
                      ]
                  }
              }
          }
      }

      • To validate when the user cancels the payment in the same condition above, we will validate the code: e.data?.body?.code

      • Cancel code number:

        • Bizum: 1342

        • Paypal: 1425

    • Create a new logger code to send to mParticle when the user cancels or closes the iframe.

...