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:
- Someone pays you.
- PayPal POSTs FORM variables to a URL you specify that runs a program to process the variables.
- 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!'
));
}
精彩评论