1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Fixes for verify phone

This commit is contained in:
David Bomba 2022-11-03 17:01:58 +11:00
parent c0870afded
commit 97e65570fc
3 changed files with 8 additions and 3 deletions

View File

@ -68,6 +68,11 @@ class BaseTransformer
}
public function getNumber($data, $field)
{
return (isset($data->$field) && $data->$field) ? (int)$data->$field : 0;
}
public function getString($data, $field)
{
return isset($data[$field]) && $data[$field] ? trim($data[$field]) : '';

View File

@ -12,7 +12,7 @@
namespace App\Import\Transformers\Bank;
use App\Import\ImportException;
use App\Import\Transformers\BaseTransformer;
use App\Import\Transformer\BaseTransformer;
use App\Models\BankTransaction;
use App\Utils\Number;
@ -38,7 +38,7 @@ class BankTransformer extends BaseTransformer
'account_type' => strlen($this->getString($transaction, 'bank.account_type')) > 1 ? $this->getString($transaction, 'bank.account_type') : 'bank',
'category_id' => $this->getNumber($transaction, 'bank.category_id') > 0 ? $this->getNumber($transaction, 'bank.category_id') : null,
'category_type' => $this->getString($transaction, 'category_type'),
'date' => array_key_exists('date', $transaction) ? date('Y-m-d', strtotime(str_replace("/","-",$transaction['date'])))
'date' => array_key_exists('date', $transaction) ? $this->parseDate($transaction['date'])
: now()->format('Y-m-d'),
'bank_account_id' => array_key_exists('bank_account_id', $transaction) ? $transaction['bank_account_id'] : 0,
'description' => array_key_exists('description', $transaction)? $transaction['description'] : '',

View File

@ -53,7 +53,7 @@ class VerifyPhone implements ShouldQueue
if(!$sid)
return; // no twilio api credentials provided, bail.
$twilio = new Twilio\Rest\Client($sid, $token);
$twilio = new \Twilio\Rest\Client($sid, $token);
$country = $this->user->account?->companies()?->first()?->country();