google-pay / flutter-plugin

Apache License 2.0
141 stars 129 forks source link

google pay button not visble without any error #270

Open osama300 opened 1 month ago

osama300 commented 1 month ago

i use string json config here print error but not print any thing

onError: (e){ print('this error $e'); },

augustineonu commented 1 month ago

I have same issue. i don't get an error from the method or plugin, what I get is the childOnError widget which is from the package. ALso, I want to know if it possible to integrate for Countries like Nigeria. I successfully see the button on ios simulator, but not on ios real device. Below is a code that doesn't display for android.

FutureBuilder( future: _googlePayConfigFuture, builder: (context, snapshot) { return snapshot.hasData ? GooglePayButton(

                      paymentConfiguration: snapshot.data!,
                      paymentItems: _paymentItems,
                      type: GooglePayButtonType.buy,
                      margin: const EdgeInsets.only(top: 15.0),
                      onPaymentResult: (result) {
                        print("result:: ${result}");
                      },
                      width: phoneWidth,
                      childOnError: const Text("Google Pay not supported"),
                      loadingIndicator: const Center(
                        child: CircularProgressIndicator(),
                      ),
                    )
                  : snapshot.hasError
                      ? textWidget(context,
                          title: "Erro: ${snapshot.error.toString()}")
                      : textWidget(context, title: "unknown error");
            }),
TetrixGauss commented 3 days ago

Make sure you have a card in your google wallet! This has happened to me and when i added a card in the google wallet the button appeared. The same issues can be fixed with the same way in the ios platform.