Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
coder-Aayush opened this issue Jun 26, 2021 · 2 comments

Comments

@coder-Aayush
Copy link

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
Copy link

Yes i got the same result

@ayaanpathan
Copy link

run flutter clean and rebuild your code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants