google-pay / google-pay/flutter-plugin

Unable to display payment button after configuration completion

Open
#311 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
176
Forks
147
PR merge metrics
No merged PRs in 30d

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"
}
}
}''';

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the shown GooglePayButton configuration and inspect the Flutter plugin's button rendering path. Confirm whether the configuration or runtime environment prevents rendering, and consider the issue done when the payment button displays with the provided setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev, payments
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.