presentPaymentSheet method

  1. @override
Future<Map<String, dynamic>> presentPaymentSheet({
  1. required String productId,
  2. String? userId,
  3. bool dismissible = true,
})
override

iOS only. Android intentionally returns a not_implemented error — Android routes payment through Google Play User Choice Billing, and the web payment sheet is presented internally by the SDK for upgrade/switch offers rather than via this method.

Implementation

@override
Future<Map<String, dynamic>> presentPaymentSheet({
  required String productId,
  String? userId,
  bool dismissible = true,
}) async {
  final result = await methodChannel.invokeMethod<Map>('presentPaymentSheet', {
    'productId': productId,
    'userId': userId,
    'dismissible': dismissible,
  });
  return Map<String, dynamic>.from(result!);
}