VivaPayments / API

Index of Viva Wallet open source projects on GitHub.
139 stars 163 forks source link

Google Pay via WebView #2396

Closed NikiforosDesquared closed 1 year ago

NikiforosDesquared commented 1 year ago

Hello,

In our native mobile implementation of a marketplace the BE generates a VivaPayment URL, and sends this URL to the clients.

The clients then open this URL in an in-app WebView. When a payment (via card for example) is complete Viva returns a specific success/failure URL which the WebView handles in order to close itself and inform the user for the outcome.

This works for cards, but when GPay is selected firstly the user has to sign in with Google as expected but then viva returns 404 http error (logs below).

Is there a way to make this work via WebView? Is there a native android/iOS library which we can use instead?

2023-06-09 11:56:21.100 7119-7119/gr.marketplace.mobileApp.test D/PaymentWebVView: https://pay.google.com/gp/p/ui/pay?hl=el#request={SomeIdentifier} 2023-06-09 11:56:21.296 7119-7119/gr.marketplace.mobileApp.test I/chromium: [INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.", source: (0) 2023-06-09 11:56:21.307 7119-7119/gr.marketplace.mobileApp.test D/PaymentWebVView: onPageStarted 2023-06-09 11:56:21.436 7119-7119/gr.marketplace.mobileApp.test I/chromium: [INFO:CONSOLE(221)] "%c%s color: red; background: yellow; font-size: 24px; WARNING!", source: //mss/boq-payments-consumer//js/k=boq-payments-consumer.InstantbuyFrontendBuyflowPayUi.en_US.qvrO_xx61yg.es5.O/am=4JgBgA/d=1/excm=IZT63,Juhsoe,LEikZe,PrPYRd,_b,_r,_tp,hc6Ubd,payview,ws9Tlc/ed=1/dg=0/wt=2/ujg=1/rs=AMitfrhTTInzzaAWOZaLkkSgduPt3g3iFg/m=_b,_tp,r,Juhsoe,LEikZe,PrPYRd,hc6Ubd,IZT63,ws9Tlc (221) 2023-06-09 11:56:21.436 7119-7119/gr.marketplace.mobileApp.test I/chromium: [INFO:CONSOLE(221)] "%c%s font-size: 18px; Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS. Do not enter or paste code that you do not understand.", source: //mss/boq-payments-consumer/_/js/k=boq-payments-consumer.InstantbuyFrontendBuyflowPayUi.en_US.qvrO_xx61yg.es5.O/am=4JgBgA/d=1/excm=IZT63,Juhsoe,LEikZe,PrPYRd,_b,_r,_tp,hc6Ubd,payview,ws9Tlc/ed=1/dg=0/wt=2/ujg=1/rs=AMitfrhTTInzzaAWOZaLkkSgduPt3g3iFg/m=_b,_tp,_r,Juhsoe,LEikZe,PrPYRd,hc6Ubd,IZT63,ws9Tlc (221) 2023-06-09 11:56:21.837 7119-7119/gr.marketplace.mobileApp.test I/chromium: [INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.", source: (0) 2023-06-09 11:56:22.602 7119-7119/gr.marketplace.mobileApp.test D/PaymentWebVView: onPageFinished 2023-06-09 11:56:22.770 7119-7119/gr.marketplace.mobileApp.test D/PaymentWebVView: onReceivedHttpError 2023-06-09 11:56:22.770 7119-7119/gr.marketplace.mobileApp.test D/PaymentActivity$startPaymentWebview: LogNonFatalCustomEvent ->Code : 404 Description : 2023-06-09 11:56:22.770 7119-7119/gr.marketplace.mobileApp.test E/WebView_onHttpError: Code : 404 Description : 2023-06-09 11:56:23.631 7119-7119/gr.marketplace.mobileApp.test D/PaymentWebVView: onReceivedError 2023-06-09 11:56:23.631 7119-7119/gr.marketplace.mobileApp.test D/PaymentActivity$startPaymentWebview: LogNonFatalCustomEvent ->Code : -2 Description : net::ERR_ADDRESS_UNREACHABLE 2023-06-09 11:56:23.631 7119-7119/gr.marketplace.mobileApp.test E/WebView_onError: Code : -2 Description : net::ERR_ADDRESS_UNREACHABLE 2023-06-09 11:56:23.631 7119-7119/gr.marketplace.mobileApp.test D/PaymentWebVView: destroyWebView 2023-06-09 11:56:23.663 7119-7119/gr.marketplace.mobileApp.test E/PaymentWebVView: payment_failed

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for your message. Please note the following points to ensure that the Web View integration works smoothly.

Also, the following features should be allowed in the WebView:

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Dear Sir or Madam of @VivaWalletCustomerSupport

The problem we are facing is specific to Google Pay.

Please inform us if there are any other information you might need, i would also be happy to any live chat / call / meeting with a tech representative.

Clarifications: By "WebView" we are referring to Android WebView and iOS WKWebView

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for the swift response. Can you please tell us which phone device you are using and which android or IOS version is it installed on it? Also, we would like the Merchant ID of your Viva Wallet account. Lastly, you can follow the link below and connect to our live chat if you wish:

https://www.vivawallet.com/

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Dear Sir or Madam of @VivaWalletCustomerSupport

The problem is happening with any Android device of any version above Android 5 that our native app supports. Its being currently tested in a Xiaomi Mi9T with Android 10 Since i am only a developer i would not like to send here, publicly, the Merchant ID.

Last but not least, i was not able to connect to your chat service since it appears to be only for customers not tech support.

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for your response. You can start a chat conversation by selecting that you are new to Viva Wallet and follow the instructions. If you are not able to connect to our live chat, you can send us the Merchant ID of the Viva Wallet account to support@vivawallet.com. Please add the GitHub's ticket number in the subject of the e-mail.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

We just wanted to follow up on the reply we sent yesterday. We were simply wondering if you read our response.

In any case this ticket will remain active for at least 24 hours, so that you can come back if you wish.

However, if you have any questions, please don't hesitate to reply here and we'd be happy to help!

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Dear Sir or Madam of @VivaWalletCustomerSupport,

I just sent an email to the address provided with the information requested.

Kind regards, Nikiforos Manalis

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for the e-mail. Can you please share with us a screenshot of the error in your application? Also, can you please clarify if you are using a valid card or a test card to complete the transaction? If you are using a test card, can you please share the number of the card with us? Thank you in advance.

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Dear Sir or Madam of Viva Wallet Customer Support,

The short answer is no I can't. I get an error screen of google (basically it is a 404 screen ) for some milliseconds, then viva returns the error url so my app shows my native "onFailure" screen. You can see the logs I sent on the github issue.

I don't select a card, i get the behaviour i described before just after i sign in with google, i assume i get it because of the screen which i have to select a card.

On Wed, Jun 14, 2023 at 10:43 AM VivaWalletCustomerSupport < @.***> wrote:

Hello @NikiforosDesquared https://github.com/NikiforosDesquared,

Thank you for the e-mail. Can you please share with us a screenshot of the error in your application? Also, can you please clarify if you are using a valid card or a test card to complete the transaction? If you are using a test card, can you please share the number of the card with us? Thank you in advance.

Kind regards, Viva Wallet E-commerce Support Team

— Reply to this email directly, view it on GitHub https://github.com/VivaPayments/API/issues/2396#issuecomment-1590650960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJAMGI6MRZCOX7UOUF6LHM3XLFTQJANCNFSM6AAAAAAZAMF66A . You are receiving this because you were mentioned.Message ID: @.***>

-- Με εκτίμηση, Nikiforos Manalis Mobile Software Engineer - Desquared S.A. www.thinkdesquared.com T +30 210 7472700 - M +30 6976290478

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for your message. We are currently investigating your issue. We will inform you as soon as we have any updates. Thank you for your time.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for waiting. To continue our investigation, we will need further information. Kindly share the client IP from which you are sending the related request. Moreover, please specify if the above timestamps of the error refer to UTC or UTC+3 (Local) time zone.

Finally, please share the CorrelationID that is included in the HTTP Response.

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Hello,

I will reproduce the issue and send you the logs privately for security and privacy reasons.

The timestamps are UTC+3 (Local) time zone By client IP you mean the phone's IP address? What is the CorrelationID that is included in the HTTP Response? Which HTTP Response are you referring to?

We do not have direct access to the BE system that produces the VIVA URL but we might be able to communicate with the corresponding team.

On Fri, Jun 16, 2023 at 5:41 PM VivaWalletCustomerSupport < @.***> wrote:

Hello @NikiforosDesquared https://github.com/NikiforosDesquared,

Thank you for waiting. To continue our investigation, we will need further information. Kindly share the client IP from which you are sending the related request. Moreover, please specify if the above timestamps of the error refer to UTC or UTC+3 (Local) time zone.

Finally, please share the CorrelationID that is included in the HTTP Response.

Kind regards, Viva Wallet E-commerce Support Team

— Reply to this email directly, view it on GitHub https://github.com/VivaPayments/API/issues/2396#issuecomment-1594808514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJAMGI2U53JJUCCF4OBFDPTXLRWC3ANCNFSM6AAAAAAZAMF66A . You are receiving this because you were mentioned.Message ID: @.***>

-- Με εκτίμηση, Nikiforos Manalis Mobile Software Engineer - Desquared S.A. www.thinkdesquared.com T +30 210 7472700 - M +30 6976290478

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for the answer. By client IP we refer to the IP of the device that tried to complete the payment via Google Pay. About the Correlation ID, it would be helpful if you could trace it in your application. More info can be found in the link below:

X viva Event ID and X Viva Correlation ID

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Hello @VivaWalletCustomerSupport ,

I just sent a private email with the details requested.

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for the e-mail. We will check your information and inform you here as soon as we have any updates.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

We would like to inform you that we couldn't locate your e-mail. Can you please forward the e-mail to support@vivawallet.com and add to the subject of the e-mail the ticket number of GitHub (#2396)? Thank you in advance.

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Hello, I resent the email as requested with subject "Concerning https://github.com/VivaPayments/API/issues/2396"

On Tue, Jun 20, 2023 at 1:30 PM VivaWalletCustomerSupport < @.***> wrote:

Hello @NikiforosDesquared https://github.com/NikiforosDesquared,

We would like to inform you that we couldn't locate your e-mail. Can you please forward the e-mail to @.*** and add to the subject of the e-mail the ticket number of GitHub (#2396 https://github.com/VivaPayments/API/issues/2396)? Thank you in advance.

Kind regards, Viva Wallet E-commerce Support Team

— Reply to this email directly, view it on GitHub https://github.com/VivaPayments/API/issues/2396#issuecomment-1598520226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJAMGI4FPQFLOOAYRMDVWGTXMF3TLANCNFSM6AAAAAAZAMF66A . You are receiving this because you were mentioned.Message ID: @.***>

-- Με εκτίμηση, Nikiforos Manalis Mobile Software Engineer - Desquared S.A. www.thinkdesquared.com T +30 210 7472700 - M +30 6976290478

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you. We located the e-mail. We are already investigating the issue. We will inform you as soon as possible.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for waiting. After further investigation, we didn't trace any error from our side. All the requests in our demo logs have response 200. We would like to advise you to check your implementation and ensure that everything is properly developed.

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Dear Sir or Madam of @VivaWalletCustomerSupport,

I understand that your logs show no issue with the underlying communication, however our logs (as pasted above and at the private email) clearly show that our WebView receives a 404 httpError.

Could you please inform us if Gpay, selected from the VIVA Payment Checkout Screen is supposed to be able to work with a WebView or it is only working through an external browser?

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for your message. We will investigate your query further and let you know as soon as we have any updates.

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Hello @VivaWalletCustomerSupport ,

Is there any update regarding the matter?

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

We apologize for the inconvenience. The issue is still under investigation. I will inform you as soon as I have any updates.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for waiting. After further investigation we can assure you that Google Pay is functional either WebView or through an external browser.

Kind regards, Viva Wallet E-commerce Support Team

NikiforosDesquared commented 1 year ago

Dear @VivaWalletCustomerSupport

Would it be easy to provide us with the a code example of the WebView-incorporated implementation that you used?

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

Thank you for the swift reply. Unfortunately, we cannot provide any sample code. Also, we noticed that in the logs you sent us this error occurred "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor". This error refers to a permission policy that is not recognized by the browser. This can happen when the browser is updated, and a new policy is now recognized.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

We just wanted to follow up on the reply we sent. We were simply wondering if you read our response.

In any case this ticket will remain active for at least 24 hours, so that you can come back if you wish.

However, if you have any questions, please don't hesitate to reply here and we'd be happy to help!

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @NikiforosDesquared,

This ticket will close for now. Please don't hesitate to raise a new ticket if you need further assistance.

Kind regards, Viva Wallet E-commerce Support Team