Skip to content

Commit

Permalink
Fixes issue #122
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelopez committed Aug 8, 2020
1 parent afaae4e commit b363d30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function createCustomer($email, $stripeId, $testMode = true)
$customerRecord = new CustomerRecord();
$customerRecord->email = $email;
$customerRecord->stripeId = $stripeId;
$customerRecord->testMode = $testMode;
$customerRecord->testMode = filter_var($testMode, FILTER_VALIDATE_BOOLEAN);
$customerRecord->save(false);

return $customerRecord;
Expand Down Expand Up @@ -106,6 +106,7 @@ public function getStripeInvoice($id)
*/
public function registerCustomer(Customer $customer, $testMode)
{
$testMode = filter_var($testMode, FILTER_VALIDATE_BOOLEAN);
$customerRecord = CustomerRecord::findOne([
'email' => $customer['email'],
'testMode' => $testMode
Expand All @@ -124,6 +125,7 @@ public function registerCustomer(Customer $customer, $testMode)
*/
public function getCustomerByEmail($customerEmail, $testMode)
{
$testMode = filter_var($testMode, FILTER_VALIDATE_BOOLEAN);
$customerRecord = CustomerRecord::findOne([
'email' => $customerEmail,
'testMode' => $testMode
Expand Down
1 change: 1 addition & 0 deletions src/services/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ private function hasZeroDecimals($currency)
private function getCustomer($order, $token, &$isNew, $testMode = true)
{
$stripeCustomer = null;
$testMode = filter_var($testMode, FILTER_VALIDATE_BOOLEAN);
// Check if customer exists
$customerRecord = CustomerRecord::findOne([
'email' => $order->email,
Expand Down

0 comments on commit b363d30

Please sign in to comment.