Customer Data
Reading Customer Data from Stripe
You can read all the Stripe Customer data for the logged in member with this call.
$currentData = klub()->provider()->customer();
Updating Customer at Stripe
Updating the data stored in Stripe is straight forward as well.
$currentData = klub()->provider()->updateCustomer([
'phone' => '(01) 234 567 89'
]);
This might be more secure than storing data within the CMS, but since it will always require a roundtrip to Stripe, it will slow down your code noticeably (100ms or so).
Storing Metadata at Stripe
In addition to the fields required by Stripe's business logic such as name
, address
, email
you can also write data to a generic array field called metadata
.
$currentData = klub()->provider()->updateCustomer([
'metadata' => [
'wishlist' => $wishlist,
],
]);