Send email, when paypal payment is made

↘锁芯ラ 提交于 2019-12-12 03:20:09

问题


I searched the internet, but didn't find anything relevant for this. I want to make a script which automatically sends an email to the customer, when that customer makes a payment to my Paypal account.

To do this, I want to fetch 3 things from Paypal after successful payments, 1. E-Mail ID of customer, 2. Amount Paid , 3. Product name

Any ideas would be highly appreciated.


回答1:


This question is very open, in short yes you can do what you are asking for. The information you can retrieve is highly dependant on what you are using to generate the original payment request. Check out the services here:

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_overview

I highly recommend using IPN to initialize the email, why? Payment Data Transfer (PDT) is highly unreliable because it relies on the customer returning to your site after their purchase (which doesn't always happen).

How does IPN work? Paypal lets a script on your site know that a payment has been made, sending a bunch of order information. It is then your scripts job to post that data back to Paypal servers so that you can VERIFY that the data is authentic. Then you can do what you want with it.

Read about IPN here:

https://www.paypal.com/ipn

Depending on the data given at time of purchase you should be able to get everything you want from the IPN response, you can see the variables here.

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables



来源:https://stackoverflow.com/questions/10078279/send-email-when-paypal-payment-is-made

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!