paypal/paypal-js

[Bug] Payment is blocking

huweihong opened this issue ยท 2 comments

๐Ÿž Test card in sandbox are not working

I used the test card in sandbox to payment. But the test card are not working. I used https://developer.paypal.com/api/rest/sandbox/card-testing/#link-creditcardgeneratorfortesting to generate test card many times. But the error is still there.

๐Ÿ”ฌ Minimal Reproduction

The code is following:

<script
    src="https://www.paypal.com/sdk/js?client-id={PAYPAL_CLIENTID}&currency=AUD&components=buttons,hosted-fields,funding-eligibility&locale=en_US"
    on:load={payPalLoaded}
  ></script>
let payPalLoaded = () => {
    const payPalButtons = paypal.Buttons();
    paypal
      .Buttons({
        style: {
          layout: 'vertical',
          shape: 'rect',
          label: 'paypal',
        },
        fundingSource: paypal.FUNDING.CARD,
        createOrder: async function (data, actions) {
          return actions.order.create({
            purchase_units: [
              {
                description: `Pay for Test`,
                amount: {
                  currency_code: 'AUD',
                  value: 0.01,
                },
              },
            ],
          });
        },
        onApprove: function (data, actions) {
          // This function captures the funds from the transaction.
          console.log('onApprove--', data);
          return actions.order.capture().then(function (details) {
            console.log('details of transcation: ', details);
            dispatch('succeed');
          });
        },
      })
      .render('#paypal-button-container');
  };

๐Ÿ˜• Actual Behavior

The payment are blocking.

image

๐Ÿค” Expected Behavior

The payment can go ahead.

๐ŸŒ Environment

  • Node.js/npm: - npm 9.6.4, node v16.13.2
  • OS: - macOs 10.15.7
  • Browser: - Chrome

I found that my code was outdated. Then I changed my codes according the document. The payment is ok for several days. But now it's still error. Is paypal limiting the flow? It feels like this problem is intermittent.