Merge pull request #7890 from turbo124/v5-develop

Fixes for Stripe
This commit is contained in:
David Bomba 2022-10-25 19:47:25 +11:00 committed by GitHub
commit 384b5b43d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 36 deletions

View File

@ -86,7 +86,7 @@ class CreateAccount
$sp794f3f->hosted_company_count = config('ninja.quotas.free.max_companies'); $sp794f3f->hosted_company_count = config('ninja.quotas.free.max_companies');
$sp794f3f->account_sms_verified = true; $sp794f3f->account_sms_verified = true;
if(in_array($this->getDomain($this->request['email']), ['yopmail.com','gmail.com', 'hotmail.com', 'outlook.com', 'yahoo.com', 'aol.com', 'mail.ru'])){ if(in_array($this->getDomain($this->request['email']), ['givmail.com','yopmail.com','gmail.com', 'hotmail.com', 'outlook.com', 'yahoo.com', 'aol.com', 'mail.ru'])){
$sp794f3f->account_sms_verified = false; $sp794f3f->account_sms_verified = false;
} }

View File

@ -213,13 +213,7 @@ class CreateEntityPdf implements ShouldQueue
if ($pdf) { if ($pdf) {
try { try {
// if (! Storage::disk($this->disk)->exists($path)) { Storage::disk($this->disk)->put($file_path, $pdf);
// Storage::disk($this->disk)->makeDirectory($path, 0775);
// }
Storage::disk($this->disk)->put($file_path, $pdf, 'public');
//r2 Storage::disk($this->disk)->put($file_path, $pdf);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new FilePermissionsFailure($e->getMessage()); throw new FilePermissionsFailure($e->getMessage());
} }

View File

@ -17,11 +17,13 @@ use App\Libraries\MultiDB;
use App\Mail\User\UserNotificationMailer; use App\Mail\User\UserNotificationMailer;
use App\Models\Company; use App\Models\Company;
use App\Models\User; use App\Models\User;
use App\Utils\Ninja;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use stdClass; use stdClass;
@ -54,11 +56,14 @@ class UserEmailChanged implements ShouldQueue
public function handle() public function handle()
{ {
nlog('notifying user of email change');
//Set DB //Set DB
MultiDB::setDb($this->company->db); MultiDB::setDb($this->company->db);
App::forgetInstance('translator');
$t = app('translator');
$t->replace(Ninja::transformTranslations($this->company->settings));
App::setLocale($this->company->getLocale());
/*Build the object*/ /*Build the object*/
$mail_obj = new stdClass; $mail_obj = new stdClass;
$mail_obj->subject = ctrans('texts.email_address_changed'); $mail_obj->subject = ctrans('texts.email_address_changed');

View File

@ -167,7 +167,7 @@ class UploadFile implements ShouldQueue
$previewHeight = $height * Document::DOCUMENT_PREVIEW_SIZE / $width; $previewHeight = $height * Document::DOCUMENT_PREVIEW_SIZE / $width;
} else { } else {
$previewHeight = Document::DOCUMENT_PREVIEW_SIZE; $previewHeight = Document::DOCUMENT_PREVIEW_SIZE;
$previewWidth = $width * DOCUMENT_PREVIEW_SIZE / $height; $previewWidth = $width * Document::DOCUMENT_PREVIEW_SIZE / $height;
} }
$img->resize($previewWidth, $previewHeight); $img->resize($previewWidth, $previewHeight);

View File

@ -99,20 +99,11 @@ class CreatePurchaseOrderPdf implements ShouldQueue
if ($pdf) { if ($pdf) {
try{ try{
Storage::disk($this->disk)->put($this->file_path, $pdf);
// if(!Storage::disk($this->disk)->exists($this->path))
// Storage::disk($this->disk)->makeDirectory($this->path, 0775);
Storage::disk($this->disk)->put($this->file_path, $pdf, 'public');
//r2 Storage::disk($this->disk)->put($this->file_path, $pdf);
} }
catch(\Exception $e) catch(\Exception $e)
{ {
throw new FilePermissionsFailure($e->getMessage()); throw new FilePermissionsFailure($e->getMessage());
} }
} }
@ -211,7 +202,6 @@ class CreatePurchaseOrderPdf implements ShouldQueue
if($numbered_pdf) if($numbered_pdf)
$pdf = $numbered_pdf; $pdf = $numbered_pdf;
} }

View File

@ -105,13 +105,7 @@ class GenerateDeliveryNote
info($maker->getCompiledHTML()); info($maker->getCompiledHTML());
} }
// if (! Storage::disk($this->disk)->exists($this->invoice->client->invoice_filepath($invitation))) { Storage::disk($this->disk)->put($file_path, $pdf);
// Storage::disk($this->disk)->makeDirectory($this->invoice->client->invoice_filepath($invitation), 0775);
// }
Storage::disk($this->disk)->put($file_path, $pdf, 'public');
//r2 Storage::disk($this->disk)->put($file_path, $pdf);
return $file_path; return $file_path;
} }

View File

@ -81,14 +81,14 @@ return [
'r2' => [ 'r2' => [
'driver' => 's3', 'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'), 'key' => env('R2_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('R2_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'), 'region' => env('R2_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'), 'bucket' => env('R2_BUCKET'),
'url' => env('AWS_URL'), 'url' => env('R2_URL'),
'visibility' => 'private', 'visibility' => 'private',
'endpoint' => env('AWS_ENDPOINT'), 'endpoint' => env('R2_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 'use_path_style_endpoint' => env('R2_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false, 'throw' => false,
], ],