PaymentRequest is an API that allows browsers to act as an intermediary between the three key parties in a financial transaction: the merchant (e.g. an online web store), the buyer (e.g. the user buying from the online web store), and the Payment Method (e.g. credit card). Information necessary to process and confirm a transaction is passed between the Payment Method and the merchant via the browser with the buyer confirming and authorizing as necessary across the flow.
PaymentRequest has been shipped on Desktop and Android for a while now, but not on Android WebView. This Intent is for partially shipping the feature on Android WebView, restricted to Android intent-based payment apps. Web-based Payment Handlers are not supported due to lack of the required UI in WebView.
Android WebView works slightly differently than other platforms, so developers should be aware of caveats. See for example:
How is WebView different from a typical browser like Chrome?
Low: WebView host apps must opt-in to enable PaymentRequest (including a recompile and pushing an update to their users). There are two steps required:
1) Add the following to AndroidManifest.xml:
<queries>
<intent>
<action android:name="org.chromium.intent.action.PAY"/>
</intent>
<intent>
<action android:name="org.chromium.intent.action.IS_READY_TO_PAY"/>
</intent>
<intent>
<action android:name="org.chromium.intent.action.UPDATE_PAYMENT_DETAILS"/>
</intent>
</queries>
2) Execute the following initialization code for each WebView where PaymentRequest should be enabled:
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setPaymentRequestEnabled(true);
Shipping on WebView | 136 |
None
LGTM2 to ship in WebView as well
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/34282fd9-8a1c-4a53-b0fd-525af0e86137n%40chromium.org.
LGTM3
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ec87bd50-ac96-4668-94d4-c03244217b3b%40gmail.com.