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

GooglePayButton disappears after loading is finished on the physical phone #267

Open
hm86z2 opened this issue Jun 19, 2024 · 6 comments
Open

Comments

@hm86z2
Copy link

hm86z2 commented Jun 19, 2024

Hello,

GooglePayButton disappears after loading is finished on the physical phone only

Here my code :

        GooglePayButton(
                  paymentConfiguration: PaymentConfiguration.fromJsonString(
                      payment_configurations.defaultGooglePay),
                  paymentItems: paymentItems,
                  type: GooglePayButtonType.buy,
                  // width: 8.sw,
                   // height: 50,
                  margin: const EdgeInsets.only(top: 15.0),
                  onPaymentResult: (result)=> onSubscribe(context,result),
                  loadingIndicator: const Center(
                    child: CircularProgressUi(),
                  ),
                ),

Here my payment_configurations.defaultGooglePay :

const String defaultGooglePay = '''{
  "provider": "google_pay",
  "data": {
    "environment":  "PRODUCTION", 
    "apiVersion": 2, 
    "apiVersionMinor": 0,
    "allowedPaymentMethods": [
      {
        "type": "CARD",
        "tokenizationSpecification": {
          "type": "PAYMENT_GATEWAY",
          "parameters": {
            "gateway": "example",
            "gatewayMerchantId": "gatewayMerchantId"
          }
        },
        "parameters": {
          "allowedCardNetworks": ["VISA", "MASTERCARD"],
          "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
          "billingAddressRequired": true,
          "billingAddressParameters": {
            "format": "FULL",
            "phoneNumberRequired": true
          }
        }
      }
    ],
    "merchantInfo": {
      "merchantId": "xxxxxxxxxxxxxxx",
      "merchantName": "Subscription"
    },
    "transactionInfo": {
      "countryCode": "US",
      "currencyCode": "USD"
    }
  }
}''';
@baraazain
Copy link

i have same issuess
anyone resolve it ??

@baraazain
Copy link

Hello,

GooglePayButton disappears after loading is finished on the physical phone only

Here my code :

        GooglePayButton(
                  paymentConfiguration: PaymentConfiguration.fromJsonString(
                      payment_configurations.defaultGooglePay),
                  paymentItems: paymentItems,
                  type: GooglePayButtonType.buy,
                  // width: 8.sw,
                   // height: 50,
                  margin: const EdgeInsets.only(top: 15.0),
                  onPaymentResult: (result)=> onSubscribe(context,result),
                  loadingIndicator: const Center(
                    child: CircularProgressUi(),
                  ),
                ),

Here my payment_configurations.defaultGooglePay :

const String defaultGooglePay = '''{
  "provider": "google_pay",
  "data": {
    "environment":  "PRODUCTION", 
    "apiVersion": 2, 
    "apiVersionMinor": 0,
    "allowedPaymentMethods": [
      {
        "type": "CARD",
        "tokenizationSpecification": {
          "type": "PAYMENT_GATEWAY",
          "parameters": {
            "gateway": "example",
            "gatewayMerchantId": "gatewayMerchantId"
          }
        },
        "parameters": {
          "allowedCardNetworks": ["VISA", "MASTERCARD"],
          "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
          "billingAddressRequired": true,
          "billingAddressParameters": {
            "format": "FULL",
            "phoneNumberRequired": true
          }
        }
      }
    ],
    "merchantInfo": {
      "merchantId": "xxxxxxxxxxxxxxx",
      "merchantName": "Subscription"
    },
    "transactionInfo": {
      "countryCode": "US",
      "currencyCode": "USD"
    }
  }
}''';

do you resolve the issues

@JlUgia
Copy link
Member

JlUgia commented Jul 30, 2024

Hi @hm86z2, the GooglePayButton component only appears on screen if Google Pay is available for the device and user accessing your application. That is, the device needs to have a recent version of Google Play services installed, and the user in your application needs to be logged in with a valid Google/Gmail account.

For more details, take a look at the prerequisites to integrate Google Pay in your Android application.

@augustineonu
Copy link

So as I am based in Nigeria, and I can see Google Pay is not available for my region, I can't integrate for the app I am working on.

@JlUgia
Copy link
Member

JlUgia commented Aug 4, 2024

This plugin uses the online Google Pay API, which is available in your country.
Is Google Play services installed on the device you are using to test your application? Are you logged in with a Gmail account?

@augustineonu
Copy link

But the google wallet is not available for my region.
But you mentioned "he GooglePayButton component only appears on screen if Google Pay is available for the device"
I have attached a screenshot below
Screenshot 2024-08-04 at 20 26 47

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

4 participants