paypal-js
paypal-js copied to clipboard
[Bug] Paypal modal loads indefinitely
I have two paypal accounts. One appears to be working fine while the other just loads indefinitely.

If I look at the paypal API logs, I see there is a 403 at the timestamp I was trying to load the app.

🌍 Environment
5.0.332
The code for both apps are the same, only the clientId differs.
import React, { useState, useEffect } from 'react'
import { loadScript } from "@paypal/paypal-js"
const PayPal = () => {
const { getRequest } = useQuery()
useEffect(() => {
loadScript({ "client-id": clientId, vault: true, intent: 'subscription' }).then((paypal) => {
console.log(paypal)
paypal.Buttons({
style: { layout: 'horizontal' },
createSubscription: createPayPalSubscription,
onApprove: payPalSubscriptionApproved
}).render("#paypal-button-container").catch((error) => {
console.error("failed to render the PayPal Buttons", error);
})
}).catch((error) => {
console.error("failed to load the PayPal JS SDK script", error);
})
}, [])
const createPayPalSubscription = (data, actions) => {
// this plan ID is from paypal subscriptions.
return actions.subscription.create({
'plan_id': planId
})
}
const payPalSubscriptionApproved = (data, actions) => { /* do stuff */ }
return <>pp dirct <div id="paypal-button-container" /></>
}
export default PayPal
Based on the above, I'm led to believe that is has to be somewhere inside Paypal.com itself, hidden in a config area. I just have no way to check what the problem is.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information.