Merge pull request #7812 from turbo124/v5-develop

v5.5.22
This commit is contained in:
David Bomba 2022-09-15 19:55:02 +10:00 committed by GitHub
commit 3d58f5652e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 436 additions and 181 deletions

View File

@ -1 +1 @@
5.5.21 5.5.22

View File

@ -20,6 +20,7 @@ use App\Models\Client;
use App\Models\ClientContact; use App\Models\ClientContact;
use App\Models\Company; use App\Models\Company;
use App\Models\CompanyLedger; use App\Models\CompanyLedger;
use App\Models\CompanyUser;
use App\Models\Contact; use App\Models\Contact;
use App\Models\Credit; use App\Models\Credit;
use App\Models\CreditInvitation; use App\Models\CreditInvitation;

View File

@ -26,6 +26,7 @@ class CompanySettings extends BaseSettings
public $auto_archive_invoice = false; // @implemented public $auto_archive_invoice = false; // @implemented
public $qr_iban = ''; //@implemented public $qr_iban = ''; //@implemented
public $besr_id = ''; //@implemented public $besr_id = ''; //@implemented
public $lock_invoices = 'off'; //off,when_sent,when_paid //@implemented public $lock_invoices = 'off'; //off,when_sent,when_paid //@implemented

View File

@ -44,6 +44,10 @@ class RecurringExpenseToExpenseFactory
$expense->payment_date = $recurring_expense->payment_date; $expense->payment_date = $recurring_expense->payment_date;
$expense->amount = $recurring_expense->amount; $expense->amount = $recurring_expense->amount;
$expense->foreign_amount = $recurring_expense->foreign_amount ?: 0; $expense->foreign_amount = $recurring_expense->foreign_amount ?: 0;
//11-09-2022 - we should be tracking the recurring expense!!
$expense->recurring_expense_id = $recurring_expense->id;
// $expense->private_notes = $recurring_expense->private_notes; // $expense->private_notes = $recurring_expense->private_notes;
// $expense->public_notes = $recurring_expense->public_notes; // $expense->public_notes = $recurring_expense->public_notes;

View File

@ -104,16 +104,29 @@ class SwissQrGenerator
// Add payment reference // Add payment reference
// This is what you will need to identify incoming payments. // This is what you will need to identify incoming payments.
$referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
$this->company->present()->besr_id() ?: '', // You receive this number from your bank (BESR-ID). Unless your bank is PostFinance, in that case use NULL.
$this->invoice->number// A number to match the payment with your internal data, e.g. an invoice number
);
$qrBill->setPaymentReference( if(strlen($this->company->present()->besr_id()) > 1)
QrBill\DataGroup\Element\PaymentReference::create( {
QrBill\DataGroup\Element\PaymentReference::TYPE_QR, $referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
$referenceNumber $this->company->present()->besr_id() ?: '', // You receive this number from your bank (BESR-ID). Unless your bank is PostFinance, in that case use NULL.
)); $this->invoice->number// A number to match the payment with your internal data, e.g. an invoice number
);
$qrBill->setPaymentReference(
QrBill\DataGroup\Element\PaymentReference::create(
QrBill\DataGroup\Element\PaymentReference::TYPE_QR,
$referenceNumber
));
}
else{
$qrBill->setPaymentReference(
QrBill\DataGroup\Element\PaymentReference::create(
QrBill\DataGroup\Element\PaymentReference::TYPE_NON
));
}
// Optionally, add some human-readable information about what the bill is for. // Optionally, add some human-readable information about what the bill is for.
$qrBill->setAdditionalInformation( $qrBill->setAdditionalInformation(
@ -141,6 +154,8 @@ class SwissQrGenerator
nlog($violation); nlog($violation);
} }
nlog($e->getMessage());
return ''; return '';
// return $e->getMessage(); // return $e->getMessage();
} }

View File

@ -131,8 +131,10 @@ class EmailController extends BaseController
if(Ninja::isHosted() && !$entity_obj->company->account->account_sms_verified) if(Ninja::isHosted() && !$entity_obj->company->account->account_sms_verified)
return response(['message' => 'Please verify your account to send emails.'], 400); return response(['message' => 'Please verify your account to send emails.'], 400);
if($entity == 'purchaseOrder' || $entity == 'purchase_order' || $template == 'purchase_order'){ nlog($entity);
return $this->sendPurchaseOrder($entity_obj, $data);
if($entity == 'purchaseOrder' || $entity == 'purchase_order' || $template == 'purchase_order' || $entity == 'App\Models\PurchaseOrder'){
return $this->sendPurchaseOrder($entity_obj, $data, $template);
} }
$entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template) { $entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template) {
@ -183,13 +185,15 @@ class EmailController extends BaseController
return $this->itemResponse($entity_obj->fresh()); return $this->itemResponse($entity_obj->fresh());
} }
private function sendPurchaseOrder($entity_obj, $data) private function sendPurchaseOrder($entity_obj, $data, $template)
{ {
$this->entity_type = PurchaseOrder::class; $this->entity_type = PurchaseOrder::class;
$this->entity_transformer = PurchaseOrderTransformer::class; $this->entity_transformer = PurchaseOrderTransformer::class;
$data['template'] = $template;
PurchaseOrderEmail::dispatch($entity_obj, $entity_obj->company, $data); PurchaseOrderEmail::dispatch($entity_obj, $entity_obj->company, $data);
return $this->itemResponse($entity_obj); return $this->itemResponse($entity_obj);

View File

@ -292,7 +292,7 @@ class PreviewPurchaseOrderController extends BaseController
{ {
LightLogs::create(new LivePreview()) LightLogs::create(new LivePreview())
->increment() ->increment()
->queue(); ->batch();
} }

View File

@ -14,6 +14,7 @@ namespace App\Http\Livewire;
use App\Libraries\MultiDB; use App\Libraries\MultiDB;
use App\Models\ClientContact; use App\Models\ClientContact;
use App\Models\CompanyGateway;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Livewire\Component; use Livewire\Component;
@ -105,6 +106,8 @@ class RequiredClientInfo extends Component
public $company; public $company;
public $company_gateway_id;
public function mount() public function mount()
{ {
MultiDB::setDb($this->company->db); MultiDB::setDb($this->company->db);
@ -141,6 +144,8 @@ class RequiredClientInfo extends Component
'client_postal_code' => $this->contact->client->postal_code, 'client_postal_code' => $this->contact->client->postal_code,
]); ]);
//if stripe is enabled, we want to update the customer at this point.
return true; return true;
} }
@ -150,6 +155,7 @@ class RequiredClientInfo extends Component
private function updateClientDetails(array $data): bool private function updateClientDetails(array $data): bool
{ {
nlog($this->company->id);
$client = []; $client = [];
$contact = []; $contact = [];
@ -172,6 +178,16 @@ class RequiredClientInfo extends Component
->push(); ->push();
if ($contact_update && $client_update) { if ($contact_update && $client_update) {
$cg = CompanyGateway::find($this->company_gateway_id);
if($cg && $cg->update_details){
$payment_gateway = $cg->driver($this->client)->init();
if(method_exists($payment_gateway, "updateCustomer"))
$payment_gateway->updateCustomer();
}
return true; return true;
} }

View File

@ -62,7 +62,7 @@ class StoreInvoiceRequest extends Request
$rules['invitations.*.client_contact_id'] = 'distinct'; $rules['invitations.*.client_contact_id'] = 'distinct';
$rules['number'] = ['nullable', Rule::unique('invoices')->where('company_id', auth()->user()->company()->id)]; $rules['number'] = ['bail', 'nullable', Rule::unique('invoices')->where('company_id', auth()->user()->company()->id)];
$rules['project_id'] = ['bail', 'sometimes', new ValidProjectForClient($this->all())]; $rules['project_id'] = ['bail', 'sometimes', new ValidProjectForClient($this->all())];
$rules['is_amount_discount'] = ['boolean']; $rules['is_amount_discount'] = ['boolean'];

View File

@ -26,6 +26,7 @@ class BlackListRule implements Rule
'arxxwalls.com', 'arxxwalls.com',
'superhostforumla.com', 'superhostforumla.com',
'wnpop.com', 'wnpop.com',
'dataservices.space',
]; ];
/** /**

View File

@ -173,18 +173,18 @@ class BaseImport
$is_free_hosted_client = $this->company->account->isFreeHostedClient(); $is_free_hosted_client = $this->company->account->isFreeHostedClient();
$hosted_client_count = $this->company->account->hosted_client_count; $hosted_client_count = $this->company->account->hosted_client_count;
if($this->factory_name == 'App\Factory\ClientFactory' && $is_free_hosted_client && (count($data) > $hosted_client_count))
{
$this->error_array[$entity_type][] = [
$entity_type => 'client',
'error' => 'Error, you are attempting to import more clients than your plan allows',
];
return $count;
}
foreach ($data as $key => $record) { foreach ($data as $key => $record) {
if($this->factory_name instanceof ClientFactory && $is_free_hosted_client && ($this->company->clients()->count() > $hosted_client_count))
{
$this->error_array[$entity_type][] = [
$entity_type => $record,
'error' => 'Client limit reached',
];
return $count;
}
try { try {
$entity = $this->transformer->transform($record); $entity = $this->transformer->transform($record);
// $validator = $this->request_name::runFormRequest($entity); // $validator = $this->request_name::runFormRequest($entity);

View File

@ -23,6 +23,7 @@ use App\Models\Activity;
use App\Models\Company; use App\Models\Company;
use App\Models\CreditInvitation; use App\Models\CreditInvitation;
use App\Models\InvoiceInvitation; use App\Models\InvoiceInvitation;
use App\Models\PurchaseOrderInvitation;
use App\Models\QuoteInvitation; use App\Models\QuoteInvitation;
use App\Models\RecurringInvoiceInvitation; use App\Models\RecurringInvoiceInvitation;
use App\Utils\HtmlEngine; use App\Utils\HtmlEngine;
@ -77,12 +78,12 @@ class EmailEntity implements ShouldQueue
$this->invitation = $invitation; $this->invitation = $invitation;
$this->settings = $invitation->contact->client->getMergedSettings();
$this->entity_string = $this->resolveEntityString(); $this->entity_string = $this->resolveEntityString();
$this->entity = $invitation->{$this->entity_string}; $this->entity = $invitation->{$this->entity_string};
$this->settings = $invitation->contact->client->getMergedSettings();
$this->reminder_template = $reminder_template ?: $this->entity->calculateTemplate($this->entity_string); $this->reminder_template = $reminder_template ?: $this->entity->calculateTemplate($this->entity_string);
$this->html_engine = new HtmlEngine($invitation); $this->html_engine = new HtmlEngine($invitation);

View File

@ -77,7 +77,12 @@ class PurchaseOrderEmail implements ShouldQueue
/* Mark entity sent */ /* Mark entity sent */
$invitation->purchase_order->service()->markSent()->save(); $invitation->purchase_order->service()->markSent()->save();
$email_builder = (new PurchaseOrderEmailEngine($invitation, 'purchase_order', $this->template_data))->build(); if(is_array($this->template_data) && array_key_exists('template', $this->template_data))
$template = $this->template_data['template'];
else
$template = 'purchase_order';
$email_builder = (new PurchaseOrderEmailEngine($invitation, $template, $this->template_data))->build();
$nmo = new NinjaMailerObject; $nmo = new NinjaMailerObject;
$nmo->mailable = new VendorTemplateEmail($email_builder, $invitation->contact, $invitation); $nmo->mailable = new VendorTemplateEmail($email_builder, $invitation->contact, $invitation);
@ -86,7 +91,7 @@ class PurchaseOrderEmail implements ShouldQueue
$nmo->to_user = $invitation->contact; $nmo->to_user = $invitation->contact;
$nmo->entity_string = 'purchase_order'; $nmo->entity_string = 'purchase_order';
$nmo->invitation = $invitation; $nmo->invitation = $invitation;
$nmo->reminder_template = 'purchase_order'; $nmo->reminder_template = 'email_template_purchase_order';
$nmo->entity = $invitation->purchase_order; $nmo->entity = $invitation->purchase_order;
NinjaMailerJob::dispatch($nmo)->delay(5); NinjaMailerJob::dispatch($nmo)->delay(5);

View File

@ -329,6 +329,24 @@ class MultiDB
return false; return false;
} }
public static function findAndSetDbByInappTransactionId($transaction_id) :bool
{
$current_db = config('database.default');
foreach (self::$dbs as $db) {
if (Account::on($db)->where('inapp_transaction_id', $transaction_id)->exists()) {
self::setDb($db);
return true;
}
}
self::setDB($current_db);
return false;
}
public static function findAndSetDbByContactKey($contact_key) :bool public static function findAndSetDbByContactKey($contact_key) :bool
{ {
$current_db = config('database.default'); $current_db = config('database.default');

View File

@ -0,0 +1,58 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Listeners\Subscription;
use App\Libraries\MultiDB;
use App\Models\Account;
use Illuminate\Contracts\Queue\ShouldQueue;
use Imdhemy\Purchases\Events\AppStore\DidRenew;
class AppStoreRenewSubscription implements ShouldQueue
{
/**
* Create the event listener.
*
* @param ActivityRepository $activity_repo
*/
public function __construct()
{
}
/**
* Handle the event.
*
* @param object $event
* @return void
*/
public function handle(DidRenew $event)
{
$inapp_transaction_id = $event->getSubscriptionId(); //$subscription_id
MultiDB::findAndSetDbByInappTransactionId($inapp_transaction_id);
$account = Account::where('inapp_transaction_id', $inapp_transaction_id)->first();
if($account->plan_term == 'month')
$account->plan_expires = now()->addMonth();
elseif($account->plan_term == 'year')
$account->plan_expires = now()->addYear();
$account->save();
// $server_notification = $event->getServerNotification();
// $subscription = $event->getSubscription();
// $subscription_identifier = $event->getSubscriptionIdentifier();
}
}

View File

@ -8,6 +8,7 @@ use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use LimitIterator; use LimitIterator;
use SplFileObject; use SplFileObject;
use Illuminate\Support\Carbon;
class SupportMessageSent extends Mailable class SupportMessageSent extends Mailable
{ {
@ -72,8 +73,8 @@ class SupportMessageSent extends Mailable
$plan_status = ''; $plan_status = '';
if(Carbon::parse($account->plan_expires)->lt(now())) if($account->plan_expires && Carbon::parse($account->plan_expires)->lt(now()))
$plan_status = 'Plan Expired'; $plan_status = 'Plan Expired :: ';
if (Ninja::isHosted()) { if (Ninja::isHosted()) {
$subject = "{$priority}Hosted-{$db}-{$is_large}{$platform}{$migrated}{$trial} :: {$plan} :: {$plan_status} ".date('M jS, g:ia'); $subject = "{$priority}Hosted-{$db}-{$is_large}{$platform}{$migrated}{$trial} :: {$plan} :: {$plan_status} ".date('M jS, g:ia');

View File

@ -613,19 +613,19 @@ class Client extends BaseModel implements HasLocalePreference
{ {
$defaults = []; $defaults = [];
if (! (array_key_exists('terms', $data) && strlen($data['terms']) > 1)) { if (! (array_key_exists('terms', $data) && is_string($data['terms']) && strlen($data['terms']) > 1)) {
$defaults['terms'] = $this->getSetting($entity_name.'_terms'); $defaults['terms'] = $this->getSetting($entity_name.'_terms');
} elseif (array_key_exists('terms', $data)) { } elseif (array_key_exists('terms', $data)) {
$defaults['terms'] = $data['terms']; $defaults['terms'] = $data['terms'];
} }
if (! (array_key_exists('footer', $data) && strlen($data['footer']) > 1)) { if (! (array_key_exists('footer', $data) && is_string($data['footer']) && strlen($data['footer']) > 1)) {
$defaults['footer'] = $this->getSetting($entity_name.'_footer'); $defaults['footer'] = $this->getSetting($entity_name.'_footer');
} elseif (array_key_exists('footer', $data)) { } elseif (array_key_exists('footer', $data)) {
$defaults['footer'] = $data['footer']; $defaults['footer'] = $data['footer'];
} }
if (strlen($this->public_notes) >= 1) { if (is_string($this->public_notes) && strlen($this->public_notes) >= 1) {
$defaults['public_notes'] = $this->public_notes; $defaults['public_notes'] = $this->public_notes;
} }

View File

@ -70,6 +70,12 @@ class Webhook extends BaseModel
const EVENT_PROJECT_UPDATE = 26; const EVENT_PROJECT_UPDATE = 26;
const EVENT_CREATE_CREDIT = 27;
const EVENT_UPDATE_CREDIT = 28;
const EVENT_DELETE_CREDIT = 29;
public static $valid_events = [ public static $valid_events = [
self::EVENT_CREATE_CLIENT, self::EVENT_CREATE_CLIENT,
self::EVENT_CREATE_INVOICE, self::EVENT_CREATE_INVOICE,
@ -97,6 +103,9 @@ class Webhook extends BaseModel
self::EVENT_REMIND_INVOICE, self::EVENT_REMIND_INVOICE,
self::EVENT_PROJECT_CREATE, self::EVENT_PROJECT_CREATE,
self::EVENT_PROJECT_UPDATE, self::EVENT_PROJECT_UPDATE,
self::EVENT_CREATE_CREDIT,
self::EVENT_UPDATE_CREDIT,
self::EVENT_DELETE_CREDIT,
]; ];
protected $fillable = [ protected $fillable = [

View File

@ -27,6 +27,13 @@ class CreditObserver
*/ */
public function created(Credit $credit) public function created(Credit $credit)
{ {
$subscriptions = Webhook::where('company_id', $credit->company->id)
->where('event_id', Webhook::EVENT_CREATE_CREDIT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_CREATE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2));
}
} }
/** /**
@ -37,6 +44,13 @@ class CreditObserver
*/ */
public function updated(Credit $credit) public function updated(Credit $credit)
{ {
$subscriptions = Webhook::where('company_id', $credit->company->id)
->where('event_id', Webhook::EVENT_UPDATE_CREDIT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_UPDATE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2));
}
} }
/** /**
@ -47,6 +61,13 @@ class CreditObserver
*/ */
public function deleted(Credit $credit) public function deleted(Credit $credit)
{ {
$subscriptions = Webhook::where('company_id', $credit->company->id)
->where('event_id', Webhook::EVENT_DELETE_CREDIT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_DELETE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2));
}
} }
/** /**

View File

@ -34,6 +34,7 @@ use Checkout\CheckoutAuthorizationException;
use Checkout\CheckoutDefaultSdk; use Checkout\CheckoutDefaultSdk;
use Checkout\CheckoutFourSdk; use Checkout\CheckoutFourSdk;
use Checkout\Common\CustomerRequest; use Checkout\Common\CustomerRequest;
use Checkout\Customers\Four\CustomerRequest as FourCustomerRequest;
use Checkout\Environment; use Checkout\Environment;
use Checkout\Library\Exceptions\CheckoutHttpException; use Checkout\Library\Exceptions\CheckoutHttpException;
use Checkout\Models\Payments\IdSource; use Checkout\Models\Payments\IdSource;
@ -285,12 +286,31 @@ class CheckoutComPaymentDriver extends BaseDriver
$response = $this->gateway->getCustomersClient()->get($this->client->present()->email()); $response = $this->gateway->getCustomersClient()->get($this->client->present()->email());
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
$request = new CustomerRequest();
if ($this->is_four_api) {
$request = new FourCustomerRequest();
}
else{
$request = new CustomerRequest();
}
$request->email = $this->client->present()->email(); $request->email = $this->client->present()->email();
$request->name = $this->client->present()->name(); $request->name = $this->client->present()->name();
$request->phone = $this->client->present()->phone();
return $request; try {
$response = $this->gateway->getCustomersClient()->create($request);
} catch (CheckoutApiException $e) {
// API error
$error_details = $e->error_details;
$http_status_code = isset($e->http_metadata) ? $e->http_metadata->getStatusCode() : null;
} catch (CheckoutAuthorizationException $e) {
// Bad Invalid authorization
}
return $response;
} }
} }

View File

@ -17,11 +17,12 @@ use App\Jobs\Util\SystemLogger;
use App\Models\ClientGatewayToken; use App\Models\ClientGatewayToken;
use App\Models\GatewayType; use App\Models\GatewayType;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Payment;
use App\Models\PaymentHash; use App\Models\PaymentHash;
use App\Models\PaymentType; use App\Models\PaymentType;
use App\Models\SystemLog; use App\Models\SystemLog;
use App\PaymentDrivers\Stripe\ACH;
use App\PaymentDrivers\StripePaymentDriver; use App\PaymentDrivers\StripePaymentDriver;
use App\PaymentDrivers\Stripe\ACH;
use App\Utils\Ninja; use App\Utils\Ninja;
use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesHash;
use Stripe\Exception\ApiConnectionException; use Stripe\Exception\ApiConnectionException;
@ -137,8 +138,10 @@ class Charge
if ($cgt->gateway_type_id == GatewayType::SEPA) { if ($cgt->gateway_type_id == GatewayType::SEPA) {
$payment_method_type = PaymentType::SEPA; $payment_method_type = PaymentType::SEPA;
$status = Payment::STATUS_PENDING;
} else { } else {
$payment_method_type = $response->charges->data[0]->payment_method_details->card->brand; $payment_method_type = $response->charges->data[0]->payment_method_details->card->brand;
$status = Payment::STATUS_COMPLETED;
} }
$data = [ $data = [
@ -148,7 +151,7 @@ class Charge
'amount' => $amount, 'amount' => $amount,
]; ];
$payment = $this->stripe->createPayment($data); $payment = $this->stripe->createPayment($data, $status);
$payment->meta = $cgt->meta; $payment->meta = $cgt->meta;
$payment->save(); $payment->save();

View File

@ -58,12 +58,12 @@ class UpdateCustomer implements ShouldQueue
$company = Company::where('company_key', $this->company_key)->first(); $company = Company::where('company_key', $this->company_key)->first();
if($company->id !== config('ninja.ninja_default_company_id'))
return;
$company_gateway = CompanyGateway::find($this->company_gateway_id); $company_gateway = CompanyGateway::find($this->company_gateway_id);
$client = Client::withTrashed()->find($this->client_id); $client = Client::withTrashed()->find($this->client_id);
if(!$company_gateway->update_details)
return;
$stripe = $company_gateway->driver($client)->init(); $stripe = $company_gateway->driver($client)->init();
$customer = $stripe->findOrCreateCustomer(); $customer = $stripe->findOrCreateCustomer();

View File

@ -511,6 +511,36 @@ class StripePaymentDriver extends BaseDriver
} }
} }
public function updateCustomer()
{
if($this->client)
{
$customer = $this->findOrCreateCustomer();
//Else create a new record
$data['name'] = $this->client->present()->name();
$data['phone'] = substr($this->client->present()->phone(), 0, 20);
$data['address']['line1'] = $this->client->address1;
$data['address']['line2'] = $this->client->address2;
$data['address']['city'] = $this->client->city;
$data['address']['postal_code'] = $this->client->postal_code;
$data['address']['state'] = $this->client->state;
$data['address']['country'] = $this->client->country ? $this->client->country->iso_3166_2 : '';
$data['shipping']['name'] = $this->client->present()->name();
$data['shipping']['address']['line1'] = $this->client->shipping_address1;
$data['shipping']['address']['line2'] = $this->client->shipping_address2;
$data['shipping']['address']['city'] = $this->client->shipping_city;
$data['shipping']['address']['postal_code'] = $this->client->shipping_postal_code;
$data['shipping']['address']['state'] = $this->client->shipping_state;
$data['shipping']['address']['country'] = $this->client->shipping_country ? $this->client->shipping_country->iso_3166_2 : '';
\Stripe\Customer::update($customer->id, $data, $this->stripe_connect_auth);
}
}
public function refund(Payment $payment, $amount, $return_client_response = false) public function refund(Payment $payment, $amount, $return_client_response = false)
{ {
$this->init(); $this->init();

View File

@ -47,7 +47,7 @@ class EntityPolicy
public function edit(User $user, $entity) : bool public function edit(User $user, $entity) : bool
{ {
return ($user->isAdmin() && $entity->company_id == $user->companyId()) return ($user->isAdmin() && $entity->company_id == $user->companyId())
|| ($user->hasPermission('edit_'.strtolower(class_basename($entity))) && $entity->company_id == $user->companyId()) || ($user->hasPermission('edit_'.strtolower(\Illuminate\Support\Str::snake(class_basename($entity)))) && $entity->company_id == $user->companyId())
|| ($user->hasPermission('edit_all') && $entity->company_id == $user->companyId()) || ($user->hasPermission('edit_all') && $entity->company_id == $user->companyId())
|| $user->owns($entity) || $user->owns($entity)
|| $user->assigned($entity); || $user->assigned($entity);
@ -64,7 +64,7 @@ class EntityPolicy
public function view(User $user, $entity) : bool public function view(User $user, $entity) : bool
{ {
return ($user->isAdmin() && $entity->company_id == $user->companyId()) return ($user->isAdmin() && $entity->company_id == $user->companyId())
|| ($user->hasPermission('view_'.strtolower(class_basename($entity))) && $entity->company_id == $user->companyId()) || ($user->hasPermission('view_'.strtolower(\Illuminate\Support\Str::snake(class_basename($entity)))) && $entity->company_id == $user->companyId())
|| ($user->hasPermission('view_all') && $entity->company_id == $user->companyId()) || ($user->hasPermission('view_all') && $entity->company_id == $user->companyId())
|| $user->owns($entity) || $user->owns($entity)
|| $user->assigned($entity); || $user->assigned($entity);

View File

@ -304,7 +304,9 @@ class BaseRepository
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) { if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) {
//10-07-2022 //14-09-2022 log when we make changes to the invoice balance.
nlog("Adjustment - {$model->number} - " .$state['finished_amount']. " - " . $state['starting_amount']);
$model->service()->updateStatus()->save(); $model->service()->updateStatus()->save();
$model->client->service()->updateBalance(($state['finished_amount'] - $state['starting_amount']))->save(); $model->client->service()->updateBalance(($state['finished_amount'] - $state['starting_amount']))->save();
$model->ledger()->updateInvoiceBalance(($state['finished_amount'] - $state['starting_amount']), "Update adjustment for invoice {$model->number}"); $model->ledger()->updateInvoiceBalance(($state['finished_amount'] - $state['starting_amount']), "Update adjustment for invoice {$model->number}");

View File

@ -68,7 +68,6 @@ class InvoiceRepository extends BaseRepository
return $invoice; return $invoice;
} }
// $invoice->service()->markDeleted()->handleCancellation()->save();
$invoice = $invoice->service()->markDeleted()->save(); $invoice = $invoice->service()->markDeleted()->save();
parent::delete($invoice); parent::delete($invoice);

View File

@ -14,6 +14,7 @@ namespace App\Repositories;
use App\Factory\TaskFactory; use App\Factory\TaskFactory;
use App\Models\Task; use App\Models\Task;
use App\Utils\Traits\GeneratesCounter; use App\Utils\Traits\GeneratesCounter;
use Illuminate\Database\QueryException;
/** /**
* TaskRepository. * TaskRepository.
@ -45,7 +46,7 @@ class TaskRepository extends BaseRepository
$this->setDefaultStatus($task); $this->setDefaultStatus($task);
} }
$task->number = empty($task->number) || ! array_key_exists('number', $data) ? $this->getNextTaskNumber($task) : $data['number']; $task->number = empty($task->number) || ! array_key_exists('number', $data) ? $this->trySaving($task) : $data['number'];
if (isset($data['description'])) { if (isset($data['description'])) {
$task->description = trim($data['description']); $task->description = trim($data['description']);
@ -244,4 +245,34 @@ class TaskRepository extends BaseRepository
return $task; return $task;
} }
private function trySaving(Task $task)
{
$x=1;
do{
try{
$task->number = $this->getNextTaskNumber($task);
$task->saveQuietly();
$this->completed = false;
}
catch(QueryException $e){
$x++;
if($x>50)
$this->completed = false;
}
}
while($this->completed);
return $task->number;
}
} }

View File

@ -33,7 +33,7 @@ class ClientService
\DB::connection(config('database.default'))->transaction(function () use($amount) { \DB::connection(config('database.default'))->transaction(function () use($amount) {
$this->client = Client::where('id', $this->client->id)->lockForUpdate()->first(); $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
$this->client->balance += $amount; $this->client->balance += $amount;
$this->client->save(); $this->client->save();
@ -49,7 +49,7 @@ class ClientService
\DB::connection(config('database.default'))->transaction(function () use($balance, $paid_to_date) { \DB::connection(config('database.default'))->transaction(function () use($balance, $paid_to_date) {
$this->client = Client::where('id', $this->client->id)->lockForUpdate()->first(); $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
$this->client->balance += $balance; $this->client->balance += $balance;
$this->client->paid_to_date += $paid_to_date; $this->client->paid_to_date += $paid_to_date;
$this->client->save(); $this->client->save();
@ -65,7 +65,7 @@ class ClientService
\DB::connection(config('database.default'))->transaction(function () use($amount) { \DB::connection(config('database.default'))->transaction(function () use($amount) {
$this->client = Client::where('id', $this->client->id)->lockForUpdate()->first(); $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
$this->client->paid_to_date += $amount; $this->client->paid_to_date += $amount;
$this->client->save(); $this->client->save();
@ -83,7 +83,7 @@ class ClientService
public function getCreditBalance() :float public function getCreditBalance() :float
{ {
$credits = Credit::where('client_id', $this->client->id) $credits = Credit::withTrashed()->where('client_id', $this->client->id)
->where('is_deleted', false) ->where('is_deleted', false)
->where('balance', '>', 0) ->where('balance', '>', 0)
->where(function ($query) { ->where(function ($query) {

View File

@ -70,7 +70,6 @@ class ApplyNumber extends AbstractService
$this->invoice->saveQuietly(); $this->invoice->saveQuietly();
$this->completed = false; $this->completed = false;
} }
catch(QueryException $e){ catch(QueryException $e){
@ -84,5 +83,8 @@ class ApplyNumber extends AbstractService
} }
while($this->completed); while($this->completed);
return $this;
} }
} }

View File

@ -55,7 +55,7 @@ class MarkPaid extends AbstractService
\DB::connection(config('database.default'))->transaction(function () { \DB::connection(config('database.default'))->transaction(function () {
$this->invoice = Invoice::where('id', $this->invoice->id)->lockForUpdate()->first(); $this->invoice = Invoice::withTrashed()->where('id', $this->invoice->id)->lockForUpdate()->first();
$this->payable_balance = $this->invoice->balance; $this->payable_balance = $this->invoice->balance;

View File

@ -168,7 +168,7 @@ class HtmlEngine
$data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')]; $data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')];
} }
if(strlen($this->company->getSetting('qr_iban')) > 5 && strlen($this->company->getSetting('besr_id')) > 1) if(strlen($this->company->getSetting('qr_iban')) > 5)
{ {
try{ try{
$data['$swiss_qr'] = ['value' => (new SwissQrGenerator($this->entity, $this->company))->run(), 'label' => '']; $data['$swiss_qr'] = ['value' => (new SwissQrGenerator($this->entity, $this->company))->run(), 'label' => ''];

View File

@ -412,26 +412,30 @@ trait GeneratesCounter
* @param string $prefix * @param string $prefix
* @return string The padded and prefixed entity number * @return string The padded and prefixed entity number
*/ */
private function checkEntityNumber($class, $entity, $counter, $padding, $pattern, $prefix = '') private function checkEntityNumber($class, $entity, $counter, $padding, $pattern, $prefix = '') :string
{ {
$check = false; $check = false;
$check_counter = 1; $check_counter = 1;
do { do {
$number = $this->padCounter($counter, $padding); $number = $this->padCounter($counter, $padding);
$number = $this->applyNumberPattern($entity, $number, $pattern); $number = $this->applyNumberPattern($entity, $number, $pattern);
$number = $this->prefixCounter($number, $prefix); $number = $this->prefixCounter($number, $prefix);
$check = $class::whereCompanyId($entity->company_id)->whereNumber($number)->withTrashed()->exists(); $check = $class::where('company_id', $entity->company_id)->where('number', $number)->withTrashed()->exists();
$counter++; $counter++;
$check_counter++; $check_counter++;
if ($check_counter > 100) { if ($check_counter > 100) {
return $number.'_'.Str::random(5); return $number.'_'.Str::random(5);
} }
} while ($check); } while ($check);
return $number; return $number;

View File

@ -40,7 +40,7 @@
"authorizenet/authorizenet": "^2.0", "authorizenet/authorizenet": "^2.0",
"awobaz/compoships": "^2.1", "awobaz/compoships": "^2.1",
"bacon/bacon-qr-code": "^2.0", "bacon/bacon-qr-code": "^2.0",
"beganovich/snappdf": "^2", "beganovich/snappdf": "^3",
"braintree/braintree_php": "^6.0", "braintree/braintree_php": "^6.0",
"checkout/checkout-sdk-php": "^2.5", "checkout/checkout-sdk-php": "^2.5",
"cleverit/ubl_invoice": "^1.3", "cleverit/ubl_invoice": "^1.3",
@ -57,7 +57,7 @@
"intervention/image": "^2.5", "intervention/image": "^2.5",
"invoiceninja/inspector": "^1.0", "invoiceninja/inspector": "^1.0",
"laracasts/presenter": "^0.2.1", "laracasts/presenter": "^0.2.1",
"laravel/framework": "^9.17", "laravel/framework": "^9.3",
"laravel/slack-notification-channel": "^2.2", "laravel/slack-notification-channel": "^2.2",
"laravel/socialite": "^5", "laravel/socialite": "^5",
"laravel/tinker": "^2.7", "laravel/tinker": "^2.7",

242
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8d9b065d1cf3f4fd42565e77e63c53fc", "content-hash": "9dc581f41118f9f990e06f938c842839",
"packages": [ "packages": [
{ {
"name": "afosto/yaac", "name": "afosto/yaac",
@ -378,16 +378,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.235.3", "version": "3.235.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "d14bf468240f5bd8a0754b8a8248ff219ebada02" "reference": "cc33d53d735a3835adff212598f2a20ee9ac9531"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d14bf468240f5bd8a0754b8a8248ff219ebada02", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/cc33d53d735a3835adff212598f2a20ee9ac9531",
"reference": "d14bf468240f5bd8a0754b8a8248ff219ebada02", "reference": "cc33d53d735a3835adff212598f2a20ee9ac9531",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -406,6 +406,7 @@
"aws/aws-php-sns-message-validator": "~1.0", "aws/aws-php-sns-message-validator": "~1.0",
"behat/behat": "~3.0", "behat/behat": "~3.0",
"composer/composer": "^1.10.22", "composer/composer": "^1.10.22",
"dms/phpunit-arraysubset-asserts": "^0.4.0",
"doctrine/cache": "~1.4", "doctrine/cache": "~1.4",
"ext-dom": "*", "ext-dom": "*",
"ext-openssl": "*", "ext-openssl": "*",
@ -413,10 +414,11 @@
"ext-sockets": "*", "ext-sockets": "*",
"nette/neon": "^2.3", "nette/neon": "^2.3",
"paragonie/random_compat": ">= 2", "paragonie/random_compat": ">= 2",
"phpunit/phpunit": "^4.8.35 || ^5.6.3", "phpunit/phpunit": "^4.8.35 || ^5.6.3 || ^9.5",
"psr/cache": "^1.0", "psr/cache": "^1.0",
"psr/simple-cache": "^1.0", "psr/simple-cache": "^1.0",
"sebastian/comparator": "^1.2.3" "sebastian/comparator": "^1.2.3 || ^4.0",
"yoast/phpunit-polyfills": "^1.0"
}, },
"suggest": { "suggest": {
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
@ -464,9 +466,9 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.235.3" "source": "https://github.com/aws/aws-sdk-php/tree/3.235.8"
}, },
"time": "2022-09-07T18:17:39+00:00" "time": "2022-09-14T18:18:31+00:00"
}, },
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -524,16 +526,16 @@
}, },
{ {
"name": "beganovich/snappdf", "name": "beganovich/snappdf",
"version": "v2.2.0", "version": "v3.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/beganovich/snappdf.git", "url": "https://github.com/beganovich/snappdf.git",
"reference": "7964d03c091f3a30513fb6c44ea353c575ba523a" "reference": "b2656c2c67be086b535cd13a704e27caaf5a7570"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/beganovich/snappdf/zipball/7964d03c091f3a30513fb6c44ea353c575ba523a", "url": "https://api.github.com/repos/beganovich/snappdf/zipball/b2656c2c67be086b535cd13a704e27caaf5a7570",
"reference": "7964d03c091f3a30513fb6c44ea353c575ba523a", "reference": "b2656c2c67be086b535cd13a704e27caaf5a7570",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -570,9 +572,9 @@
"description": "Convert webpages or HTML into the PDF file using Chromium or Google Chrome.", "description": "Convert webpages or HTML into the PDF file using Chromium or Google Chrome.",
"support": { "support": {
"issues": "https://github.com/beganovich/snappdf/issues", "issues": "https://github.com/beganovich/snappdf/issues",
"source": "https://github.com/beganovich/snappdf/tree/v2.2.0" "source": "https://github.com/beganovich/snappdf/tree/v3.1.0"
}, },
"time": "2022-06-29T13:08:15+00:00" "time": "2022-09-14T10:35:47+00:00"
}, },
{ {
"name": "braintree/braintree_php", "name": "braintree/braintree_php",
@ -1577,16 +1579,16 @@
}, },
{ {
"name": "dragonmantank/cron-expression", "name": "dragonmantank/cron-expression",
"version": "v3.3.1", "version": "v3.3.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git", "url": "https://github.com/dragonmantank/cron-expression.git",
"reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa" "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/be85b3f05b46c39bbc0d95f6c071ddff669510fa", "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8",
"reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa", "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1626,7 +1628,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues", "issues": "https://github.com/dragonmantank/cron-expression/issues",
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.1" "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2"
}, },
"funding": [ "funding": [
{ {
@ -1634,7 +1636,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-01-18T15:43:28+00:00" "time": "2022-09-10T18:51:20+00:00"
}, },
{ {
"name": "egulias/email-validator", "name": "egulias/email-validator",
@ -2162,16 +2164,16 @@
}, },
{ {
"name": "google/apiclient-services", "name": "google/apiclient-services",
"version": "v0.265.0", "version": "v0.266.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git", "url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "a23754daa452e26a8dd31a7848863c67a2e3d67e" "reference": "27ead5edc8ba4a17ddd211ad03216c313a57411f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/a23754daa452e26a8dd31a7848863c67a2e3d67e", "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/27ead5edc8ba4a17ddd211ad03216c313a57411f",
"reference": "a23754daa452e26a8dd31a7848863c67a2e3d67e", "reference": "27ead5edc8ba4a17ddd211ad03216c313a57411f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2200,9 +2202,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues", "issues": "https://github.com/googleapis/google-api-php-client-services/issues",
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.265.0" "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.266.0"
}, },
"time": "2022-09-04T00:58:12+00:00" "time": "2022-09-12T01:28:14+00:00"
}, },
{ {
"name": "google/auth", "name": "google/auth",
@ -3481,16 +3483,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v9.28.0", "version": "v9.30.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "396a89e1f3654123d1c7f56306051212e5c75bc0" "reference": "2ca2b168a3e995a8ec6ea2805906379095d20080"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/396a89e1f3654123d1c7f56306051212e5c75bc0", "url": "https://api.github.com/repos/laravel/framework/zipball/2ca2b168a3e995a8ec6ea2805906379095d20080",
"reference": "396a89e1f3654123d1c7f56306051212e5c75bc0", "reference": "2ca2b168a3e995a8ec6ea2805906379095d20080",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3567,12 +3569,15 @@
"illuminate/view": "self.version" "illuminate/view": "self.version"
}, },
"require-dev": { "require-dev": {
"ably/ably-php": "^1.0",
"aws/aws-sdk-php": "^3.198.1", "aws/aws-sdk-php": "^3.198.1",
"doctrine/dbal": "^2.13.3|^3.1.4", "doctrine/dbal": "^2.13.3|^3.1.4",
"fakerphp/faker": "^1.9.2", "fakerphp/faker": "^1.9.2",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-aws-s3-v3": "^3.0",
"league/flysystem-ftp": "^3.0", "league/flysystem-ftp": "^3.0",
"league/flysystem-path-prefixing": "^3.3",
"league/flysystem-read-only": "^3.3",
"league/flysystem-sftp-v3": "^3.0", "league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.4.4", "mockery/mockery": "^1.4.4",
"orchestra/testbench-core": "^7.1", "orchestra/testbench-core": "^7.1",
@ -3600,6 +3605,8 @@
"laravel/tinker": "Required to use the tinker console command (^2.0).", "laravel/tinker": "Required to use the tinker console command (^2.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).",
"league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).",
"league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).",
"league/flysystem-read-only": "Required to use read-only disks (^3.3)",
"league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).",
"mockery/mockery": "Required to use mocking (^1.4.4).", "mockery/mockery": "Required to use mocking (^1.4.4).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
@ -3657,20 +3664,20 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2022-09-06T14:57:01+00:00" "time": "2022-09-13T14:06:14+00:00"
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
"version": "v1.2.1", "version": "v1.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/serializable-closure.git", "url": "https://github.com/laravel/serializable-closure.git",
"reference": "d78fd36ba031a1a695ea5a406f29996948d7011b" "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/d78fd36ba031a1a695ea5a406f29996948d7011b", "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
"reference": "d78fd36ba031a1a695ea5a406f29996948d7011b", "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3717,7 +3724,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues", "issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure" "source": "https://github.com/laravel/serializable-closure"
}, },
"time": "2022-08-26T15:25:27+00:00" "time": "2022-09-08T13:45:54+00:00"
}, },
{ {
"name": "laravel/slack-notification-channel", "name": "laravel/slack-notification-channel",
@ -4387,16 +4394,16 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "3.2.1", "version": "3.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "81aea9e5217084c7850cd36e1587ee4aad721c6b" "reference": "d8295793b3e2f91aa39e1feb2d5bfce772891ae2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/81aea9e5217084c7850cd36e1587ee4aad721c6b", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d8295793b3e2f91aa39e1feb2d5bfce772891ae2",
"reference": "81aea9e5217084c7850cd36e1587ee4aad721c6b", "reference": "d8295793b3e2f91aa39e1feb2d5bfce772891ae2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4407,6 +4414,7 @@
"aws/aws-sdk-php": "3.209.31 || 3.210.0", "aws/aws-sdk-php": "3.209.31 || 3.210.0",
"guzzlehttp/guzzle": "<7.0", "guzzlehttp/guzzle": "<7.0",
"guzzlehttp/ringphp": "<1.1.1", "guzzlehttp/ringphp": "<1.1.1",
"phpseclib/phpseclib": "3.0.15",
"symfony/http-client": "<5.2" "symfony/http-client": "<5.2"
}, },
"require-dev": { "require-dev": {
@ -4420,7 +4428,7 @@
"friendsofphp/php-cs-fixer": "^3.5", "friendsofphp/php-cs-fixer": "^3.5",
"google/cloud-storage": "^1.23", "google/cloud-storage": "^1.23",
"microsoft/azure-storage-blob": "^1.1", "microsoft/azure-storage-blob": "^1.1",
"phpseclib/phpseclib": "^2.0", "phpseclib/phpseclib": "^3.0.14",
"phpstan/phpstan": "^0.12.26", "phpstan/phpstan": "^0.12.26",
"phpunit/phpunit": "^9.5.11", "phpunit/phpunit": "^9.5.11",
"sabre/dav": "^4.3.1" "sabre/dav": "^4.3.1"
@ -4457,11 +4465,11 @@
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/flysystem/issues", "issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.2.1" "source": "https://github.com/thephpleague/flysystem/tree/3.3.0"
}, },
"funding": [ "funding": [
{ {
"url": "https://offset.earth/frankdejonge", "url": "https://ecologi.com/frankdejonge",
"type": "custom" "type": "custom"
}, },
{ {
@ -4473,20 +4481,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-08-14T20:48:34+00:00" "time": "2022-09-09T11:11:42+00:00"
}, },
{ {
"name": "league/flysystem-aws-s3-v3", "name": "league/flysystem-aws-s3-v3",
"version": "3.2.0", "version": "3.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
"reference": "257893ef7398b3c9255b26dff8b0118bb93fc5ff" "reference": "c9402e0b8d89d36b1b88ecf88c2a80b6d61fd114"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/257893ef7398b3c9255b26dff8b0118bb93fc5ff", "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/c9402e0b8d89d36b1b88ecf88c2a80b6d61fd114",
"reference": "257893ef7398b3c9255b26dff8b0118bb93fc5ff", "reference": "c9402e0b8d89d36b1b88ecf88c2a80b6d61fd114",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4527,11 +4535,11 @@
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues",
"source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.2.0" "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.3.0"
}, },
"funding": [ "funding": [
{ {
"url": "https://offset.earth/frankdejonge", "url": "https://ecologi.com/frankdejonge",
"type": "custom" "type": "custom"
}, },
{ {
@ -4543,7 +4551,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-07-26T07:22:40+00:00" "time": "2022-09-09T10:03:42+00:00"
}, },
{ {
"name": "league/fractal", "name": "league/fractal",
@ -5577,20 +5585,20 @@
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
"version": "v3.2.7", "version": "v3.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/utils.git", "url": "https://github.com/nette/utils.git",
"reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99" "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/0af4e3de4df9f1543534beab255ccf459e7a2c99", "url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
"reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99", "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2 <8.2" "php": ">=7.2 <8.3"
}, },
"conflict": { "conflict": {
"nette/di": "<3.0.6" "nette/di": "<3.0.6"
@ -5656,9 +5664,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/utils/issues", "issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v3.2.7" "source": "https://github.com/nette/utils/tree/v3.2.8"
}, },
"time": "2022-01-24T11:29:14+00:00" "time": "2022-09-12T23:36:20+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
@ -7652,20 +7660,20 @@
}, },
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
"version": "4.4.0", "version": "4.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/uuid.git", "url": "https://github.com/ramsey/uuid.git",
"reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a" "reference": "ef842484ba57f163c6d465ab744bfecb872a11d4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/373f7bacfcf3de038778ff27dcce5672ddbf4c8a", "url": "https://api.github.com/repos/ramsey/uuid/zipball/ef842484ba57f163c6d465ab744bfecb872a11d4",
"reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a", "reference": "ef842484ba57f163c6d465ab744bfecb872a11d4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"brick/math": "^0.8 || ^0.9 || ^0.10", "brick/math": "^0.8.8 || ^0.9 || ^0.10",
"ext-ctype": "*", "ext-ctype": "*",
"ext-json": "*", "ext-json": "*",
"php": "^8.0", "php": "^8.0",
@ -7686,12 +7694,13 @@
"php-mock/php-mock-mockery": "^1.3", "php-mock/php-mock-mockery": "^1.3",
"php-parallel-lint/php-parallel-lint": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.1",
"phpbench/phpbench": "^1.0", "phpbench/phpbench": "^1.0",
"phpstan/extension-installer": "^1.0", "phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12", "phpstan/phpstan": "^1.8",
"phpstan/phpstan-mockery": "^0.12", "phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-phpunit": "^1.1",
"phpunit/phpunit": "^8.5 || ^9", "phpunit/phpunit": "^8.5 || ^9",
"slevomat/coding-standard": "^7.0", "ramsey/composer-repl": "^1.4",
"slevomat/coding-standard": "^8.4",
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.9" "vimeo/psalm": "^4.9"
}, },
@ -7729,7 +7738,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/ramsey/uuid/issues", "issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.4.0" "source": "https://github.com/ramsey/uuid/tree/4.5.0"
}, },
"funding": [ "funding": [
{ {
@ -7741,7 +7750,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-08-05T17:58:37+00:00" "time": "2022-09-15T01:44:53+00:00"
}, },
{ {
"name": "razorpay/razorpay", "name": "razorpay/razorpay",
@ -11935,16 +11944,16 @@
}, },
{ {
"name": "tijsverkoyen/css-to-inline-styles", "name": "tijsverkoyen/css-to-inline-styles",
"version": "2.2.4", "version": "2.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
"reference": "da444caae6aca7a19c0c140f68c6182e337d5b1c" "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/da444caae6aca7a19c0c140f68c6182e337d5b1c", "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/4348a3a06651827a27d989ad1d13efec6bb49b19",
"reference": "da444caae6aca7a19c0c140f68c6182e337d5b1c", "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -11982,22 +11991,22 @@
"homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles",
"support": { "support": {
"issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues",
"source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.4" "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.5"
}, },
"time": "2021-12-08T09:12:39+00:00" "time": "2022-09-12T13:28:28+00:00"
}, },
{ {
"name": "turbo124/beacon", "name": "turbo124/beacon",
"version": "v1.3.2", "version": "v1.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/turbo124/beacon.git", "url": "https://github.com/turbo124/beacon.git",
"reference": "e46e6122e28c2a7628ad40975bfd11a3ab883575" "reference": "4a0c9c6af3d88142e89184e67e9f0547078d5ef0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/e46e6122e28c2a7628ad40975bfd11a3ab883575", "url": "https://api.github.com/repos/turbo124/beacon/zipball/4a0c9c6af3d88142e89184e67e9f0547078d5ef0",
"reference": "e46e6122e28c2a7628ad40975bfd11a3ab883575", "reference": "4a0c9c6af3d88142e89184e67e9f0547078d5ef0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -12044,9 +12053,9 @@
"turbo124" "turbo124"
], ],
"support": { "support": {
"source": "https://github.com/turbo124/beacon/tree/v1.3.2" "source": "https://github.com/turbo124/beacon/tree/v1.3.4"
}, },
"time": "2022-09-08T08:08:59+00:00" "time": "2022-09-09T23:30:23+00:00"
}, },
{ {
"name": "twilio/sdk", "name": "twilio/sdk",
@ -12741,16 +12750,16 @@
}, },
{ {
"name": "brianium/paratest", "name": "brianium/paratest",
"version": "v6.6.3", "version": "v6.6.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/paratestphp/paratest.git", "url": "https://github.com/paratestphp/paratest.git",
"reference": "f2d781bb9136cda2f5e73ee778049e80ba681cf6" "reference": "4ce800dc32fd0292a4f05c00f347142dce1ecdda"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/f2d781bb9136cda2f5e73ee778049e80ba681cf6", "url": "https://api.github.com/repos/paratestphp/paratest/zipball/4ce800dc32fd0292a4f05c00f347142dce1ecdda",
"reference": "f2d781bb9136cda2f5e73ee778049e80ba681cf6", "reference": "4ce800dc32fd0292a4f05c00f347142dce1ecdda",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -12760,24 +12769,23 @@
"ext-simplexml": "*", "ext-simplexml": "*",
"jean85/pretty-package-versions": "^2.0.5", "jean85/pretty-package-versions": "^2.0.5",
"php": "^7.3 || ^8.0", "php": "^7.3 || ^8.0",
"phpunit/php-code-coverage": "^9.2.16", "phpunit/php-code-coverage": "^9.2.17",
"phpunit/php-file-iterator": "^3.0.6", "phpunit/php-file-iterator": "^3.0.6",
"phpunit/php-timer": "^5.0.3", "phpunit/php-timer": "^5.0.3",
"phpunit/phpunit": "^9.5.23", "phpunit/phpunit": "^9.5.24",
"sebastian/environment": "^5.1.4", "sebastian/environment": "^5.1.4",
"symfony/console": "^5.4.9 || ^6.1.2", "symfony/console": "^5.4.12 || ^6.1.4",
"symfony/polyfill-php80": "^v1.26.0", "symfony/process": "^5.4.11 || ^6.1.3"
"symfony/process": "^5.4.8 || ^6.1.0"
}, },
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^9.0.0", "doctrine/coding-standard": "^10.0.0",
"ext-pcov": "*", "ext-pcov": "*",
"ext-posix": "*", "ext-posix": "*",
"infection/infection": "^0.26.13", "infection/infection": "^0.26.14",
"malukenho/mcbumpface": "^1.1.5", "malukenho/mcbumpface": "^1.1.5",
"squizlabs/php_codesniffer": "^3.7.1", "squizlabs/php_codesniffer": "^3.7.1",
"symfony/filesystem": "^5.4.9 || ^6.1.0", "symfony/filesystem": "^5.4.12 || ^6.1.4",
"vimeo/psalm": "^4.26.0" "vimeo/psalm": "^4.27.0"
}, },
"bin": [ "bin": [
"bin/paratest", "bin/paratest",
@ -12818,7 +12826,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/paratestphp/paratest/issues", "issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v6.6.3" "source": "https://github.com/paratestphp/paratest/tree/v6.6.4"
}, },
"funding": [ "funding": [
{ {
@ -12830,7 +12838,7 @@
"type": "paypal" "type": "paypal"
} }
], ],
"time": "2022-08-25T05:44:14+00:00" "time": "2022-09-13T10:47:01+00:00"
}, },
{ {
"name": "composer/package-versions-deprecated", "name": "composer/package-versions-deprecated",
@ -14988,16 +14996,16 @@
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
"version": "4.0.6", "version": "4.0.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "55f4261989e546dc112258c7a75935a81a7ce382" "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
"reference": "55f4261989e546dc112258c7a75935a81a7ce382", "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -15050,7 +15058,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues", "issues": "https://github.com/sebastianbergmann/comparator/issues",
"source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
}, },
"funding": [ "funding": [
{ {
@ -15058,7 +15066,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-10-26T15:49:45+00:00" "time": "2022-09-14T12:41:17+00:00"
}, },
{ {
"name": "sebastian/complexity", "name": "sebastian/complexity",
@ -15248,16 +15256,16 @@
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
"version": "4.0.4", "version": "4.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git", "url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -15313,7 +15321,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues", "issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5"
}, },
"funding": [ "funding": [
{ {
@ -15321,7 +15329,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-11-11T14:18:36+00:00" "time": "2022-09-14T06:03:37+00:00"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
@ -15676,16 +15684,16 @@
}, },
{ {
"name": "sebastian/type", "name": "sebastian/type",
"version": "3.1.0", "version": "3.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/type.git", "url": "https://github.com/sebastianbergmann/type.git",
"reference": "fb44e1cc6e557418387ad815780360057e40753e" "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e",
"reference": "fb44e1cc6e557418387ad815780360057e40753e", "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -15697,7 +15705,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.1-dev" "dev-master": "3.2-dev"
} }
}, },
"autoload": { "autoload": {
@ -15720,7 +15728,7 @@
"homepage": "https://github.com/sebastianbergmann/type", "homepage": "https://github.com/sebastianbergmann/type",
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/type/issues", "issues": "https://github.com/sebastianbergmann/type/issues",
"source": "https://github.com/sebastianbergmann/type/tree/3.1.0" "source": "https://github.com/sebastianbergmann/type/tree/3.2.0"
}, },
"funding": [ "funding": [
{ {
@ -15728,7 +15736,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-08-29T06:55:37+00:00" "time": "2022-09-12T14:47:03+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.5.21', 'app_version' => '5.5.22',
'app_tag' => '5.5.21', 'app_tag' => '5.5.22',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),

View File

@ -1,5 +1,6 @@
<?php <?php
use App\Listeners\Subscription\AppStoreRenewSubscription;
use Imdhemy\Purchases\Events\AppStore\Cancel; use Imdhemy\Purchases\Events\AppStore\Cancel;
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalPref; use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalPref;
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus; use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus;
@ -16,8 +17,8 @@ use Imdhemy\Purchases\Events\GooglePlay\SubscriptionDeferred;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionExpired; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionExpired;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionInGracePeriod; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionInGracePeriod;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionOnHold; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionOnHold;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPaused;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPauseScheduleChanged; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPauseScheduleChanged;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPaused;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPriceChangeConfirmed; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPriceChangeConfirmed;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPurchased; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPurchased;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered; use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered;
@ -62,7 +63,7 @@ return [
DidChangeRenewalStatus::class => [], DidChangeRenewalStatus::class => [],
DidFailToRenew::class => [], DidFailToRenew::class => [],
DidRecover::class => [], DidRecover::class => [],
DidRenew::class => [], DidRenew::class => [AppStoreRenewSubscription::class],
InitialBuy::class => [], InitialBuy::class => [],
InteractiveRenewal::class => [], InteractiveRenewal::class => [],
PriceIncreaseConsent::class => [], PriceIncreaseConsent::class => [],

View File

@ -11,7 +11,7 @@
@endpush @endpush
@section('body') @section('body')
@livewire('required-client-info', ['fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact' => auth()->guard('contact')->user(), 'countries' => $countries, 'company' => $company]) @livewire('required-client-info', ['fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact' => auth()->guard('contact')->user(), 'countries' => $countries, 'company' => $company, 'company_gateway_id' => $gateway->company_gateway->id])
<div class="container mx-auto grid grid-cols-12 opacity-25 pointer-events-none" data-ref="gateway-container"> <div class="container mx-auto grid grid-cols-12 opacity-25 pointer-events-none" data-ref="gateway-container">
<div class="col-span-12 lg:col-span-6 lg:col-start-4 bg-white shadow rounded-lg"> <div class="col-span-12 lg:col-span-6 lg:col-start-4 bg-white shadow rounded-lg">

View File

@ -512,6 +512,6 @@ class CompanyGatewayApiTest extends TestCase
$company_gateway = CompanyGateway::find($id); $company_gateway = CompanyGateway::find($id);
$this->assertEquals(1.2, $company_gateway->calcGatewayFee(10, GatewayType::CREDIT_CARD, true)); $this->assertEquals(1.2, round($company_gateway->calcGatewayFee(10, GatewayType::CREDIT_CARD, true),1));
} }
} }

View File

@ -233,6 +233,6 @@ class CompanyGatewayResolutionTest extends TestCase
$this->cg->save(); $this->cg->save();
$fee = $this->cg->calcGatewayFee(89, GatewayType::CREDIT_CARD, false); $fee = $this->cg->calcGatewayFee(89, GatewayType::CREDIT_CARD, false);
$this->assertEquals(1.89, $fee); $this->assertEquals(1.89, round($fee,2));
} }
} }