google-pay / flutter-plugin

Apache License 2.0
138 stars 126 forks source link

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

Open hm86z2 opened 1 week ago

hm86z2 commented 1 week ago

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 commented 3 days ago

i have same issuess anyone resolve it ??

baraazain commented 3 days ago

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