You are here

function hook_stripe_customer_info in Stripe 7

Provide new properties to save to a Customer based on a Drupal user.

Parameters

object $account: The account of the user whose Stripe Customer was created or updated.

array $params: Extra parameters not available via $account.

Return value

array Properties that wil be stored on the customer object.

1 function implements hook_stripe_customer_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

stripe_customer_stripe_customer_info in stripe_customer/stripe_customer.module
Implements hook_stripe_customer().
1 invocation of hook_stripe_customer_info()
_stripe_customer_create in stripe_customer/stripe_customer.module
Create a new customer object on Stripe's servers for a Drupal account.

File

stripe_customer/stripe_customer.api.php, line 19
API documentation for the Stripe Customer module.

Code

function hook_stripe_customer_info($account, $params) {
  $properties = [];
  $properties['business_vat_id'] = $account->business_vat_id;
  $properties['metadata']['Total spent'] = $account->total_spent;

  // Extra parameters not available via user_load(), for instance
  // when creating a new Customer, we might want to include the
  // user's token to \Customer:create();
  $properties['source'] = $params['stripe_token'];
  return $properties;
}