Skip to content

Commit 2b06e3d

Browse files
committed
Add Payment Request section for webview_flutter_android
1 parent ddea6d4 commit 2b06e3d

File tree

1 file changed

+29
-0
lines changed
  • packages/webview_flutter/webview_flutter_android

1 file changed

+29
-0
lines changed

packages/webview_flutter/webview_flutter_android/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,35 @@ Java:
5252
import io.flutter.plugins.webviewflutter.WebViewFlutterAndroidExternalApi;
5353
```
5454

55+
## Enable Payment Request in WebView
56+
57+
Payment Request feature can be enabled by `AndroidWebViewController.setPaymentRequestEnabled` after checking `AndroidWebViewController.isWebViewFeatureSupported`.
58+
59+
```dart
60+
final bool paymentRequestEnabled = await androidController
61+
.isWebViewFeatureSupported(WebViewFeatureType.paymentRequest);
62+
63+
if (paymentRequestEnabled) {
64+
await androidController.setPaymentRequestEnabled(true);
65+
}
66+
```
67+
68+
Add intent filters to your AndroidManifest.xml to discover and invoke Android payment apps using system intents:
69+
70+
```xml
71+
<queries>
72+
<intent>
73+
<action android:name="org.chromium.intent.action.PAY"/>
74+
</intent>
75+
<intent>
76+
<action android:name="org.chromium.intent.action.IS_READY_TO_PAY"/>
77+
</intent>
78+
<intent>
79+
<action android:name="org.chromium.intent.action.UPDATE_PAYMENT_DETAILS"/>
80+
</intent>
81+
</queries>
82+
```
83+
5584
## Fullscreen Video
5685

5786
To display a video as fullscreen, an app must manually handle the notification that the current page

0 commit comments

Comments
 (0)