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

Feat: Add Amount to Card Fields for Improved BIN API Requests #2457

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jtanya17
Copy link

Description

This change adds support for an amount prop in the Card Fields component, enabling more accurate BIN API requests. The amount object, containing currency and value, is passed to the card-fields component and subsequently used in the BIN API request data. When unavailable, the value defaults to 0. This enhancement eliminates the use of dummy values, improving the precision of BIN lookups.

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

https://paypal.atlassian.net/browse/DTPPCPSDK-2863

Reproduction Steps (if applicable)

Screenshots (if applicable)

Dependent Changes (if applicable)

Groups who should review (if applicable)

❤️ Thank you!

@jtanya17 jtanya17 requested a review from a team as a code owner December 12, 2024 17:21
src/zoid/card-fields/component.jsx Outdated Show resolved Hide resolved
src/zoid/card-fields/component.jsx Outdated Show resolved Hide resolved
@@ -297,6 +297,12 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
value: ({ props }) => props.parent.props.locale,
},

amount: {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@wsbrunson Should this just be a parent prop instead?
amount: { subTotal: '5.50', total: '5.00' } has little value for other card-fields.

Copy link
Member

Choose a reason for hiding this comment

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

I can't remember how this works, i think both the parent and the child need it if you are going to access it inside of CardNumberField. If you are not accessing it in a child field though, then it would only be needed on the parent

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