Advertisement
Zgragselus

Untitled

Jul 29th, 2023
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. function handle_customer($db, $stripe, $customer)
  2. {
  3.     $cust = $stripe->customers->retrieve($customer->id, []);
  4.  
  5.     $db->Query("BEGIN TRANSACTION;");
  6.  
  7.     $record = new StripeCustomer($db);
  8.     $record->customer_id = $cust->id;
  9.     $result = $record->Read();
  10.  
  11.     if ($result == null || count($result) == 0)
  12.     {
  13.         handle_customer_created($db, $cust);
  14.     }
  15.     else
  16.     {
  17.         handle_customer_update($db, $cust);
  18.     }
  19.  
  20.     $db->Query("COMMIT;");
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement