Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Pay via WebView #2396

Closed
NikiforosDesquared opened this issue Jun 9, 2023 · 28 comments
Closed

Google Pay via WebView #2396

NikiforosDesquared opened this issue Jun 9, 2023 · 28 comments

Comments

@NikiforosDesquared
Copy link

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
Copy link
Collaborator

Hello @NikiforosDesquared,

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

  • Make sure that JavaScript is enabled for your WebView.
  • Please do not load a page that opens Viva Wallet Smart Checkout inside an iframe. Using an iframe will disable certain features.
  • If a user selects to pay with different payment methods, our smart checkout can make redirection to the relevant page of an alternative payment method. In this case, please make sure that you are not intercepting the process during the user’s navigation.

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

  • Redirects – for bank and 3DS authorization (for all payments), as well as for certain payment methods, such as iDEAL. If the WebView blocks redirects, the customer will not be able to complete the transaction
  • Pop-ups – for payment methods which utilize modals, such as PayPal
  • Scripts – for payment methods which utilize scripts, such as Apple Pay.

Kind regards,
Viva Wallet E-commerce Support Team

@NikiforosDesquared
Copy link
Author

Dear Sir or Madam of @VivaWalletCustomerSupport

  • JavaScript is enabled on webviews.
  • We do not use an iframe.
  • We are not intercepting redirects, for example 3DS authorization works perfectly fine.
  • Pop-ups are generally allowed in webviews.
  • Apple Pay also works.

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

Dear Sir or Madam of @VivaWalletCustomerSupport,

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

Kind regards,
Nikiforos Manalis

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Author

NikiforosDesquared commented Jun 14, 2023 via email

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

NikiforosDesquared commented Jun 16, 2023 via email

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Author

Hello @VivaWalletCustomerSupport ,

I just sent a private email with the details requested.

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

NikiforosDesquared commented Jun 20, 2023 via email

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

NikiforosDesquared commented Jun 21, 2023

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
Copy link
Collaborator

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
Copy link
Author

Hello @VivaWalletCustomerSupport ,

Is there any update regarding the matter?

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

Dear @VivaWalletCustomerSupport

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

@VivaWalletCustomerSupport
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants