isPlatformPaySupported method

  1. @override
Future<bool> isPlatformPaySupported({
  1. IsGooglePaySupportedParams? params,
  2. PlatformPayWebPaymentRequestCreateOptions? paymentRequestOptions,
})
override

Check if either google pay or apple pay is supported on device.

Implementation

@override
Future<bool> isPlatformPaySupported({
  IsGooglePaySupportedParams? params,
  PlatformPayWebPaymentRequestCreateOptions? paymentRequestOptions,
}) {
  final paymentRequest = js.paymentRequest((paymentRequestOptions ??
          PlatformPayWebPaymentRequestCreateOptions.defaultOptions)
      .toJS());

  return paymentRequest.isPaymentAvailable;
}