paypal-js icon indicating copy to clipboard operation
paypal-js copied to clipboard

[Bug] Property 'PayoutsAAC' does not exist on type 'PayPalNamespace'.

Open AJDowds opened this issue 2 years ago • 3 comments
trafficstars

🐞 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

AJDowds avatar Mar 28 '23 01:03 AJDowds

hi @AJDowds can you share the link you were using to integrate with PayPal?

wsbrunson avatar Feb 14 '24 20:02 wsbrunson

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 avatar Mar 05 '24 01:03 AJDowds

@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 avatar Jun 10 '24 20:06 wsbrunson

@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.

AJDowds avatar Jun 24 '24 11:06 AJDowds