You are here

function hook_stripe_metadata in Stripe 7

Add metadata to a StripeObject.

Modules implementing this hook should inspect $object to make sure it is of the correct type (to avoid adding metadata to a Customer instead of a Subscription Plan, for example).

Parameters

string $type: The type of object being saved or created.

array $values: Key-value pairs of metadata values to add to our object.

Return value

$metadata

File

./stripe.api.php, line 49
Describe hooks provided by the Stripe module.

Code

function hook_stripe_metadata($type, $values) {
  $metadata = array();
  if ($type == 'customer') {
    $metadata['Customer Field'] = $values['custom_field1'];
  }
  return $metadata;
}