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

[V7] Update BTCard #1443

Merged
merged 31 commits into from
Nov 19, 2024
Merged

[V7] Update BTCard #1443

merged 31 commits into from
Nov 19, 2024

Conversation

richherrera
Copy link
Contributor

Summary of changes

  • Update BTCard properties to have everything in the init vs using dot syntax

Docstrings:

Checklist

  • Added a changelog entry

Authors

@richherrera richherrera self-assigned this Oct 22, 2024
@richherrera richherrera requested a review from a team as a code owner October 22, 2024 20:19
@richherrera richherrera changed the title Update BTCard [v7] Update BTCard Oct 22, 2024
/// - number: The card number.
/// - expirationMonth: The expiration month as a one or two-digit number on the Gregorian calendar.
/// - expirationYear:The expiration year as a two or four-digit number on the Gregorian calendar.
/// - cvv: The card verification code (like CVV or CID).
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on this doc string I wonder if we should have 2 inits:

  1. CVV only init
  2. Init with number, expirationMonth, expirationYear, CVV, and postal code required

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Though I don't think postal code is actually required. We can confirm with the gateway and if not we should update the docstring to denote optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After confirming with the Cards team, the only required parameters are number, expirationMonth, expirationYear, and cvv, the others are optional. Regarding overloading initializers, it’s not necessary, after the latest changes I made

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, does this mean that we no longer support CVV only nonces for validation? Based on this docs string If you wish to create a CVV-only payment method nonce to verify a card already stored in your Vault, omit all other properties to only collect CVV. was the intent for an overload. If this is no longer supported we should remove that note since currently this would not be possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Jax, for the heads up! I’ve added a new initializer with CVV as the only parameter. As you mentioned, this is only to verify cards that are already stored, let me know what do you think.

@richherrera richherrera changed the title [v7] Update BTCard [V7] Update BTCard Oct 23, 2024
@richherrera richherrera marked this pull request as draft October 24, 2024 15:55
@richherrera richherrera marked this pull request as ready for review October 29, 2024 20:26
V7_MIGRATION.md Outdated Show resolved Hide resolved
Demo/Application/Features/Helpers/CardHelpers.swift Outdated Show resolved Hide resolved
Demo/Application/Features/Helpers/CardHelpers.swift Outdated Show resolved Hide resolved
/// - number: The card number.
/// - expirationMonth: The expiration month as a one or two-digit number on the Gregorian calendar.
/// - expirationYear:The expiration year as a two or four-digit number on the Gregorian calendar.
/// - cvv: The card verification code (like CVV or CID).
Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, does this mean that we no longer support CVV only nonces for validation? Based on this docs string If you wish to create a CVV-only payment method nonce to verify a card already stored in your Vault, omit all other properties to only collect CVV. was the intent for an overload. If this is no longer supported we should remove that note since currently this would not be possible.

Copy link
Contributor

@agedd agedd left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Contributor

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

1 very small take it or leave it cleanup comment and a general question that you may have already confirmed. Thanks again for looking into all of my questions! 🚀

Sources/BraintreeCard/BTCard.swift Show resolved Hide resolved
Sources/BraintreeCard/BTCard.swift Outdated Show resolved Hide resolved
@richherrera richherrera merged commit 416968f into v7 Nov 19, 2024
8 checks passed
@richherrera richherrera deleted the update-btcard-parameters branch November 19, 2024 17:39
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.

4 participants