Search the Community
Showing results for tags 'module paypal payments gateway'.
-
Hi all, I'm writing a utility module to send basic payments to PayPal and then to validate the IPN response that PayPal returns. The module is a simple wrapper around their Website Payments Standard api. You can view the module here: https://gist.github.com/4493175 When you initiate a payment the customer is redirected to PayPal where they complete the transaction, and then returned to the "thank you" page as set in the module settings. PayPal sends a copy of the transaction and its status (authorised|cancelled|refund etc) to a specified listener. Once your site receives this copy, you validate its authenticity by sending it back to PayPal who confirm that they sent it to you. So far so good. The problem I am having is adding a hook to the method that processes a successful payment validation from another module. I'm trying to use this code to hook the method but having no luck: /** * Initialise the module * */ public function init() { // Add a hook after to update member role and expiry date $this->addHookAfter('PaymentGatewayPayPal::processIpn', $this, 'processPayment'); } /** * Process the successful payment * */ public function processPayment($payment) { mail($myEmailAddress, "Test payment processing", "This ran"); } Can anyone suggest where my hook might be going wrong? I'm also keen on any general tips on how the module could be made more robust before I release it. Best regards, Stephen