How can I get user email while paying through Google pay in flutter

Viewed 13

How can I make request so it can return user email so I can use it afterwards

    {
  "provider": "google_pay",
  "data": {
    "environment": "TEST",
    "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": "BCR2DN4TZSYNRF3D",
      "merchantName": "Software Hub"
    },
    "transactionInfo": {
      "countryCode": "US",
      "currencyCode": "USD"
    }
  }
}

That's the google pay Json File so let me know how can i make request so it can return user email which he is using for paying

GooglePayButton(
                    paymentConfigurationAsset:
                    'gpay.json',
                    paymentItems: _paymentItems,
                    style: GooglePayButtonStyle.white,
                    type: GooglePayButtonType.pay,
                    height: 200,
                    width: 200,
                    margin: const EdgeInsets.only(top: 15.0),
                    onPaymentResult: (data){
                      print(data);
                    },
                    loadingIndicator: const Center(
                      child: CircularProgressIndicator(),
                    ),
                  ), 

That button is created using flutter pay package

0 Answers
Related