Hook: mam_stripe_connect_transfer

Signature

$paid = apply_filters( 'mam_stripe_connect_transfer', array $args ); // returns bool

mam-stripe-manager implements this filter (priority 10, one argument). Note the asymmetric shape: the input is an array, the return value is a bool. The main caller in the suite is MAM WooCommerce Product Vendors’ commission manager, which applies it once per vendor when an order’s commissions are paid out.

Trust boundary: this filter moves real money to a vendor’s Stripe account. Apply it only from trusted server-side code (order-completion / commission hooks) with amounts derived from commission records — never with request-supplied data. The built-in guards are defense in depth, not caller authorization.

Input keys

Key Type Required Meaning
order_id int yes The WooCommerce order the commission belongs to.
vendor_id int yes The Product Vendors term id of the vendor being paid.
amount float yes Commission amount in decimal currency units (or smallest units — see next row). <= 0 returns true (nothing to transfer is a success in commission flows).
amount_is_cents bool no Truthy means amount is already in the smallest currency unit (integer cents).
currency string no Explicit currency; defaults to the order’s own currency (zero-decimal aware conversion).

Returns

true — transfer created, or safely skipped (duplicate of an already-recorded transfer, or zero amount).
false — refused or failed; the reason is logged on the stripe_connect_transfer debug channel and, for exceptions, kept in the service’s last_error.

Guards (all deny-by-default)

  1. WooCommerce active, order exists.
  2. amount may not exceed the order total.
  3. The vendor must have products on the order — overridable via mam_stripe_transfer_vendor_on_order (see Hooks: Stripe security filters).
  4. The vendor must have an acct_… Connect account id and be stripe_approved.
  5. Idempotency: each vendor/order/amount/currency combination transfers at most once; the used keys live in _mam_stripe_transfer_keys order meta.

Side effects on success

  • Stripe Transfer created (transfer_group = order_{id}, source_transaction = the order’s charge when known, metadata wp_order_id + vendor_id).
  • Order meta updated: _mam_stripe_transfer_ids, _mam_stripe_transfer_keys, _mam_stripe_transfer_ids_by_vendor, and a full record in _mam_stripe_transfers (with payout_id/paid_at left empty for the payout webhook to fill — see Recipe: Payout flow and reconciliation).
  • The “Stripe – Seller Transfer Completed” notification is sent to the vendor’s admin users.

Example — pay one vendor’s commission on order completion

$paid = apply_filters( 'mam_stripe_connect_transfer', array(
    'order_id'  => $order->get_id(),
    'vendor_id' => $vendor_term_id,
    'amount'    => round( (float) $commission_amount, 2 ),
) );

if ( ! $paid ) {
    // leave the commission unpaid and surface it for retry;
    // the stripe_connect_transfer debug channel has the reason
}

  • Recipe: Payout flow and reconciliation
  • Hooks: Stripe security filters
  • Hook: mam_pmt_charge_card

Metadata

Field Value
Article type Hook Reference
Plugin slug mam-stripe-manager
Applies to plugin version 26.19.1+
Category Extending MAM Suite
Hook type filter (implemented by this plugin; applied by callers)
Audience PHP developer
Last verified 2026-06-10
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!