Track customer info via paypal buttons?

Diiijiital
New Community Member

I am setting up paypal buttons for purchasing services on my website. The services have different options for each service. These options and the customer details get saved into a database for referencing. Once the customer completes the purchase via a paypal button, it should redirect them back to my website to show them a confirmation message, but the page they land on should also update the database to reflect that they have completed the purchase, or that they have canceled the purchase.

Is it possible to send paypal the customer information, then have paypal send that customer information back to the webpage that it redirects the customer to using paypal buttons? Ideally not smart buttons just normal paypal buttons.

Login to Me Too
2 REPLIES 2

angelleye
Advisor
Advisor

I would suggest that you do use the smart buttons, as they provide a much better overall experience for the buyer.

 

I would also suggest saving all of the data you need to an invoice/order record in your system, and then use the `invoice_id` parameter in your `CreateOrder` request to PayPal to include this order ID in the PayPal transaction details.

 

When you return back to your site you can hit `GetOrder` (or use a local session with that same order ID) to obtain the order ID again and query that data from your DB so it's available on your return page.

 

Another thing you might want to consider is using Webhooks.  This way you can update your database regardless of whether the user makes it back to the return URL, which may not always be the case.

 

 

 

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

MTS_Chiranjeevi
Moderator
Moderator

Good day @Diiijiital,

 

Thank you for posting to the PayPal community.

 

Yes, you can able to achieve this requirement using the payment notifications service. 

I request to please contact your website developer or the support of your third party platform eCommerce to refer below guide links to implement payment notification service. 

 

           Guide link - https://developer.paypal.com/api/nvp-soap/ipn/ 

 

  • If your website is built via REST API integration(Smart buttons), please use Webhooks event notification to get the payment notifications.

             Guide link - https://developer.paypal.com/api/rest/webhooks/ 

 

PayPal system is a payment gateway, which will receive the payment request values(i.e customer name, amount, currency details etc.) from merchant websites(third party platform eCommerce) and process the payment accordingly.


Merchants can retrieve the transaction payload from the PayPal notification service and update their internal database. 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

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

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.