Description

The wpforms_stripe_process_complete filter fires when Stripe payment is processed on form submit.

Parameters

$fields
(array) Sanitized entry field values/properties.
$form_data
(array) Processed form settings/data, prepared to be used later.
$payment_id
(int) Entry id.
$payment
(object) Stripe Payment/Charge object.
$subscription
(object) Stripe Subscription object.
$customer
(object) Stripe Customer object.

Source

wpforms/wpforms-stripe/src/Process.php

More Information

The wpforms_stripe_process_complete action will process as the form is submitted. It can be used to pass through information to Stripe.

Examples

/**
 * Fires when Stripe payment is processed on form submit.
 *
 * @link  https://wpforms.com/developers/wpforms_stripe_process_complete/
 *
 * @param array  $fields         Sanitized entry field values/properties.
 * @param array  $form_data      Form data and settings.
 * @param int    $payment_id     Payment ID.
 * @param object $payment        Stripe Payment/Charge object.
 * @param object $subscription   Stripe Subscription object.
 * @param object $customer       Stripe Customer object.
*/

function wpf_stripe_single_payment_custom_metadata( $fields, $form_data, $payment_id, $payment, $subscription, $customer ) {
    if ( ! ( $payment instanceof \WPForms\Vendor\Stripe\PaymentIntent ) && ! ( $payment instanceof \WPForms\Vendor\Stripe\Charge ) ) {
        return;
    }

    // Run code
    // See the related snippet below for more examples.

}
add_action( 'wpforms_stripe_process_complete', 'wpf_stripe_single_payment_custom_metadata', 10, 6 );

Article Reference: How To Send Metadata to Stripe Payments