Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stripeExCreateCustomer($iDriverId) {
- global $generalobj, $obj;
- $result = array();
- $sql = "select vName,vLastName,vPhone,vEmail from register_driver where iDriverId = ".$iDriverId;
- $data = $obj->MysqlSelect($sql);
- $name = ucfirst(strtolower($data[0]['vName']." ".$data[0]['vLastName']));
- $phone = $data[0]['vPhone'];
- $email = $data[0]['vEmail'];
- $customerObj = array(
- 'phone' => $phone,
- 'email' => $email,
- 'description' => "Created by Carsmartt server",
- 'name' => $name
- );
- // Create a stripe customer
- try {
- $customer = \Stripe\Customer::create($customerObj);
- $details = json_decode($customer);
- $result = json_decode($customer);
- //$result = get_object_vars($details);
- file_put_contents('!debug.txt',print_r($result,true));
- return $result;
- } catch (Exception $e) {
- return "Error: ".$e;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement