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

[Bug] Paypal modal loads indefinitely

Open bufordtaylor opened this issue 3 years ago • 1 comments

I have two paypal accounts. One appears to be working fine while the other just loads indefinitely.

spinning-forever

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

CleanShot 2022-09-15 at 10 15 30@2x

🌍 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

bufordtaylor avatar Sep 15 '22 09:09 bufordtaylor

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.

bufordtaylor avatar Sep 15 '22 09:09 bufordtaylor

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!

github-actions[bot] avatar Feb 18 '24 00:02 github-actions[bot]

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.

github-actions[bot] avatar Feb 26 '24 00:02 github-actions[bot]