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

Fixes for ach bank import - Stripe

This commit is contained in:
David Bomba 2022-03-16 09:31:35 +11:00
parent e035a75cc3
commit f0ec25a606
3 changed files with 6 additions and 5 deletions

View File

@ -380,7 +380,7 @@ class UserController extends BaseController
*/
public function update(UpdateUserRequest $request, User $user)
{
$old_company_user = $user->company_user();
$old_company_user = $user->company_user;
$old_user = json_encode($user);
$old_user_email = $user->getOriginal('email');
@ -398,8 +398,8 @@ class UserController extends BaseController
if(
strcasecmp($old_company_user->permissions, $user->company_user()->permissions) != 0 ||
$old_company_user->is_admin != $user->company_user()->is_admin
strcasecmp($old_company_user->permissions, $user->company_user->permissions) != 0 ||
$old_company_user->is_admin != $user->company_user->is_admin
){
$user->company_user()->update(["permissions_updated_at" => now()]);
}

View File

@ -21,6 +21,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
/**
@ -189,7 +190,7 @@ class BaseModel extends Model
public function numberFormatter()
{
$number = strlen($this->number) > 1 ? $this->number : class_basename($this);
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5); ;
$formatted_number = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $number);
// Remove any runs of periods (thanks falstro!)

View File

@ -107,7 +107,7 @@ class UpdatePaymentMethods
$additional_data = ['gateway_customer_reference' => $customer->id];
if($customer->default_source === $method->id)
$additional_data = ['gateway_customer_reference' => $customer->id, 'is_default', 1];
$additional_data = ['gateway_customer_reference' => $customer->id, 'is_default' => 1];
$this->stripe->storeGatewayToken($data, $additional_data);