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 1 commit 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
amount: {
type: "string",
queryParam: true,
value: getAmount,
Copy link
Contributor

Choose a reason for hiding this comment

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

getAmount() throws an error if no amount is passed in the data-attributes. Is this going to break existing integrations since data-amount is not currently documented to be passed?

Copy link
Author

Choose a reason for hiding this comment

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

That's definitely a good call out.. will have to investigate more as to where else this is being used.

@@ -714,6 +715,12 @@ export const getCardFieldsComponent: () => CardFieldsComponent = memoize(
value: getCurrency,
},

amount: {
type: "string",
queryParam: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think queryParam is necessary here. Assuming that you plan on pulling the amount from xprops.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I just set it to false

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.

2 participants