registerWith static method

void registerWith(
  1. Registrar registrar
)

Implementation

static void registerWith(Registrar registrar) {
  // `registrar.messenger` is deprecated but still required for legacy web plugins.
  final channel = MethodChannel(
      'lpe/native_pay', const StandardMethodCodec(), registrar.messenger);
  channel.setMethodCallHandler((call) async {
    if (call.method == 'presentNativePay') {
      final args = (call.arguments ?? <String, dynamic>{}) as Map;
      return _handlePresentNativePay(args);
    }
    throw PlatformException(
        code: 'unimplemented', message: 'Method not implemented on web');
  });
}