google-pay / google-pay/flutter-plugin

Support userCanPay when no cards added

Open
#305 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.
userCanPay currently only returns true when a card is added (at least on iOS, unsure about Android).

This is not always desired, and I'd like to be able to determine only if the device/user has Apple Pay support.

Describe the solution you'd like
Enhance userCanPay with an optional field like withCards: PaymentCards.added or withCards: PaymentCards.any

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Apple Pay does support this in the PassKit SDK:

canMakePayments() - returns true if the device/user supports apple pay regardless of card status
canMakePayments(usingNetworks: supportedNetworks) - returns true only if the user has added a card for one of the supported networks. This is the method the Pay plugin currently uses.

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 at the plugin's userCanPay implementation and trace how it calls the iOS PassKit methods canMakePayments() and canMakePayments(usingNetworks:). Clarify the intended withCards behavior for both iOS and Android, then verify that the API distinguishes device support from cards being added.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
mobile-dev, payments
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.