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

create new types for createOrder and creatVaultToken #605

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

hnguyen510
Copy link
Contributor

@hnguyen510 hnguyen510 commented Jan 15, 2025

This pr is to fix this LI-73058

Problem: the createOrder callback is require when createVaultToken is implement when it should be one or the other and not both.

Closes #587
Closes #580

@hnguyen510 hnguyen510 requested a review from a team as a code owner January 15, 2025 20:05
Copy link

changeset-bot bot commented Jan 15, 2025

🦋 Changeset detected

Latest commit: 35591cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@paypal/paypal-js Major
@paypal/react-paypal-js Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@ravishekhar ravishekhar left a comment

Choose a reason for hiding this comment

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

Looks good overall.


export interface PayPalCardFieldsComponentCreateVaultSetupToken
extends PayPalCardFieldsComponentBasics {
createOrder?: never;
Copy link
Contributor

Choose a reason for hiding this comment

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

lets revisit if we need createOrder?: never;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if createOrder?: never add any value, so i feel like we can remove that

Copy link
Contributor

Choose a reason for hiding this comment

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

There might be value in future clarity.

@wsbrunson
Copy link
Member

@hnguyen510 can you also add onCancel to Card Fields props? #580

expect(createVaultSetupTokenCallback.createOrder).toBeUndefined();
});

test.skip("Can't have both", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these test still supposed to be skipped?

Copy link
Contributor Author

@hnguyen510 hnguyen510 Jan 21, 2025

Choose a reason for hiding this comment

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

It still need to be skip right now because there is assertionError. Not sure what assertion call I should do instead.


export interface PayPalCardFieldsComponentCreateVaultSetupToken
extends PayPalCardFieldsComponentBasics {
createOrder?: never;
Copy link
Contributor

Choose a reason for hiding this comment

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

There might be value in future clarity.

@@ -0,0 +1,5 @@
---
"@paypal/paypal-js": major
Copy link
Member

Choose a reason for hiding this comment

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

this is probably a minor change since its not breaking any existing usage of the sdk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the changeset, how do i remove the old one?

Copy link
Member

Choose a reason for hiding this comment

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

you can delete this file

@hnguyen510 hnguyen510 merged commit 6f339f6 into main Jan 22, 2025
4 checks passed
@hnguyen510 hnguyen510 deleted the feature/update-createOrder branch January 22, 2025 21:05
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.

[Bug] Unable to use createVaultSetupToken with PayPalCardFieldsProvider [Bug] Type and Docs not sync
4 participants