Skip to content

Hook to execute an action on form completion, salesforce, and read only questions. Follow up with Amanda (111884) #6148

Discussion options

You must be logged in to vote

I would probably suggest the give_insert_payment hook for custom code after a donation is created.

See give/includes/payments/functions.php

/**
 * Fires while inserting payments.
 *
 * @since 1.0
 *
 * @param int   $payment_id   The payment ID.
 * @param array $payment_data Arguments passed.
 */
do_action( 'give_insert_payment', $payment->ID, $payment_data );

As for programmatically creating donations, I would suggest the give_insert_payment( $paymentData ) function. There is not a provided REST API Endpoint for creating a payment, but the function is public access.

$paymentData = [
  //
];
give_insert_payment( $paymentData );

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kjohnson
Comment options

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