Hooks

Stripe

14 hooks fired by Stripe: 12 filters and 2 actions across 14 call sites.

14 hooks fired by Stripe: 12 filters and 2 actions across 14 call sites. 13 of the 14 call sites are described by a docblock, at the call or on the constant that names the hook; the rest are listed with their signature and call sites only. Paths are relative to the plugin directory.

xpac_forms_stripe_allow_legacy_intent

Filter · 3 arguments · 1 call site

Filters the short migration escape hatch for intents created by an older release without form/instance metadata. It is disabled by default and can never accept an intent older than one recovery window, so the cross-form legacy replay gap is not permanent.

apply_filters( 'xpac_forms_stripe_allow_legacy_intent', false, $intent, $submission )
  • $allow (bool) — Whether to allow this legacy intent.
  • $intent (object) — Stripe PaymentIntent.
  • $submission (Submission) — Current submission.

Fired from:

  • packages/Stripe/Addon.php:4683

xpac_forms_stripe_client

Filter · 1 argument · 1 call site

Filters the Stripe client. Primarily useful for an installation-wide proxy and for deterministic integration tests.

apply_filters( 'xpac_forms_stripe_client', $client )
  • $client (object) — Stripe client.

Fired from:

  • packages/Stripe/Addon.php:1053

xpac_forms_stripe_create_rate_limit

Filter · 2 arguments · 1 call site

Filters the PaymentIntent creation limit for one IP and form per hour.

apply_filters( 'xpac_forms_stripe_create_rate_limit', self::CREATE_RATE_LIMIT, $formId )
  • $limit (int) — Default 20, clamped to 1–100.
  • $formId (int) — Current form id.

Fired from:

  • packages/Stripe/Addon.php:2299

xpac_forms_stripe_currency

Filter · 1 argument · 1 call site

Filters the currency Stripe charges in.

Everything was hardcoded to USD, so a site anywhere else was billing its visitors in dollars whatever its prices said.

apply_filters( 'xpac_forms_stripe_currency', $currency )
  • $currency (string) — Lowercase three-letter ISO code.

Fired from:

  • packages/Stripe/Addon.php:4123

xpac_forms_stripe_intent_description

Filter · 3 arguments · 1 call site

Filters the description shown against a payment in Stripe.

Stripe caps a PaymentIntent description at 1000 characters; a longer string is truncated here rather than refused by the API. Return an empty string to send no description at all.

apply_filters( 'xpac_forms_stripe_intent_description', $default, $formId, $attributes )
  • $description (string) — Description.
  • $formId (int) — Form the payment belongs to.
  • $attributes (array) — Published block attributes.

Fired from:

  • packages/Stripe/Addon.php:3815

xpac_forms_stripe_intent_metadata

Filter · 3 arguments · 1 call site

Filters the descriptive metadata written onto a new PaymentIntent.

The keys this add-on verifies against later — xpac_site, xpac_price_rule, xpac_form_id, xpac_instance, xpac_rule_hash, xpac_currency — are merged over whatever comes back, so they cannot be removed or changed here. Stripe caps metadata at 50 keys, 40 characters per key and 500 per value; anything longer is truncated rather than refused.

apply_filters( 'xpac_forms_stripe_intent_metadata', $metadata, $formId, $attributes )
  • $metadata (array<string, string>) — Descriptive metadata.
  • $formId (int) — Form the payment belongs to.
  • $attributes (array) — Published block attributes.

Fired from:

  • packages/Stripe/Addon.php:3770

xpac_forms_stripe_payload_ttl

Filter · 1 argument · 1 call site

Filters how long a pre-payment field snapshot may exist. Values are capped at one day because this duplicates personal submission data solely for a short webhook recovery window.

apply_filters( 'xpac_forms_stripe_payload_ttl', self::PAYLOAD_TTL )
  • $seconds (int) — Default one day.

Fired from:

  • packages/Stripe/Addon.php:1126

xpac_forms_stripe_payment_method_types

Filter · 3 arguments · 1 call site

Filters the payment method types offered for one payment.

Defaults to the block's own list, and to ['card'] when it has none. Anything Stripe accepts for a PaymentIntent may be named here, but a method that settles asynchronously (sepa_debit, bacs_debit, boleto, konbini, us_bank_account) can confirm days after the submission's recovery snapshot has expired, and the visitor's answers are then gone. The payment still succeeds and still appears in the orphan notice; only the entry cannot be rebuilt.

apply_filters( 'xpac_forms_stripe_payment_method_types', is_array($configured) ? $configured : ['card'], $formId, $attributes )
  • $types (string[]) — Payment method types.
  • $formId (int) — Form the payment belongs to.
  • $attributes (array) — Published block attributes.

Fired from:

  • packages/Stripe/Addon.php:3711

xpac_forms_stripe_payment_settled

Action · 3 arguments · 1 call site

Fires when Stripe reports a refund or a dispute for a stored entry.

The ledger and the entry have already been updated. Listeners that have to undo something a successful payment started — a licence, a booking, a delivery to another service — belong here.

do_action( 'xpac_forms_stripe_payment_settled', $entryId, $intentId, $record )
  • $entryId (int) — Entry the payment paid for.
  • $intentId (string) — Stripe PaymentIntent id.
  • $record (array) — Ledger row, including its refund/dispute keys.

Fired from:

  • packages/Stripe/Addon.php:2869

xpac_forms_stripe_statement_descriptor_suffix

Filter · 3 arguments · 1 call site

Filters the card statement descriptor suffix.

Empty by default, which sends no suffix and leaves the account's own descriptor alone. What comes back is stripped of the characters Stripe forbids (< > \ ' ") and cut to Stripe's 22-character limit; a value left with no letter in it is dropped, because Stripe refuses a descriptor that is only digits or punctuation.

apply_filters( 'xpac_forms_stripe_statement_descriptor_suffix', '', $formId, $attributes )
  • $suffix (string) — Statement descriptor suffix.
  • $formId (int) — Form the payment belongs to.
  • $attributes (array) — Published block attributes.

Fired from:

  • packages/Stripe/Addon.php:3853

xpac_forms_stripe_sync_entry_metadata

Filter · 3 arguments · 1 call site

Filters whether the stored entry id is written back to Stripe.

On by default: it is the only thing that turns a payment in the Stripe dashboard back into the submission it paid for, which is what a chargeback response needs. It costs one deferred API call per payment; return false to skip it.

apply_filters( 'xpac_forms_stripe_sync_entry_metadata', true, $intentId, $entryId )
  • $sync (bool) — Whether to write the entry id back.
  • $intentId (string) — Stripe PaymentIntent id.
  • $entryId (int) — Stored entry id.

Fired from:

  • packages/Stripe/Addon.php:3231

xpac_forms_stripe_webhook

Action · 3 arguments · 1 call site

Fires for a verified Stripe webhook event belonging to this site.

The signature has been checked against the stored signing secret and the intent's xpac_site marker matches, so the event is genuine and ours. Fires for every event type the endpoint is subscribed to.

do_action( 'xpac_forms_stripe_webhook', (string) $event->type, $object, $event )
  • $type (string) — Stripe event type, e.g. payment_intent.succeeded.
  • $object (object) — The event's data object.
  • $event (object) — The full Stripe event.

Fired from:

  • packages/Stripe/Addon.php:2391

xpac_forms_stripe_webhook_ledger_max

Filter · 1 argument · 1 call site

Filters how many payments the webhook ledger keeps.

The ledger lives in one autoload-off option, which is why it is bounded at all: it is read and rewritten whole under a lock on every webhook delivery, so a very large bound turns each delivery into a large read, a large unserialize and a large write. A busy site that needs a longer reconciliation history is better served by raising this a little and reconciling more often than by raising it a lot.

apply_filters( 'xpac_forms_stripe_webhook_ledger_max', self::WEBHOOK_MAX )
  • $max (int) — Maximum records kept.

Fired from:

  • packages/Stripe/Addon.php:2680

xpac_forms_submission_validation

Filter · 2 arguments · 1 call site

apply_filters( 'xpac_forms_submission_validation', ['success' => true, 'errors' => []], $submission )

Fired from:

  • packages/Stripe/Addon.php:1331

On this page