Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: use a cardDetails prop for AddToWalletButton component #913

Conversation

charliecruzan-stripe
Copy link
Collaborator

@charliecruzan-stripe charliecruzan-stripe commented Apr 28, 2022

Summary

Modified the props for the AddToWalletButton component. Instead of passing cardHolderName, cardLastFour, cardDescription, and cardBrand directly as props, you will instead pass a cardDetails prop, which is an object containing the following fields:

  • primaryAccountIdentifier: The wallet.primary_account_identifier value from the issued card.
  • name: The card holder name (previously cardHolderName).
  • description: A user-facing description of the card (previously cardDescription).
  • lastFour: Last 4 digits of the card, optional (previously cardLastFour).
  • brand: The card brand, optional (previously cardBrand).

Motivation

Stripe iOS recently updated to expose a method that sets the primaryAccountIdentifier, and without this push provisioning can fail on iOS. This provided a good opportunity to instead pass a cardDetails rather than individual props for each field.

Testing

  • I tested this manually
  • I added automated tests

Note: This was tested via the STPFakeAddPaymentPassViewController

Documentation

I will update https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native accordingly

Copy link

@lukas-stripe lukas-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion, otherwise looks good (as far as I can follow React Native 😅)

CHANGELOG.md Show resolved Hide resolved
@charliecruzan-stripe charliecruzan-stripe merged commit 3835b7a into master May 4, 2022
@charliecruzan-stripe charliecruzan-stripe deleted the charliecruzan-useprimaryaccountidentifierforiospushprovisioning branch May 4, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants