• Resolved jdowns1

    (@jdowns1)


    What hook do I need to use to capture and modify the donation amount before it is saved or sent to Stripe?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPCharitable

    (@wpcharitable)

    Hi @jdowns1

    This depends on your purposes on why you are changing the donation. I believe the filter you may want to look into is the charitable_donation_form_submission_values filter located in the public function get_donation_values() function in charitable/includes/forms/class-charitable-donation-form.php.

    As a developer you’ll need to log the output and check the context of the connecting functions and code to confirm, but you might find this useful. Here’s the filter I’m referring to. Hope this helps!

    /**
     * Filter the submitted donation form values, before any processing happens.
     *
     * @since 1.0.0
     *
     * @param array                    $values    The structured submitted values.
     * @param array                    $submitted The raw submitted values (i.e. $_POST).
     * @param Charitable_Donation_Form $form      This instance of Charitable_Donation_Form.
     */
    return apply_filters( 'charitable_donation_form_submission_values', $values, $submitted, $this );
    Plugin Author WPCharitable

    (@wpcharitable)

    I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

    Thread Starter jdowns1

    (@jdowns1)

    Thanks for your guidance. For others, I was able to accomplish this by using the charitable_donation_form_amount filter.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Modify Donation Amount When Received’ is closed to new replies.