Skip to content

Donation matching custom code issue #6151

Discussion options

You must be logged in to vote

Hey @awatts200!

Hmm, I see what you're going for here. You know what you might try doing is to use give_insert_payment instead of just instantiating a new Give_Payment and attempting to save that. The reason is because that functions does more than just create the payment.

Since this code would fire inside of a give_insert_payment hook, you'd need to, inside the create_matching_donation() function, remove the hook before calling the function and adding it back. Otherwise you'll get stuck in a recursive infinite loop. So something like:

remove_action('give_insert_payment, [$this, 'handle_submission'], 20);
give_insert_payment($args);
add_action( 'give_insert_payment', [ $this, 'handle_subm…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JasonTheAdams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants