CRITICAL: Paypal smart button onApprove suddenly not working

kunzhao1985
Contributor
Contributor

Hi, 

I have a Paypal smart button and the onApprove javascript callback suddenly stopped to work since about an hour ago. I was testing the subscription function of the website and the callback was working quite well before. It seems that there are some changes on the payment complete window. Previously the payment window automatically closes after finish. But now it is showing a complete page with a big complete tick and I need to manually close it.  Below is my code which was working well in the last few days (the alert message could show up before now the msg doesn't show up anymore)

 

paypal.Buttons({
 
fundingSource: paypal.FUNDING.CARD,
 
style: {
layout: 'vertical',
size: 'responsive',
height:40
},

createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'XYZ'
});
},

onApprove: function(data, actions) {
alert('You have successfully created subscription ' + data.subscriptionID);
// ...some more codes to send msg to server side
}
Login to Me Too
20 REPLIES 20

theErockonian
Contributor
Contributor

I know it's been a while but did anyone figure this out? I am unable to get the popup window to close in the "onApprove" function. Also, did anyone notice that the PayPalButtons are quite buggy? It's worth noting I am in sandbox and haven't tested in production. A couple examples:

 

1. Sometimes, not always, I get a "No subscription id" error, when there is a subscription plan id passed. If you refresh the page, the error fixes itself, but doesn't leave me confident it won't arise again.

 

2. For some reason, sometimes it auto selects "Ukraine" as the country. Most of the time it selects "United States" but not always. Not sure if it has something to do with the war going on or what.

 

The whole "it sometimes happens" is very worrisome to me as I need it to work at least close to 100% of the time, not like 85%. Any insight on this is greatly appreciated. I might just have to go to stripe lol.

Login to Me Too

yiusay
Contributor
Contributor

I recommend contacting the PayPal developer team from "Contact Us" in  https://www.paypal-support.com/s/?language=en_US

 

Once you let them know the problem, they should be able to figure it out. Maybe they don't even know this is happening. They might not reply right away, but they should get back to you eventually in my experience.

Login to Me Too

theErockonian
Contributor
Contributor

Hi yiusay,

 

Thanks for the reply. While my experience with PayPal support has been positive, they usually take about 48 hours to respond. Reading some of the previous replies, there seems to be some serious "flakiness" going on for the testing, which again, is worrisome (I don't want my payment integration to just go down randomly without code changes). I'm worried it'll face issues and I can't fix it for 2 days.

 

I do appreciate the response.

Login to Me Too

kunzhao1985
Contributor
Contributor

Hi guys,

 

Regarding this issue, I did not get any solution from Paypal. This problem only occurs in sandbox. Eventually I used the production environment for testing (set a low amount plan and use real credit card). It is sad that we don't have any response from Paypal. It is important that the sandbox should work exactly the same as production (otherwise why we need a sandbox? it is wasting time to use the sandbox...) I have switched to Stripe for the new version of my website. Hope this helps!

Login to Me Too

Inadot
Contributor
Contributor

Is there any update on this? The issue is now occurring in production as well. The issue arrises when the black overlay is clicked. It happens every time. This is a very critical bug. We rely on the "onApprove" method getting called. This is impacting our sales. How can we get this red flagged to be fixed asap. 

 

Thank you!

Login to Me Too

StubbedToe
Contributor
Contributor
Hi all, did PayPal ever provide a solution to the onApprove callback not coming back when the payment box does not automatically close? It is September 2023 and this problem has just started happening to a new subscription "smart" button, and I see this has been an issue for 2 years. PayPal can you please provide feedback regarding this issue? Thanks.
Login to Me Too

sparklingcookie
Contributor
Contributor

Hello, I also have this issue since today. All of a sudden, onApprove method is not getting triggered at all. I have contacted support and get back to you if I hear from them. It happens both in sandbox and production. I had to disable paypal payments as it caused us some problems.

Login to Me Too

NinoPrince
Contributor
Contributor

Same, it is a nightmare, sudenly onApprouve is not triggered ... no explanation

Login to Me Too

ionbit
Contributor
Contributor

Also having this issue. Customers not receiving the entitlements.
And I would understand if webhooks were reliable and not taking minutes or hours to trigger!
Critical!

Login to Me Too

StubbedToe
Contributor
Contributor

Hi All, 

not sure if this is what fixed the problem or not, BUT, I clicked into "Developer", clicked on "Subscription", clicked on "Live" (from Sandbox), clicked "Next: Add Sandbox Credentials", went through the process and added API Credentials to "Activation_App", basically just kept clicking next, there are 4 steps and finished off with a page stating "API Credentials - REST API apps - Activivation_App".  Anyway, mine is working.  Not sure for how long though.  I'll keep you posted if it stops again.  Best of luck with it. 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.