jonasbark / flutter_stripe_payment

[DISCONTINUED] A flutter plugin with stripe payment plugin integration
MIT License
309 stars 244 forks source link

Transaction failed: MissingPluginException(No implementation found for method createPaymentMethod on channel stripe_payment) #312

Open coder-Aayush opened 3 years ago

coder-Aayush commented 3 years ago

I am trying to implement stripe within my flutter app. I got the following error while integrating the latest version of this plugin.

Transaction failed: MissingPluginException(No implementation found for method createPaymentMethod on channel stripe_payment)

code

Future<StripeTransactionResponse> payWithNewCard(
      {String amount, String currency}) async {
    try {
      var paymentMethod = await StripePayment.paymentRequestWithCardForm(
          CardFormPaymentRequest());
      var paymentIntent =
          await _StripeService.createPaymentIntent(amount, currency);
      var response = await StripePayment.confirmPaymentIntent(PaymentIntent(
          clientSecret: paymentIntent['client_secret'],
          paymentMethodId: paymentMethod.id));
      if (response.status == 'succeeded') {
        print('success');
        return new StripeTransactionResponse(
            message: 'Transaction successful', success: true);
      } else {
        print('failed');
        return new StripeTransactionResponse(
            message: 'Transaction failed', success: false);
      }
    } on PlatformException catch (err) {
      return _StripeService.getPlatformExceptionErrorResult(err);
    } catch (err) {
      return new StripeTransactionResponse(
          message: 'Transaction failed: ${err.toString()}', success: false);
    }
  }

Thanks for Response

vijaypareek13 commented 3 years ago

Yes i got the same result

ayaanpathan commented 3 years ago

run flutter clean and rebuild your code