开发者

Automaticly send email after Paypal transaction

I need help on making a digital delivery system for my website.

  • Buyer clicks a paypal buy now button
  • Buyer completes paypal transaction
  • Buyer is redirected to a page on my website, and an email is sent to their paypal email address from me.

How should I go about doing this any info woul开发者_开发知识库d be very helpful.

Thank you


You are looking for PayPal's Instant Payment Notification.

Instant Payment Notification consists of three parts:

  1. Someone pays you.
  2. PayPal POSTs FORM variables to a URL you specify that runs a program to process the variables.
  3. You validate the notification.

The above is quoted from PayPal's HTML Form Basics for Website Payments Standard. Obviously, step 3 is where you will send an email to your customer.

To learn more about IPN, here is an in-depth explanation of PayPal's IPN Guide.
To learn more about the Buy Now buttons, check out Single-Item Payments - Buy Now Buttons.


Hint: use this in your afterPaypalNotification callback in your AppController.php

function afterPaypalNotification($txnId)
{
ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->email(array('id' => $txnId,
    'subject' => 'Thanks!',
    'message' => 'Thank you for the transaction!'
));  
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜