SWAuk / website

Student Windsurfing Association website
www.swa.co.uk
5 stars 3 forks source link

Add customer to stripe output #264

Open ghost opened 2 years ago

ghost commented 2 years ago

Since the most recent update to Stripe, customer name doesnt appear on payments dashboard, it showed as an email address on old stripe, and appears as a name for google pay and apple pay but not normal card transactions, images shown below

Old Stripe

Screenshot 2022-02-20 at 19 24 49

Current Stripe

Screenshot 2022-02-20 at 19 28 06
olindenbaum commented 12 months ago
olindenbaum commented 12 months ago
$stripeClient = create me;
$obj = $stripeClient->customers->search([
  'query' => "metadata['swa_user_id']:'8346;",
]);

$custId = $obj->data[0];

##add to intent if exists else

$custObj = $stripeClient->customers->create([
  'email' => 'email',
  'metadata' => {
    'swa_user_id'=> 'swa id',
    'joom_user_id'=> 'joomla id',
  }
]);

$custId = $custObj->id;