changes.mady.by.user de Sousa Santos, Rodrigo
Saved on Jun 19, 2024
...
WEB
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
src/hooks/use-paycomet-pay-link-popup/use-paycomet-pay-link-popup.ts
There is the openWebModal and openNativeModal methods when our new code will be.
openWebModal
openNativeModal
When the user clicks to popup’s close will generate the event: e.data = 'payment-pay-link-closed'
e.data = 'payment-pay-link-closed'
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'
{ "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
e.data?.body?.code
Cancel code number:
Bizum: 1342
1342
Paypal: 1425
1425
Create a new logger code to send to mParticle when the user cancels or closes the iframe.
NATIVE
We will add a new attribute toolbar=no and change the location=no on InAppBrower to remove the toolbar, making it possible to close the native modal.
toolbar=no
location=no
const win = InAppBrowser.open(url, '_blank', 'location=no,toolbar=no');
IOS: currently
IOS: after the change
ANDROID: currently
ANDROID: after the change
Another point of improvement found is the button to close the payments page.