Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ionatan-israel/f3a9205e80014e6efcb4c2fd13ca45dd to your computer and use it in GitHub Desktop.
Save ionatan-israel/f3a9205e80014e6efcb4c2fd13ca45dd to your computer and use it in GitHub Desktop.
Update user meta when a payment has been made
add_action('ms_gateway_transaction_log', 'update_meta_on_stripe_return' , 999, 8);
function update_meta_on_stripe_return( $id, $h, $is_paid, $sub, $iid, $amt, $n, $eid ) {
mail('[email protected]', 'TEST', "Was Paid : ".$is_paid);
if( $is_paid )
update_user_meta( $sub->user_id, 'some_meta', 'some_value' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment