Action Hook pmpro_subscription_payment_completed
-
Hello, I’m using the action hook pmpro_subscription_payment_completed but unfortunately I get 2 issues and I hope to fix it…
1) It seems not work with recurring payments.
In the recurring payments, Paypal (by IPN) send: txn_type=recurring_payment_profile_created”
In the file … wp-content/plugins/paid-memberships-pro/services/ipnhandler.php at LINE 61 it’s written:"PayPal Express - we will get txn_type express_checkout, or recurring_payment_profile_created, or ..."So, it seems to work with recurring payments but I cannot find such rule/action about recurring_payment_profile_created, I think that this is why it doesn’t work. Could you confirm please?
Is there an hook to run down IPN recurring payment confirmation?2) Mail is sent before Hook.
I’m using the hook to Update user meta. The only MAIL seeded to user after payment is the INVOICE MAIL, I’m adding info about the User Meta updated by the Hook to inform the user after payment. Unfortunately it does not work fine as it send the data BEFORE the hook update.In the LINE 798 of the file: wp-content/plugins/paid-memberships-pro/services/ipnhandler.php there is the code:
//email the user their invoice $pmproemail = new PMProEmail(); $pmproemail->sendInvoiceEmail( get_userdata( $last_order->user_id ), $morder ); //hook for successful subscription payments do_action( "pmpro_subscription_payment_completed", $morder );It seems that the Hook is placed AFTER the INVOICE MAIL.
Could you confirm please ? Can you place the hook before? Is there a way to send to users the userdata updated?Many thanks. Best Regards
The topic ‘Action Hook pmpro_subscription_payment_completed’ is closed to new replies.