braintree / popup-bridge-android

PopupBridge allows WebViews to open popup windows in a browser and send data back to the WebView
MIT License
53 stars 28 forks source link

Getting Values Back From PopUP Browser #36

Open susthitsoft opened 3 years ago

susthitsoft commented 3 years ago

General information

Issue description

I am trying to integrate for Payment GateWays Other Than Paypal.

Example: Use RazaorPay Test Page https://susthitsoft.com/test.html

Earlier when I was using another webview show popups

Using onCreateWindows of WebChromeClient class WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; transport.setWebView(newWebView); resultMsg.sendToTarget();

It seemed to be working.

However, this is'nt case with PopUpBridge

Any ideas is there is way to link WEbViewTransport to Browser window launched? Or am I missing something. If this works it could be a generic method for all payments gatways like Stripe etc.

Could you help ?

sshropshire commented 3 years ago

Hi @susthitsoft can you provide more details / steps about what kind of use-cases you're looking to support?

susthitsoft commented 3 years ago

Idea is to support accepting payments (eg. Paypal/Stripe/RazorPay) without needing any special coding apart from just adding PopUpBridge.

Scenario: (Should work for any website or payment gateway)

  1. User opens webview based eCom Web app
  2. Adds products to cart
  3. Checkout Prompt
  4. Payment Window Opens in Browser Switch
  5. Payment received / cancelled -
  6. Popup Browser is closed (automatically) and user is sent back to webview

Seamless payments via WebView

Supporting acceptance of payments for various payment gateways for WebView based apps (without any javascript changes in the webpage as required by PopUpBridge - as it does'nt handle postMessages from new window back)

sshropshire commented 3 years ago

@susthitsoft ok I understand the expected behavior. Are you observing different behavior in your use case for any of the steps? Or would this be an entirely new feature?