react-paypal-js
react-paypal-js copied to clipboard
[BUG]: Payer Type when running actions.order.create
Is there an existing issue for this?
- [X] I have searched the existing issues.
🐞 Describe the Bug
This is a typescript issue, where the Payer Type used in the actions.order.create function has many fields, which are actually optional to the Paypal API, marked as required. This forces users to forgo the use of the Payer Type in cases were this optional information is not being collected.
😕 Current Behavior
When I pass the following data, the compiler shows an error

The error is for the following required fields:

However, if passed with through an 'any' type, paypal still works and the API call works, confirming that for Paypal, these keys are optional
🤔 Expected Behavior
It is expected that the Payer Type follows the API paypal type, and thus allows for the ommission of these data keys
🔬 Minimal Reproduction
1. Use the actions.order.create function provided by the createOrder Prop passed to PayPalButtons component.
2. Pass a payer with any of the above keys omitted.
🌍 Environment
| Software | Version(s) |
| ---------------- | ---------- |
| react-paypal-js | 7.8.1 |
| Browser | any |
| Operating System | any |
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
➕ Anything else?
No response