-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Describe the bug
After operating according to usage, the payment button cannot be displayed
Expected behavior
I would like to see a payment button
Screenshots
If applicable, add screenshots to help explain your problem.
flutter doctor output
Include a copy of the output after running flutter doctor if you suspect your issue is related with structural properties in Flutter or other libraries.
Additional context
var googlePayButton = GooglePayButton(
paymentConfiguration: PaymentConfiguration.fromJsonString(defaultGooglePay),
paymentItems: [
PaymentItem(
amount: "0.01",
label: "item A",
status: PaymentItemStatus.final_price
),
PaymentItem(
amount: "0.01",
label: "item B",
status: PaymentItemStatus.final_price
)
],
width: double.infinity,
type: GooglePayButtonType.buy,
margin: const EdgeInsets.only(top: 15),
onPaymentResult: (Map<String, dynamic> result) {
debugPrint("Payment Result: $result");
},
loadingIndicator: const Center(child: CircularProgressIndicator(),),
);
const String defaultGooglePay = '''{
"provider": "google_pay",
"data": {
"environment": "TEST",
"apiVersion": 2,
"apiVersionMinor": 0,
"allowedPaymentMethods": [
{
"type": "CARD",
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "example",
"gatewayMerchantId": "exampleGatewayMerchantId"
}
},
"parameters": {
"allowedCardNetworks": ["VISA", "MASTERCARD"],
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"billingAddressRequired": true,
"billingAddressParameters": {
"format": "FULL",
"phoneNumberRequired": true
}
}
}
],
"merchantInfo": {
"merchantName": "Example Merchant Name"
},
"transactionInfo": {
"countryCode": "US",
"currencyCode": "USD"
}
}
}''';