Last active
November 27, 2020 19:45
-
-
Save dryan1144/8a5f23e82f74b47f567aa5eea1abf9f7 to your computer and use it in GitHub Desktop.
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 | |
/*** | |
Do something with payment data after purchase | |
***/ | |
function drw_api_call_after_purchase( $payment_id ) { | |
$payment_meta = edd_get_payment_meta( $payment_id ); | |
$cart_items = edd_get_payment_meta_cart_details( $payment_id ); | |
$user_id = $payment_meta['user_info']['id']; | |
foreach ( $cart_items as $download ) { | |
//make API call | |
drw_update_email_api( $user_id, $download['id'] ); | |
} | |
} | |
add_action( 'edd_complete_purchase', 'drw_enroll_after_purchase' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment