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

Throws MissingPluginException #245

Open
shahzaibdev1 opened this issue Feb 6, 2024 · 2 comments
Open

Throws MissingPluginException #245

shahzaibdev1 opened this issue Feb 6, 2024 · 2 comments

Comments

@shahzaibdev1
Copy link

I have setup the pay package in flutter to implement google pay in my flutter app for android. but this error is thrown:
MissingPluginException(No implementation found for method userCanPay on channel plugins.flutter.io/pay_channel)

This is the google pay button

GooglePayButton(
                              paymentConfiguration:
                                  PaymentConfiguration.fromJsonString(googlePayConfiguration),
                              paymentItems: _paymentItems,
                              type: GooglePayButtonType.buy,
                              margin: const EdgeInsets.only(top: 15.0),
                              onPaymentResult: onGooglePayResult,
                              onError: (err) {
                                print("ErrorObj: $err ErrorObject");
                              },
                              loadingIndicator: const Center(
                                child: CircularProgressIndicator(),
                              ),
                            )

and this is the configuration:

const String googlePayConfiguration = '''{
  "provider": "google_pay",
  "data": {
    "apiVersion": 2,
    "apiVersionMinor": 0,
    "merchantInfo": {
      "merchantName": "Example Merchant"
    },
    "allowedPaymentMethods": [
      {
        "type": "CARD",
        "parameters": {
          "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
          "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"]
        },
        "tokenizationSpecification": {
          "type": "PAYMENT_GATEWAY",
          "parameters": {
            "gateway": "example",
            "gatewayMerchantId": "exampleGatewayMerchantId"
          }
        }
      }
    ],
    "transactionInfo": {
      "totalPriceStatus": "FINAL",
      "totalPrice": "1.2",
      "currencyCode": "USD"
    }
  }
}''';

this is the _paymentItems:

const _paymentItems = [
  PaymentItem(
    label: 'Total',
    amount: '1.2',
    status: PaymentItemStatus.final_price,
  )
];
@JlUgia
Copy link
Member

JlUgia commented May 9, 2024

Hello @shahzaibdev1 this appears to be a registry staleness issue.
Take a look at this comment in the flutter repo.

@aggeloskoutanis
Copy link

I also get this error, while, for example, showPaymentSelector works well. I have tried also the flutter comment @JlUgia and did some steps there that people mentioned that might solve the problem, but I had no luck.

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