mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for verify phone
This commit is contained in:
parent
c0870afded
commit
97e65570fc
@ -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)
|
public function getString($data, $field)
|
||||||
{
|
{
|
||||||
return isset($data[$field]) && $data[$field] ? trim($data[$field]) : '';
|
return isset($data[$field]) && $data[$field] ? trim($data[$field]) : '';
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
namespace App\Import\Transformers\Bank;
|
namespace App\Import\Transformers\Bank;
|
||||||
|
|
||||||
use App\Import\ImportException;
|
use App\Import\ImportException;
|
||||||
use App\Import\Transformers\BaseTransformer;
|
use App\Import\Transformer\BaseTransformer;
|
||||||
use App\Models\BankTransaction;
|
use App\Models\BankTransaction;
|
||||||
use App\Utils\Number;
|
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',
|
'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_id' => $this->getNumber($transaction, 'bank.category_id') > 0 ? $this->getNumber($transaction, 'bank.category_id') : null,
|
||||||
'category_type' => $this->getString($transaction, 'category_type'),
|
'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'),
|
: now()->format('Y-m-d'),
|
||||||
'bank_account_id' => array_key_exists('bank_account_id', $transaction) ? $transaction['bank_account_id'] : 0,
|
'bank_account_id' => array_key_exists('bank_account_id', $transaction) ? $transaction['bank_account_id'] : 0,
|
||||||
'description' => array_key_exists('description', $transaction)? $transaction['description'] : '',
|
'description' => array_key_exists('description', $transaction)? $transaction['description'] : '',
|
||||||
|
@ -53,7 +53,7 @@ class VerifyPhone implements ShouldQueue
|
|||||||
if(!$sid)
|
if(!$sid)
|
||||||
return; // no twilio api credentials provided, bail.
|
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();
|
$country = $this->user->account?->companies()?->first()?->country();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user