Showing results for 
Search instead for 
Did you mean: 

Add Payment Buttons; integrating with PHP

Posted on

I intend to sell a digital product so need to be able to verify that a payment has been completed; AFAIK, this is not possible using javascript code, but if there's a way I've missed, I'm happy to try it. 

As it is, I think I need to use the Add Payment buttons technique described here,  but with some server-side code to allow me to write order details to my own MySQL database which I can then use to generate the digital content for the customer. The basic buttons work fine with my sandbox, with the payments happening OK (though they only seem to be in US dollars, despite me specifying currency=GBP!!). When I change the createOrder: function() line to use the server side PHP code (as detailed at, the code fails. The buttons still render, but when I click on one, the popup window appears then immediately disappears without letting me make the payment. 

I've spent hours staring at this and just can't get it to work - what am I missing please?




Add Payment Buttons; integrating with PHP

PayPal Employee

Hi @clum2,


Thank you for contacting PayPal community.


Our sincere apologies for the inconvenience caused.


You can get the transaction details(customer details, payment details etc) by implementing event/payment notifications.


The PayPal REST APIs can use webhooks for event notification.


The NVP/SOAP APIs can use the Instant Payment Notification (IPN) and Payment Data Transfer (PDT) services for event notification.


Please refer the guide link for reference.


I request to follow the below steps to create PayPal hosted html button code via your PayPal Business account and add it to your website.

Login >> click on "All tools" >> Integrate PayPal >> PayPal buttons >> select button type >> fill required details >> copy and paste the HTML button code in your third party platform website.


Login >> go to direct link "" >> follow the above steps.


Also, you can implement PayPal Smart Button integration.


Thank you for understanding and patience.




PayPal, Inc.


If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution

Add Payment Buttons; integrating with PHP


Hi Chiranjeevi, 

Thanks for your response. I've spent more time on this, and had it working, using the solution I found here. Unfortunately, as well as PayPal, my app needs to use the Debit or Credit card option enabled by the smart buttons and I can't see how to get to that stage. 

The linked method works by making an IPN call to a page in my app which then does some backend processing that I need. This proves that my account IPN settings are working OK but when I use the smart buttons option, no such call is made to my IPN script. Is there a way to do this with smart buttons? I assumed it would take the setting for Notification URL at but this doesn't seem to be the case. 

thanks and best regards!

Haven't Found your Answer?

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