paypal / paypal-js

Loading wrapper and TypeScript types for the PayPal JS SDK
Apache License 2.0
238 stars 83 forks source link

[Bug] Getting 500 Unhandled api error in cartid API for subscriptions #546

Closed shash61 closed 3 months ago

shash61 commented 3 months ago

Library used

react-paypal-js

Environment

Sandbox

🐞 On click of Paypal button, subscription is created, but cartId API is failing.

I have integrated with react-paypal-js and when i click on the button, subscription is created. But react-paypal internally calls cartId API just after subscription creation and it gives 500 status code. The error returned by cartId API looks like this. { "ack": "error", "message": "Unhandled api error", "meta": { "calc": "f835959a4e741", "rlog": "rZJvnqaaQhLn%2FnmWT8cSUueWscmrtUHe5Y1Bd%2FeqyvyOTq66rSXAciiXRg7dClMl1o2iporwJbYz7mI0k8X%2B5rx9VK7gkS6f_190ed8d14e7" }, "server": "p7AeaSvo5k6iOFKfqv3PYWqIYw7rNyNzts3hTHzKG8q1fD8L_Itt5G3qvxW_8Y6At7-SKpmWE9aeI5Sag3o899-8E5Sv365tysCbJmOz4YPAotHmjPwfZFmeZqRzXC1U8Hh_Q1YB7L-GVz_b4f2atBvn1qVqB52Poe6viPV9FlrLcOBGtberTWA41cTCe4ggu3uOYtf9GuK0qriCCDqt2Q0ZBA0KbvHhLDcMgc5LJFGyAOiDY0z-9KyX4NdLhm8UP_ae95bbCA_SkVKntEtPgBhcgWcHoqVwMVWS7hCu07QqelZCtYiLLG" } This error came a week before too, but automatically got resolved on its own. This would be a problem for us to take it live while not knowing when and how this error occurs.

🔬 Minimal Reproduction

  1. click on paypal button
  2. subscription is created successfully
  3. cartid API is called, popup closes automatically giving 500 status code.

😕 Actual Behavior

  1. clicking on paypal subscription button, subscription is created successfully, cartid API fails, popup closes.

🤔 Expected Behavior

  1. clicking on paypal subscription button, user should be able to pay and activate their subscription on paypal.

🌍 Environment

➕ Additional Context

Screenshot 2024-07-26 at 11 28 07 AM
shash61 commented 3 months ago

@wsbrunson can you please take a look at this, we couldn't move forward with this on Production as we don't know when this error occurs.

yongjieYuan commented 3 months ago

The same, I test subscription in sandbox after switched another account, it still has problem but checkout payment works well.

omer8888 commented 3 months ago

im getting the same, yesterday it worked, any idea what have change?

orshemtov commented 3 months ago

Im getting the same error, also yesterday worked

Error: Api: /smart/api/billagmt/subscriptions/I-XXXXXXXXXXXX/cartid returned status code: 500 (Corr ID: f7...)

omer8888 commented 3 months ago

i tweeted about it here, follow me to keep contact with similar issues big mess, i spent 5h tring figur out whats changed anyone have solution? https://x.com/omer_naim/status/1816811987445358612

wsbrunson commented 3 months ago

hi all, can anyone attach a Correlation ID of the failed call? you should see it in the response headers as PayPal-Correlation-Id

ItsJustTomDev commented 3 months ago

hi all, can anyone attach a Correlation ID of the failed call? you should see it in the response headers as PayPal-Correlation-Id

Paypal-Debug-Id: f12373139ba59

Couldnt find "PayPal-Correlation-Id" in the headers but I found this one, also in the response there is a "meta" object with "calc" field which value is: f780042cf159b

url: https://www.sandbox.paypal.com/smart/api/billagmt/subscriptions/I-7NYEK3A0CN5L/cartid

acouette commented 3 months ago

@wsbrunson : Same here, no PayPal-Correlation-Id but I have Paypal-Debug-Id: f303630395a85

URL: https://www.sandbox.paypal.com/smart/api/billagmt/subscriptions/I-YNXPEUXE5K98/cartid

rohit-splashmath commented 3 months ago

@wsbrunson

Paypal-Debug-Id: f872515447000

Request URL: https://www.sandbox.paypal.com/smart/api/billagmt/subscriptions/I-GLW1F9FML66E/cartid

wsbrunson commented 3 months ago

I'm going to create an internal bug ticket and get our API team involved. I'll keep you updated on the status.

thank you all for your reports

LuisBizocial commented 3 months ago

@wsbrunson

The same thing is happening to me.

When i click on the button, subscription is created. But paypal internally calls cartId API just after subscription creation and it gives 500 status code.

Paypal Event Log:

Date and time | 7/26/24, 6:36 AM Request path | /v1/billing/subscriptions Status | 201 Debug ID | f98901529688e Issue | N/A Description | N/A Resource ID | N/A

RESPONSE: { "status": "APPROVAL_PENDING", "id": "I-TR8D3FTAN7A3", "create_time": "2024-07-26T13:36:37Z", "links": [ { "href": "https://www.sandbox.paypal.com/webapps/billing/subscriptions?ba_token=BA-03L76365M2689225H", "rel": "approve", "method": "GET" }, { "href": "https://www.sandbox.paypal.com/v1/billing/subscriptions/I-TR8D3FTAN7A3", "rel": "edit", "method": "PATCH" }, { "href": "https://www.sandbox.paypal.com/v1/billing/subscriptions/I-TR8D3FTAN7A3", "rel": "self", "method": "GET" } ] }

Front-end response error: Api: /smart/api/billagmt/subscriptions/I-5U8F9YLEUSDA/cartid returned status code: 500 (Corr ID: f662736d2ef56)

{"ack":"error","message":"Unhandled api error","meta":{"calc":"f662736d2ef56","rlog":"rZJvnqaaQhLn%2FnmWT8cSUueWscmrtUHe5Y1Bd%2FeqyvyOTq66rSXAciiXRg7dClMl1o2iporwJbYz7mI0k8X%2B5rx9VK7gkS6f_190ef5a4540"},"server":"V8og602EktmL2jyVzChynMt0OergCaehedIMs3db1HvMCkqFkTMVyZFQgKAzcAiosmALt36yhWu8jdDz7hJJAnUVWP-f9yge-C59yF81g8_VvJjd70boBO88uDkhTAfs_Ir7hYUU-sqFE9jZysPvGHrUAtafHEWLTyTJSCa-qU4qYPfp55CUTpg5-FAsOi69GXCI0nHIaF1ywmzgvvTu4USEGS877uoiIQs5h-6pIDDK1IBGp_QZENLIVNWStmckXZmgKzIuxP4gzXvqixOB3fSsJFQWgJBW1bXmQTIqc3xJ13B0Wuop6G"}

LuisGerar321 commented 3 months ago

I have the same problem

bella-booking commented 3 months ago

I have the same problem

Spencer1119 commented 3 months ago

I would start my beta today. I'm having the same error. Window launches, fails, closes. Screenshot 2024-07-26 at 12 41 29 PM

ConnectaCleaner commented 3 months ago

I am dealing with the same error.

Gera-The-Sniper commented 3 months ago

I'm dealing with the same issue, hope it gets fixed soon

MoonLightx03 commented 3 months ago

The same error, I test subscription in sandbox with javascript SDK

ravishekhar commented 3 months ago

Thanks everyone for your patience. This has been fixed now.

omer8888 commented 3 months ago

Thank you!

LuisGerar321 commented 3 months ago

Thanks!