userCanPay static method
Checks if the user can make payments using Apple Pay (iOS) or Google Pay (Android).
provider: The payment provider (PayProvider.applePayorPayProvider.googlePay).merchantId: The unique identifier for the merchant.- Returns: A
Future<bool>indicating whether the payment method is supported.
Implementation
static Future<bool> userCanPay(
PayProvider provider, String merchantId) async {
if (Platform.isIOS && provider == PayProvider.applePay) {
return await _channel
.invokeMethod("isApplePaySupported", {"merchantId": merchantId});
} else if (Platform.isAndroid && provider == PayProvider.googlePay) {
return await _channel
.invokeMethod("isGooglePaySupported", {"merchantId": merchantId});
}
return false;
}