Description
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.
- $entry_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 $entry_id Entry ID. Will return 0 if entry storage is disabled or using WPForms Lite. * @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, $entry_id, $payment, $subscription, $customer ) { if ( ! ( $payment instanceof \Stripe\PaymentIntent ) && ! ( $payment instanceof \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 );
Related
Tutorial Reference: How To Send Metadata to Stripe Payments