Hook: mam_stripe_get_stripe_info

Signature

$info = apply_filters( 'mam_stripe_get_stripe_info', array $data_array, int $user_id );

mam-stripe-manager implements this filter (priority 10, two arguments). It is the sanctioned way for sibling plugins to ask “can this user pay with their saved card, and with what?” without touching Stripe user meta directly. MAM WooCommerce Ride Share, for example, uses it when building its phone data.

Parameter Type Description
$data_array array The array to augment (pass your existing payload, or array()).
$user_id int The WordPress user to look up.

Keys set on the returned array

Key Type Meaning
stripe_customer_id string The user’s Stripe customer id (cus_…), or '' when none. Mode-specific user meta (_stripe_customer_id_test / _live) is preferred, with fallback to the legacy single key.
stripe_mode string 'test' or 'live' — follows the WooCommerce Stripe gateway’s testmode flag.
checkout_selected_payment_method string Saved-card display name, e.g. Visa ending in 4242. Only set when the user has both a customer id and a saved card — otherwise the key is removed from the array.
is_payment_valid string 'yes' when the user can be charged (customer + card present); otherwise the key is removed from the array.

Note the removal behavior: when the user is not payment-ready, checkout_selected_payment_method and is_payment_valid are unset (not set to 'no'), so check with empty().


Example — gate a flow on payment readiness

$stripe_info = apply_filters( 'mam_stripe_get_stripe_info', array(), $user_id );

if ( empty( $stripe_info['is_payment_valid'] ) ) {
    // user has no chargeable saved card - send them to card setup
    return;
}

$card_label  = $stripe_info['checkout_selected_payment_method']; // "Visa ending in 4242"
$customer_id = $stripe_info['stripe_customer_id'];               // cus_...
$mode        = $stripe_info['stripe_mode'];                      // 'test' | 'live'


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!