Created
November 26, 2020 07:37
-
-
Save dryan1144/539dc155768c3ac36e895466cbd76d73 to your computer and use it in GitHub Desktop.
EDD callback for payment status updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** | |
Actions after purchase status is changed - useful for check payments | |
***/ | |
function drw_edd_after_check_purchase( $payment_id, $new_status, $old_status ) { | |
//bail if the order isn't approved | |
if ( !in_array($new_status, array('publish', 'complete')) ) { | |
return; | |
} | |
$payment = new EDD_Payment( $payment_id ); | |
$user_id = $payment->user_id; | |
//Do something with payment data | |
drw_update_data($user_id, $payment); | |
} | |
add_action( 'edd_update_payment_status', 'drw_edd_after_check_purchase', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment