function stripe_customer_get_id in Stripe 7
Retrieve a Stripe customer_id for a user, if available.
File
- stripe_customer/
stripe_customer.module, line 283 - Provides integration with Stripe and Drupal Users as Customers.
Code
function stripe_customer_get_id($account) {
if (is_numeric($account)) {
$account = user_load($account);
}
$livemode = stripe_customer_livemode();
$customer_id = db_query("SELECT customer_id FROM {stripe_customers} WHERE uid = :uid AND livemode = :livemode AND status <> :inactive", array(
':uid' => $account->uid,
':livemode' => $livemode,
':inactive' => STRIPE_CUSTOMER_INACTIVE,
))
->fetchField();
return !empty($customer_id) ? $customer_id : FALSE;
}