paypal-js
paypal-js copied to clipboard
[Bug] Property 'PayoutsAAC' does not exist on type 'PayPalNamespace'.
🐞 Describe the Bug
When initiating the paypal object via any of the methods listed on the paypal website (script in index.html or loadScript method) and adding either:
<script src="https://www.paypalobjects.com/payouts/js/payouts_aac.js"></script> to index
or
components: "buttons,marks,payout",
Trying to access window.paypal?.PayoutsAAC results in Property 'PayoutsAAC' does not exist on type 'PayPalNamespace'..
Console logging out the window.paypal object, I can see that the PayoutsAAC property does exist.
🔬 Minimal Reproduction
- Follow the steps to integrate the paypal object into your react project under
window.paypal - Attempt to use
window.paypal?.PayoutsAAC
😕 Actual Behavior
See Describe the Bug
🤔 Expected Behavior
The typescript definition of PayPalNamespace should allow for other properties beside Buttons
🌍 Environment
- Node.js/npm: v18.12.1
- OS: Windows
- Browser: Chrome
hi @AJDowds can you share the link you were using to integrate with PayPal?
I thought that if I used: (buttons,payout in components)
<PayPalScriptProvider
options={{
clientId:
(process.env.MODE === "development"
? process.env.SANDBOX_CLIENT_ID
: process.env.PRODUCTION_CLIENT_ID) ?? "",
currency: "GBP",
components: "buttons,payout",
}}
>
Then I didn't actually need to use a link to integrate? Having said that, I have also tried including:
<script src="https://www.paypalobjects.com/payouts/js/payouts_aac.js"></script>
and
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID"></script>
@AJDowds I don't believe payout is a feature of the JS SDK. I'm not familiar with payouts.js, do you have a link to the documentation you are using?
@wsbrunson https://developer.paypal.com/docs/payouts/standard/
I guess as you say, it's not a feature of the JS SDK so I'd have to find an alternate way of using it.