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

[Bug] Unable to use createVaultSetupToken with PayPalCardFieldsProvider #587

Open
anmosoriosher opened this issue Nov 29, 2024 · 0 comments

Comments

@anmosoriosher
Copy link

Library used

react-paypal-js

🐞 Describe the Bug

I want to save payment methods for future use without an immediate transaction using the PayPalCardFieldsProvider component. This component does not allow to call only the createVaultSetupToken prop because the createOrder prop is mandatory.

I tried to specify both functions (createVaultSetupToken and createOrder) but there is an error shown in the console.

Error in console when trying to use createVaultSetupToken with PayPalCardFieldsProvider component even though its available in the provided interface.

🔬 Minimal Reproduction

Add a PayPalCardFieldsProvider component and try to add the createVaultSetupToken prop without createOrder or try to add both createVaultSetupToken and createOrder.

😕 Actual Behavior

  • When trying to specify only createVaultSetupToken :
    image

  • When trying to specify both createVaultSetupToken and createOrder: Error is thrown during runtime : Uncaught Error: Cannot pass both createVaultSetupToken and createOrder
    image

🤔 Expected Behavior

Being able to use the createVaultSetupToken prop in PayPalCardFieldsProvider component without having to specify a createOrder prop.

🌍 Environment

  • Node.js/npm: - 20.14.0
  • OS: - Windows 11
  • Browser: - Edge

➕ Additional Context

Add any other context about the problem here.

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

No branches or pull requests

1 participant