Merge pull request #4786 from turbo124/v5-stable

5.0.55
This commit is contained in:
David Bomba 2021-01-28 17:32:40 +11:00 committed by GitHub
commit 4188b07fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 118301 additions and 120687 deletions

View File

@ -1 +1 @@
5.0.54 5.0.55

View File

@ -12,6 +12,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\DataMapper\CompanySettings; use App\DataMapper\CompanySettings;
use App\DataMapper\FeesAndLimits;
use App\Events\Invoice\InvoiceWasCreated; use App\Events\Invoice\InvoiceWasCreated;
use App\Factory\InvoiceFactory; use App\Factory\InvoiceFactory;
use App\Factory\InvoiceItemFactory; use App\Factory\InvoiceItemFactory;
@ -491,6 +492,7 @@ class CreateSingleAccount extends Command
private function createGateways($company, $user) private function createGateways($company, $user)
{ {
if (config('ninja.testvars.stripe') && ($this->gateway == 'all' || $this->gateway == 'stripe')) { if (config('ninja.testvars.stripe') && ($this->gateway == 'all' || $this->gateway == 'stripe')) {
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $company->id; $cg->company_id = $company->id;
$cg->user_id = $user->id; $cg->user_id = $user->id;
@ -502,16 +504,15 @@ class CreateSingleAccount extends Command
$cg->config = encrypt(config('ninja.testvars.stripe')); $cg->config = encrypt(config('ninja.testvars.stripe'));
$cg->save(); $cg->save();
// $cg = new CompanyGateway; $gateway_types = $cg->driver(new Client)->gatewayTypes();
// $cg->company_id = $company->id;
// $cg->user_id = $user->id; $fees_and_limits = new \stdClass;
// $cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23'; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
// $cg->require_cvv = true;
// $cg->require_billing_address = true; $cg->fees_and_limits = $fees_and_limits;
// $cg->require_shipping_address = true; $cg->save();
// $cg->update_details = true;
// $cg->config = encrypt(config('ninja.testvars.stripe'));
// $cg->save();
} }
if (config('ninja.testvars.paypal') && ($this->gateway == 'all' || $this->gateway == 'paypal')) { if (config('ninja.testvars.paypal') && ($this->gateway == 'all' || $this->gateway == 'paypal')) {
@ -525,6 +526,14 @@ class CreateSingleAccount extends Command
$cg->update_details = true; $cg->update_details = true;
$cg->config = encrypt(config('ninja.testvars.paypal')); $cg->config = encrypt(config('ninja.testvars.paypal'));
$cg->save(); $cg->save();
$gateway_types = $cg->driver(new Client)->gatewayTypes();
$fees_and_limits = new \stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
} }
if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) { if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) {
@ -538,6 +547,14 @@ class CreateSingleAccount extends Command
$cg->update_details = true; $cg->update_details = true;
$cg->config = encrypt(config('ninja.testvars.checkout')); $cg->config = encrypt(config('ninja.testvars.checkout'));
$cg->save(); $cg->save();
$gateway_types = $cg->driver(new Client)->gatewayTypes();
$fees_and_limits = new \stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
} }
if (config('ninja.testvars.authorize') && ($this->gateway == 'all' || $this->gateway == 'authorizenet')) { if (config('ninja.testvars.authorize') && ($this->gateway == 'all' || $this->gateway == 'authorizenet')) {
@ -551,6 +568,14 @@ class CreateSingleAccount extends Command
$cg->update_details = true; $cg->update_details = true;
$cg->config = encrypt(config('ninja.testvars.authorize')); $cg->config = encrypt(config('ninja.testvars.authorize'));
$cg->save(); $cg->save();
$gateway_types = $cg->driver(new Client)->gatewayTypes();
$fees_and_limits = new \stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
} }
} }
} }

View File

@ -331,7 +331,7 @@ class CreateTestData extends Command
$this->info('Creating '.$this->count.' clients'); $this->info('Creating '.$this->count.' clients');
for ($x = 0; $x < $this->count * 200; $x++) { for ($x = 0; $x < $this->count * 100; $x++) {
$z = $x + 1; $z = $x + 1;
$this->info('Creating client # '.$z); $this->info('Creating client # '.$z);

View File

@ -0,0 +1,78 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Filters;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
/**
* DocumentFilters.
*/
class DocumentFilters extends QueryFilters
{
public function client_id(int $client_id) :Builder
{
return $this->builder->where('client_id', $client_id);
}
/**
* Filter based on search text.
*
* @param string query filter
* @return Builder
* @deprecated
*/
public function filter(string $filter = '') : Builder
{
if (strlen($filter) == 0) {
return $this->builder;
}
return $this->builder;
}
/**
* Sorts the list based on $sort.
*
* @param string sort formatted as column|asc
* @return Builder
*/
public function sort(string $sort) : Builder
{
$sort_col = explode('|', $sort);
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
}
/**
* Returns the base query.
*
* @param int company_id
* @param User $user
* @return Builder
* @deprecated
*/
public function baseQuery(int $company_id, User $user) : Builder
{
}
/**
* Filters the query by the users company ID.
*
* @return Illuminate\Database\Query\Builder
*/
public function entityFilter()
{
return $this->builder->company();
}
}

View File

@ -65,7 +65,6 @@ class BaseController extends Controller
'company.task_statuses', 'company.task_statuses',
'company.expense_categories', 'company.expense_categories',
'company.documents', 'company.documents',
//'company.users',
'company.users.company_user', 'company.users.company_user',
'company.clients.contacts.company', 'company.clients.contacts.company',
'company.clients.gateway_tokens', 'company.clients.gateway_tokens',
@ -105,6 +104,7 @@ class BaseController extends Controller
'user.company_user', 'user.company_user',
'token', 'token',
'company.activities', 'company.activities',
'company.documents',
//'company.users.company_user', //'company.users.company_user',
'company.tax_rates', 'company.tax_rates',
'company.groups', 'company.groups',
@ -184,6 +184,9 @@ class BaseController extends Controller
protected function refreshResponse($query) protected function refreshResponse($query)
{ {
if (auth()->user()->getCompany()->is_large)
$this->manager->parseIncludes($this->mini_load);
else
$this->manager->parseIncludes($this->first_load); $this->manager->parseIncludes($this->first_load);
$this->serializer = request()->input('serializer') ?: EntityTransformer::API_SERIALIZER_ARRAY; $this->serializer = request()->input('serializer') ?: EntityTransformer::API_SERIALIZER_ARRAY;
@ -197,9 +200,9 @@ class BaseController extends Controller
$transformer = new $this->entity_transformer($this->serializer); $transformer = new $this->entity_transformer($this->serializer);
$updated_at = request()->has('updated_at') ? request()->input('updated_at') : 0; $updated_at = request()->has('updated_at') ? request()->input('updated_at') : 0;
if (auth()->user()->getCompany()->is_large && ! request()->has('updated_at')) { // if (auth()->user()->getCompany()->is_large && ! request()->has('updated_at')) {
return response()->json(['message' => ctrans('texts.large_account_update_parameter'), 'errors' =>[]], 401); // return response()->json(['message' => ctrans('texts.large_account_update_parameter'), 'errors' =>[]], 401);
} // }
$updated_at = date('Y-m-d H:i:s', $updated_at); $updated_at = date('Y-m-d H:i:s', $updated_at);

View File

@ -301,6 +301,8 @@ class PaymentController extends Controller
SystemLog::TYPE_FAILURE, SystemLog::TYPE_FAILURE,
auth('contact')->user()->client auth('contact')->user()->client
); );
throw new PaymentFailed($e->getMessage());
} }
} }

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Filters\DocumentFilters;
use App\Http\Requests\Document\DestroyDocumentRequest; use App\Http\Requests\Document\DestroyDocumentRequest;
use App\Http\Requests\Document\ShowDocumentRequest; use App\Http\Requests\Document\ShowDocumentRequest;
use App\Http\Requests\Document\StoreDocumentRequest; use App\Http\Requests\Document\StoreDocumentRequest;
@ -26,10 +27,6 @@ class DocumentController extends BaseController
*/ */
protected $document_repo; protected $document_repo;
/**
* DocumentController constructor.
* @param DocumentRepository $document_repo
*/
public function __construct(DocumentRepository $document_repo) public function __construct(DocumentRepository $document_repo)
{ {
parent::__construct(); parent::__construct();
@ -40,13 +37,46 @@ class DocumentController extends BaseController
} }
/** /**
* Display a listing of the resource. * @OA\Get(
* * path="/api/v1/documents",
* @return void * operationId="getDocuments",
* tags={"documents"},
* summary="Gets a list of documents",
* description="Lists documents, search and filters allow fine grained lists to be generated.
Query parameters can be added to performed more fine grained filtering of the documents, these are handled by the DocumentsFilters class which defines the methods available",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(ref="#/components/parameters/index"),
* @OA\Response(
* response=200,
* description="A list of documents",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/Document"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
* ),
* @OA\Response(
* response="default",
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
* @param DocumentsFilters $filters
* @return Response|mixed
*/ */
public function index() public function index(DocumentFilters $filters)
{ {
// $documents = Document::filter($filters);
return $this->listResponse($documents);
} }
/** /**

View File

@ -218,6 +218,8 @@ class MigrationController extends BaseController
*/ */
public function startMigration(Request $request) public function startMigration(Request $request)
{ {
nlog("Starting Migration");
$companies = json_decode($request->companies); $companies = json_decode($request->companies);
if (app()->environment() === 'local') { if (app()->environment() === 'local') {
@ -290,6 +292,9 @@ class MigrationController extends BaseController
// If there's no existing company migrate just normally. // If there's no existing company migrate just normally.
if ($checks['existing_company'] == false) { if ($checks['existing_company'] == false) {
nlog("creating fresh company");
$account = auth()->user()->account; $account = auth()->user()->account;
$fresh_company = (new ImportMigrations())->getCompany($account); $fresh_company = (new ImportMigrations())->getCompany($account);
@ -325,11 +330,13 @@ class MigrationController extends BaseController
); );
if (app()->environment() == 'testing') { if (app()->environment() == 'testing') {
nlog("environment is testing = bailing out now");
return; return;
} }
try { try {
// StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5)); // StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
nlog("starting migration job");
nlog($migration_file); nlog($migration_file);
StartMigration::dispatch($migration_file, $user, $fresh_company); StartMigration::dispatch($migration_file, $user, $fresh_company);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@ -80,6 +80,7 @@ class SendRecurring implements ShouldQueue
} }
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) { if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) {
nlog("attempting to autobill {$invoice->number}");
$invoice->service()->autoBill()->save(); $invoice->service()->autoBill()->save();
} }

View File

@ -73,6 +73,8 @@ class StartMigration implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
nlog("Inside Migration Job");
set_time_limit(0); set_time_limit(0);
MultiDB::setDb($this->company->db); MultiDB::setDb($this->company->db);

View File

@ -40,6 +40,5 @@ class PaymentEmailedActivity implements ShouldQueue
$payment = $event->payment; $payment = $event->payment;
nlog("i succeeded in emailing payment {$payment->number}");
} }
} }

View File

@ -55,16 +55,6 @@ class PaymentEmailEngine extends BaseEmailEngine
$body_template = EmailTemplateDefaults::getDefaultTemplate('email_template_payment', $this->client->locale()); $body_template = EmailTemplateDefaults::getDefaultTemplate('email_template_payment', $this->client->locale());
} }
/* Use default translations if a custom message has not been set*/
if (iconv_strlen($body_template) == 0) {
$body_template = trans(
'texts.payment_message',
['amount' => $payment->amount, 'company' => $payment->company->present()->name()],
null,
$this->client->locale()
);
}
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) { if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
$subject_template = $this->template_data['subject']; $subject_template = $this->template_data['subject'];
} elseif (strlen($this->client->getSetting('email_subject_payment')) > 0) { } elseif (strlen($this->client->getSetting('email_subject_payment')) > 0) {
@ -73,15 +63,6 @@ class PaymentEmailEngine extends BaseEmailEngine
$subject_template = EmailTemplateDefaults::getDefaultTemplate('email_subject_payment', $this->client->locale()); $subject_template = EmailTemplateDefaults::getDefaultTemplate('email_subject_payment', $this->client->locale());
} }
if (iconv_strlen($subject_template) == 0) {
$subject_template = trans(
'texts.payment_subject',
['number' => $payment->number, 'company' => $payment->company->present()->name()],
null,
$this->client->locale()
);
}
$this->setTemplate($this->client->getSetting('email_style')) $this->setTemplate($this->client->getSetting('email_style'))
->setContact($this->contact) ->setContact($this->contact)
->setVariables($this->makeValues()) ->setVariables($this->makeValues())
@ -198,7 +179,7 @@ class PaymentEmailEngine extends BaseEmailEngine
private function formatInvoices() private function formatInvoices()
{ {
$invoice_list = ''; $invoice_list = '<br><br>';
foreach ($this->payment->invoices as $invoice) { foreach ($this->payment->invoices as $invoice) {
$invoice_list .= ctrans('texts.invoice_number_short') . " {$invoice->number} - " . Number::formatMoney($invoice->pivot->amount, $this->client) . "<br>"; $invoice_list .= ctrans('texts.invoice_number_short') . " {$invoice->number} - " . Number::formatMoney($invoice->pivot->amount, $this->client) . "<br>";

View File

@ -437,133 +437,133 @@ class Client extends BaseModel implements HasLocalePreference
* @return array Array of payment labels and urls * @return array Array of payment labels and urls
* @deprecated 5.0.38 - see service()->getPaymentMethods($amount); * @deprecated 5.0.38 - see service()->getPaymentMethods($amount);
*/ */
public function getPaymentMethods($amount) :array // public function getPaymentMethods($amount) :array
{ // {
//this method will get all the possible gateways a client can pay with // //this method will get all the possible gateways a client can pay with
//but we also need to consider payment methods that are already stored // //but we also need to consider payment methods that are already stored
//so we MUST filter the company gateways and remove duplicates. // //so we MUST filter the company gateways and remove duplicates.
//Also need to harvest the list of client gateway tokens and present these // //Also need to harvest the list of client gateway tokens and present these
//for instant payment // //for instant payment
$company_gateways = $this->getSetting('company_gateway_ids'); // $company_gateways = $this->getSetting('company_gateway_ids');
//we need to check for "0" here as we disable a payment gateway for a client with the number "0" // //we need to check for "0" here as we disable a payment gateway for a client with the number "0"
if ($company_gateways || $company_gateways == '0') { // if ($company_gateways || $company_gateways == '0') {
$transformed_ids = $this->transformKeys(explode(',', $company_gateways)); // $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
$gateways = $this->company // $gateways = $this->company
->company_gateways // ->company_gateways
->whereIn('id', $transformed_ids) // ->whereIn('id', $transformed_ids)
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa') // ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority // ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
return array_search($model->id, $transformed_ids);// this closure sorts for us // return array_search($model->id, $transformed_ids);// this closure sorts for us
}); // });
} else { // } else {
$gateways = $this->company // $gateways = $this->company
->company_gateways // ->company_gateways
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa') // ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
->where('is_deleted', false); // ->where('is_deleted', false);
} // }
$payment_methods = []; // $payment_methods = [];
foreach ($gateways as $gateway) { // foreach ($gateways as $gateway) {
foreach ($gateway->driver($this)->gatewayTypes() as $type) { // foreach ($gateway->driver($this)->gatewayTypes() as $type) {
if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { // if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) {
if ($this->validGatewayForAmount($gateway->fees_and_limits->{$type}, $amount)) { // if ($this->validGatewayForAmount($gateway->fees_and_limits->{$type}, $amount)) {
$payment_methods[] = [$gateway->id => $type]; // $payment_methods[] = [$gateway->id => $type];
} // }
} else { // } else {
$payment_methods[] = [$gateway->id => $type]; // $payment_methods[] = [$gateway->id => $type];
} // }
} // }
} // }
$payment_methods_collections = collect($payment_methods); // $payment_methods_collections = collect($payment_methods);
//** Plucks the remaining keys into its own collection // //** Plucks the remaining keys into its own collection
$payment_methods_intersect = $payment_methods_collections->intersectByKeys($payment_methods_collections->flatten(1)->unique()); // $payment_methods_intersect = $payment_methods_collections->intersectByKeys($payment_methods_collections->flatten(1)->unique());
// handle custom gateways as they are not unique'd()--------------------------------------------------------- // // handle custom gateways as they are not unique'd()---------------------------------------------------------
// we need to split the query here as we allow multiple custom gateways, so we must show all of them, they query logic // // we need to split the query here as we allow multiple custom gateways, so we must show all of them, they query logic
// above only pulls in unique gateway types.. ie.. we only allow 1 credit card gateway, but many custom gateways. // // above only pulls in unique gateway types.. ie.. we only allow 1 credit card gateway, but many custom gateways.
if ($company_gateways || $company_gateways == '0') { // if ($company_gateways || $company_gateways == '0') {
$transformed_ids = $this->transformKeys(explode(',', $company_gateways)); // $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
$gateways = $this->company // $gateways = $this->company
->company_gateways // ->company_gateways
->whereIn('id', $transformed_ids) // ->whereIn('id', $transformed_ids)
->where('gateway_key', '=', '54faab2ab6e3223dbe848b1686490baa') // ->where('gateway_key', '=', '54faab2ab6e3223dbe848b1686490baa')
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority // ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
return array_search($model->id, $transformed_ids);// this closure sorts for us // return array_search($model->id, $transformed_ids);// this closure sorts for us
}); // });
} else { // } else {
$gateways = $this->company // $gateways = $this->company
->company_gateways // ->company_gateways
->where('gateway_key', '=', '54faab2ab6e3223dbe848b1686490baa') // ->where('gateway_key', '=', '54faab2ab6e3223dbe848b1686490baa')
->where('is_deleted', false); // ->where('is_deleted', false);
} // }
//note we have to use GatewayType::CREDIT_CARD as alias for CUSTOM // //note we have to use GatewayType::CREDIT_CARD as alias for CUSTOM
foreach ($gateways as $gateway) { // foreach ($gateways as $gateway) {
foreach ($gateway->driver($this)->gatewayTypes() as $type) { // foreach ($gateway->driver($this)->gatewayTypes() as $type) {
if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { // if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) {
if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $amount)) { // if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $amount)) {
$payment_methods_intersect->push([$gateway->id => $type]); // $payment_methods_intersect->push([$gateway->id => $type]);
} // }
} else { // } else {
$payment_methods_intersect->push([$gateway->id => NULL]); // $payment_methods_intersect->push([$gateway->id => NULL]);
} // }
} // }
} // }
//handle custom gateways as they are not unique'd()--------------------------------------------------------- // //handle custom gateways as they are not unique'd()---------------------------------------------------------
$payment_urls = []; // $payment_urls = [];
foreach ($payment_methods_intersect as $key => $child_array) { // foreach ($payment_methods_intersect as $key => $child_array) {
foreach ($child_array as $gateway_id => $gateway_type_id) { // foreach ($child_array as $gateway_id => $gateway_type_id) {
$gateway = CompanyGateway::find($gateway_id); // $gateway = CompanyGateway::find($gateway_id);
$fee_label = $gateway->calcGatewayFeeLabel($amount, $this); // $fee_label = $gateway->calcGatewayFeeLabel($amount, $this);
if(!$gateway_type_id){ // if(!$gateway_type_id){
$payment_urls[] = [ // $payment_urls[] = [
'label' => $gateway->getConfigField('name') . $fee_label, // 'label' => $gateway->getConfigField('name') . $fee_label,
'company_gateway_id' => $gateway_id, // 'company_gateway_id' => $gateway_id,
'gateway_type_id' => GatewayType::CREDIT_CARD, // 'gateway_type_id' => GatewayType::CREDIT_CARD,
]; // ];
} // }
else // else
{ // {
$payment_urls[] = [ // $payment_urls[] = [
'label' => $gateway->getTypeAlias($gateway_type_id) . $fee_label, // 'label' => $gateway->getTypeAlias($gateway_type_id) . $fee_label,
'company_gateway_id' => $gateway_id, // 'company_gateway_id' => $gateway_id,
'gateway_type_id' => $gateway_type_id, // 'gateway_type_id' => $gateway_type_id,
]; // ];
} // }
} // }
} // }
if (($this->getSetting('use_credits_payment') == 'option' || $this->getSetting('use_credits_payment') == 'always') && $this->service()->getCreditBalance() > 0) { // if (($this->getSetting('use_credits_payment') == 'option' || $this->getSetting('use_credits_payment') == 'always') && $this->service()->getCreditBalance() > 0) {
// Show credits as only payment option if both statements are true. // // Show credits as only payment option if both statements are true.
if ( // if (
$this->service()->getCreditBalance() > $amount // $this->service()->getCreditBalance() > $amount
&& $this->getSetting('use_credits_payment') == 'always') { // && $this->getSetting('use_credits_payment') == 'always') {
$payment_urls = []; // $payment_urls = [];
} // }
$payment_urls[] = [ // $payment_urls[] = [
'label' => ctrans('texts.apply_credit'), // 'label' => ctrans('texts.apply_credit'),
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT, // 'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
'gateway_type_id' => GatewayType::CREDIT, // 'gateway_type_id' => GatewayType::CREDIT,
]; // ];
} // }
return $payment_urls; // return $payment_urls;
} // }
public function validGatewayForAmount($fees_and_limits_for_payment_type, $amount) :bool public function validGatewayForAmount($fees_and_limits_for_payment_type, $amount) :bool
{ {

View File

@ -64,6 +64,7 @@ class CompanyGateway extends BaseModel
'd14dd26a37cecc30fdd65700bfb55b23' => 301, 'd14dd26a37cecc30fdd65700bfb55b23' => 301,
'3758e7f7c6f4cecf0f4f348b9a00f456' => 304, '3758e7f7c6f4cecf0f4f348b9a00f456' => 304,
'3b6621f970ab18887c4f6dca78d3f8bb' => 305, '3b6621f970ab18887c4f6dca78d3f8bb' => 305,
'54faab2ab6e3223dbe848b1686490baa' => 306,
]; ];
protected $touches = []; protected $touches = [];
@ -87,6 +88,11 @@ class CompanyGateway extends BaseModel
return $this->belongsTo(Company::class); return $this->belongsTo(Company::class);
} }
public function client_gateway_tokens()
{
return $this->hasMany(ClientGatewayToken::class);
}
public function gateway() public function gateway()
{ {
return $this->belongsTo(Gateway::class, 'gateway_key', 'key'); return $this->belongsTo(Gateway::class, 'gateway_key', 'key');
@ -242,7 +248,7 @@ class CompanyGateway extends BaseModel
public function getFeesAndLimits($gateway_type_id) public function getFeesAndLimits($gateway_type_id)
{ {
if (is_null($this->fees_and_limits) || empty($this->fees_and_limits)) { if (is_null($this->fees_and_limits) || empty($this->fees_and_limits) || !property_exists($this->fees_and_limits, $gateway_type_id)) {
return false; return false;
} }

View File

@ -11,12 +11,14 @@
namespace App\Models; namespace App\Models;
use App\Models\Filterable;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
class Document extends BaseModel class Document extends BaseModel
{ {
use SoftDeletes; use SoftDeletes;
use Filterable;
const DOCUMENT_PREVIEW_SIZE = 300; // pixels const DOCUMENT_PREVIEW_SIZE = 300; // pixels

View File

@ -91,13 +91,13 @@ class CompanyPresenter extends EntityPresenter
} }
} }
public function getSpcQrCode($client_custom, $invoice_number, $balance) public function getSpcQrCode($client_currency, $invoice_number, $balance)
{ {
$settings = $this->entity->settings; $settings = $this->entity->settings;
return return
"SPC\n0200\n1\nCH860021421411198240K\nK\n{$this->name}\n{$settings->address1}\n{$settings->postal_code} {$settings->city}\n\n\nCH\n\n\n\n\n\n\n\n{$balance}\n{$client_custom}\n\n\n\n\n\n\n\nNON\n\n{$invoice_number}\nEPD\n"; "SPC\n0200\n1\nCH860021421411198240K\nK\n{$this->name}\n{$settings->address1}\n{$settings->postal_code} {$settings->city}\n\n\nCH\n\n\n\n\n\n\n\n{$balance}\n{$client_currency}\n\n\n\n\n\n\n\nNON\n\n{$invoice_number}\nEPD\n";
} }
} }

View File

@ -61,6 +61,7 @@ class SystemLog extends Model
const TYPE_FAILURE = 303; const TYPE_FAILURE = 303;
const TYPE_CHECKOUT = 304; const TYPE_CHECKOUT = 304;
const TYPE_AUTHORIZE = 305; const TYPE_AUTHORIZE = 305;
const TYPE_CUSTOM = 306;
const TYPE_QUOTA_EXCEEDED = 400; const TYPE_QUOTA_EXCEEDED = 400;
const TYPE_UPSTREAM_FAILURE = 401; const TYPE_UPSTREAM_FAILURE = 401;

View File

@ -2,6 +2,7 @@
namespace App\Observers; namespace App\Observers;
use App\Models\ClientGatewayToken;
use App\Models\CompanyGateway; use App\Models\CompanyGateway;
class CompanyGatewayObserver class CompanyGatewayObserver
@ -41,7 +42,8 @@ class CompanyGatewayObserver
*/ */
public function deleted(CompanyGateway $company_gateway) public function deleted(CompanyGateway $company_gateway)
{ {
// //when we soft delete a gateway - we also soft delete the tokens
$company_gateway->client_gateway_tokens()->delete();
} }
/** /**
@ -52,7 +54,8 @@ class CompanyGatewayObserver
*/ */
public function restored(CompanyGateway $company_gateway) public function restored(CompanyGateway $company_gateway)
{ {
// //When we restore the gateway, bring back the tokens!
ClientGatewayToken::where('company_gateway_id', $company_gateway->id)->withTrashed()->get()->restore();
} }
/** /**

View File

@ -12,6 +12,7 @@
namespace App\PaymentDrivers\Authorize; namespace App\PaymentDrivers\Authorize;
use App\Jobs\Mail\PaymentFailureMailer;
use App\Jobs\Util\SystemLogger; use App\Jobs\Util\SystemLogger;
use App\Models\ClientGatewayToken; use App\Models\ClientGatewayToken;
use App\Models\GatewayType; use App\Models\GatewayType;
@ -87,7 +88,7 @@ class AuthorizeCreditCard
return $this->handleResponse($data, $request); return $this->handleResponse($data, $request);
} }
private function tokenBilling($cgt, $payment_hash) public function tokenBilling($cgt, $payment_hash)
{ {
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total; $amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
@ -95,10 +96,13 @@ class AuthorizeCreditCard
/*Refactor and push to BaseDriver*/ /*Refactor and push to BaseDriver*/
if ($data['response'] != null && $data['response']->getMessages()->getResultCode() == 'Ok') { if ($data['response'] != null && $data['response']->getMessages()->getResultCode() == 'Ok') {
$response = $data['response'];
$this->storePayment($payment_hash, $data); $this->storePayment($payment_hash, $data);
$vars = [ $vars = [
'hashed_ids' => $invoice->hashed_id, 'invoices' => $payment_hash->invoices(),
'amount' => $amount, 'amount' => $amount,
]; ];
@ -111,6 +115,21 @@ class AuthorizeCreditCard
return true; return true;
} else { } else {
$vars = [
'invoices' => $payment_hash->invoices(),
'amount' => $amount,
];
$logger_message = [
'server_response' => $response->getTransactionResponse()->getTransId(),
'data' => $this->formatGatewayResponse($data, $vars),
];
PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransactionResponse()->getTransId(), $this->authorize->client->company, $amount);
SystemLogger::dispatch($logger_message, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
return false; return false;
} }
} }
@ -121,7 +140,6 @@ class AuthorizeCreditCard
$response = $data['response']; $response = $data['response'];
if ($response != null && $response->getMessages()->getResultCode() == 'Ok') { if ($response != null && $response->getMessages()->getResultCode() == 'Ok') {
$this->authorize->confirmGatewayFee($request);
return $this->processSuccessfulResponse($data, $request); return $this->processSuccessfulResponse($data, $request);
} }
@ -138,7 +156,7 @@ class AuthorizeCreditCard
$payment_record = []; $payment_record = [];
$payment_record['amount'] = $amount; $payment_record['amount'] = $amount;
$payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER; $payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;
; $payment_record['gateway_type_id'] = GatewayType::CREDIT_CARD;
$payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId(); $payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId();
$payment = $this->authorize->createPayment($payment_record); $payment = $this->authorize->createPayment($payment_record);
@ -146,21 +164,6 @@ class AuthorizeCreditCard
return $payment; return $payment;
} }
private function createPaymentRecord($data, $amount) :?Payment
{
$response = $data['response'];
//create a payment record
$payment = $this->authorize->createPayment($data['response']);
$payment->gateway_type_id = GatewayType::CREDIT_CARD;
$payment->type_id = PaymentType::CREDIT_CARD_OTHER;
$payment->transaction_reference = $response->getTransactionResponse()->getTransId();
$payment->amount = $amount;
$payment->save();
return $payment;
}
private function processSuccessfulResponse($data, $request) private function processSuccessfulResponse($data, $request)
{ {
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail(); $payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail();
@ -189,6 +192,10 @@ class AuthorizeCreditCard
private function processFailedResponse($data, $request) private function processFailedResponse($data, $request)
{ {
$response = $data['response'];
PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransactionResponse()->getTransId(), $this->authorize->client->company, $data['amount_with_fee']);
throw new \Exception(ctrans('texts.error_title')); throw new \Exception(ctrans('texts.error_title'));
} }

View File

@ -80,7 +80,7 @@ class AuthorizePaymentMethod
public function authorizeCreditCard() public function authorizeCreditCard()
{ {
$data['gateway'] = $this->authorize->company_gateway; $data['gateway'] = $this->authorize;
$data['public_client_id'] = $this->authorize->init()->getPublicClientKey(); $data['public_client_id'] = $this->authorize->init()->getPublicClientKey();
$data['api_login_id'] = $this->authorize->company_gateway->getConfigField('apiLoginId'); $data['api_login_id'] = $this->authorize->company_gateway->getConfigField('apiLoginId');

View File

@ -12,7 +12,9 @@
namespace App\PaymentDrivers\Authorize; namespace App\PaymentDrivers\Authorize;
use App\Jobs\Util\SystemLogger;
use App\Models\Payment; use App\Models\Payment;
use App\Models\SystemLog;
use App\PaymentDrivers\AuthorizePaymentDriver; use App\PaymentDrivers\AuthorizePaymentDriver;
use net\authorize\api\contract\v1\CreateTransactionRequest; use net\authorize\api\contract\v1\CreateTransactionRequest;
use net\authorize\api\contract\v1\CustomerProfilePaymentType; use net\authorize\api\contract\v1\CustomerProfilePaymentType;
@ -73,61 +75,105 @@ class RefundTransaction
$tresponse = $response->getTransactionResponse(); $tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getMessages() != null) { if ($tresponse != null && $tresponse->getMessages() != null) {
return [
$data = [
'transaction_reference' => $tresponse->getTransId(), 'transaction_reference' => $tresponse->getTransId(),
'success' => true, 'success' => true,
'description' => $tresponse->getMessages()[0]->getDescription(), 'description' => $tresponse->getMessages()[0]->getDescription(),
'code' => $tresponse->getMessages()[0]->getCode(), 'code' => $tresponse->getMessages()[0]->getCode(),
'transaction_response' => $tresponse->getResponseCode(), 'transaction_response' => $tresponse->getResponseCode(),
'payment_id' => $payment->id,
'amount' => $amount,
]; ];
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
return $data;
} else { } else {
if ($tresponse->getErrors() != null) { if ($tresponse->getErrors() != null) {
return [
$data = [
'transaction_reference' => '', 'transaction_reference' => '',
'transaction_response' => '', 'transaction_response' => '',
'success' => false, 'success' => false,
'description' => $tresponse->getErrors()[0]->getErrorText(), 'description' => $tresponse->getErrors()[0]->getErrorText(),
'code' => $tresponse->getErrors()[0]->getErrorCode(), 'code' => $tresponse->getErrors()[0]->getErrorCode(),
'payment_id' => $payment->id,
'amount' => $amount,
]; ];
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
return $data;
} }
} }
} else { } else {
echo "Transaction Failed \n"; echo "Transaction Failed \n";
$tresponse = $response->getTransactionResponse(); $tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getErrors() != null) { if ($tresponse != null && $tresponse->getErrors() != null) {
return [
$data = [
'transaction_reference' => '', 'transaction_reference' => '',
'transaction_response' => '', 'transaction_response' => '',
'success' => false, 'success' => false,
'description' => $tresponse->getErrors()[0]->getErrorText(), 'description' => $tresponse->getErrors()[0]->getErrorText(),
'code' => $tresponse->getErrors()[0]->getErrorCode(), 'code' => $tresponse->getErrors()[0]->getErrorCode(),
'payment_id' => $payment->id,
'amount' => $amount,
]; ];
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
return $data;
} else { } else {
return [
$data = [
'transaction_reference' => '', 'transaction_reference' => '',
'transaction_response' => '', 'transaction_response' => '',
'success' => false, 'success' => false,
'description' => $response->getMessages()->getMessage()[0]->getText(), 'description' => $response->getMessages()->getMessage()[0]->getText(),
'code' => $response->getMessages()->getMessage()[0]->getCode(), 'code' => $response->getMessages()->getMessage()[0]->getCode(),
'payment_id' => $payment->id,
'amount' => $amount,
]; ];
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
return $data;
} }
} }
} else { } else {
return [
$data = [
'transaction_reference' => '', 'transaction_reference' => '',
'transaction_response' => '', 'transaction_response' => '',
'success' => false, 'success' => false,
'description' => 'No response returned', 'description' => 'No response returned',
'code' => 'No response returned', 'code' => 'No response returned',
'payment_id' => $payment->id,
'amount' => $amount,
]; ];
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
return $data;
} }
return [ $data = [
'transaction_reference' => '', 'transaction_reference' => '',
'transaction_response' => '', 'transaction_response' => '',
'success' => false, 'success' => false,
'description' => 'No response returned', 'description' => 'No response returned',
'code' => 'No response returned', 'code' => 'No response returned',
'payment_id' => $payment->id,
'amount' => $amount,
]; ];
SystemLogger::dispatch($data, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client);
} }
} }

View File

@ -202,12 +202,15 @@ class BaseDriver extends AbstractPaymentDriver
*/ */
public function createPayment($data, $status = Payment::STATUS_COMPLETED): Payment public function createPayment($data, $status = Payment::STATUS_COMPLETED): Payment
{ {
$this->confirmGatewayFee();
$payment = PaymentFactory::create($this->client->company->id, $this->client->user->id); $payment = PaymentFactory::create($this->client->company->id, $this->client->user->id);
$payment->client_id = $this->client->id; $payment->client_id = $this->client->id;
$payment->company_gateway_id = $this->company_gateway->id; $payment->company_gateway_id = $this->company_gateway->id;
$payment->status_id = $status; $payment->status_id = $status;
$payment->currency_id = $this->client->getSetting('currency_id'); $payment->currency_id = $this->client->getSetting('currency_id');
$payment->date = Carbon::now(); $payment->date = Carbon::now();
$payment->gateway_type_id = $data['gateway_type_id'];
$client_contact = $this->getContact(); $client_contact = $this->getContact();
$client_contact_id = $client_contact ? $client_contact->id : null; $client_contact_id = $client_contact ? $client_contact->id : null;
@ -243,19 +246,14 @@ class BaseDriver extends AbstractPaymentDriver
* @param PaymentResponseRequest $request The incoming payment request * @param PaymentResponseRequest $request The incoming payment request
* @return void Success/Failure * @return void Success/Failure
*/ */
public function confirmGatewayFee(PaymentResponseRequest $request) :void public function confirmGatewayFee() :void
{ {
/*Payment meta data*/
$payment_hash = $request->getPaymentHash();
/*Payment invoices*/ /*Payment invoices*/
$payment_invoices = $payment_hash->invoices(); $payment_invoices = $this->payment_hash->invoices();
/*Fee charged at gateway*/ /*Fee charged at gateway*/
$fee_total = $payment_hash->fee_total; $fee_total = $this->payment_hash->fee_total;
// Sum of invoice amounts
// $invoice_totals = array_sum(array_column($payment_invoices,'amount'));
/*Hydrate invoices*/ /*Hydrate invoices*/
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($payment_invoices, 'invoice_id')))->get(); $invoices = Invoice::whereIn('id', $this->transformKeys(array_column($payment_invoices, 'invoice_id')))->get();

View File

@ -13,6 +13,7 @@
namespace App\PaymentDrivers\CheckoutCom; namespace App\PaymentDrivers\CheckoutCom;
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest; use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
use App\Jobs\Mail\PaymentFailureMailer;
use App\PaymentDrivers\CheckoutComPaymentDriver; use App\PaymentDrivers\CheckoutComPaymentDriver;
use Checkout\Library\Exceptions\CheckoutHttpException; use Checkout\Library\Exceptions\CheckoutHttpException;
use Checkout\Models\Payments\IdSource; use Checkout\Models\Payments\IdSource;
@ -141,7 +142,6 @@ class CreditCard
$response = $this->checkout->gateway->payments()->request($payment); $response = $this->checkout->gateway->payments()->request($payment);
if ($response->status == 'Authorized') { if ($response->status == 'Authorized') {
$this->checkout->confirmGatewayFee($request);
return $this->processSuccessfulPayment($response); return $this->processSuccessfulPayment($response);
} }
@ -155,11 +155,14 @@ class CreditCard
if ($response->status == 'Declined') { if ($response->status == 'Declined') {
$this->checkout->unWindGatewayFees($this->checkout->payment_hash); $this->checkout->unWindGatewayFees($this->checkout->payment_hash);
PaymentFailureMailer::dispatch($this->checkout->client, $response->response_summary, $this->checkout->client->company, $this->checkout->payment_hash->data->value);
return $this->processUnsuccessfulPayment($response); return $this->processUnsuccessfulPayment($response);
} }
} catch (CheckoutHttpException $e) { } catch (CheckoutHttpException $e) {
$this->checkout->unWindGatewayFees($this->checkout->payment_hash);
$this->checkout->unWindGatewayFees($this->checkout->payment_hash);
return $this->checkout->processInternallyFailedPayment($this->checkout, $e); return $this->checkout->processInternallyFailedPayment($this->checkout, $e);
} }
} }

View File

@ -130,6 +130,7 @@ class PayPalExpressPaymentDriver extends BaseDriver
'payment_type' => PaymentType::PAYPAL, 'payment_type' => PaymentType::PAYPAL,
'amount' => $this->payment_hash->data->amount, 'amount' => $this->payment_hash->data->amount,
'transaction_reference' => $response->getTransactionReference(), 'transaction_reference' => $response->getTransactionReference(),
'gateway_type_id' => GatewayType::PAYPAL,
]; ];
$payment = $this->createPayment($data, \App\Models\Payment::STATUS_COMPLETED); $payment = $this->createPayment($data, \App\Models\Payment::STATUS_COMPLETED);

View File

@ -157,6 +157,7 @@ class ACH
'payment_type' => PaymentType::ACH, 'payment_type' => PaymentType::ACH,
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->amount, $this->stripe->client->currency()->precision), 'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->amount, $this->stripe->client->currency()->precision),
'transaction_reference' => $state['charge']->id, 'transaction_reference' => $state['charge']->id,
'gateway_type_id' => GatewayType::BANK_TRANSFER,
]; ];
$payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);
@ -174,7 +175,6 @@ class ACH
public function processUnsuccessfulPayment($state) public function processUnsuccessfulPayment($state)
{ {
PaymentFailureMailer::dispatch($this->stripe->client, $state['charge']->failure_message, $this->stripe->client->company, $state['amount']);
PaymentFailureMailer::dispatch( PaymentFailureMailer::dispatch(
$this->stripe->client, $this->stripe->client,

View File

@ -76,6 +76,8 @@ class Alipay
'payment_type' => PaymentType::ALIPAY, 'payment_type' => PaymentType::ALIPAY,
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision), 'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision),
'transaction_reference' => $source, 'transaction_reference' => $source,
'gateway_type_id' => GatewayType::ALIPAY,
]; ];
$payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);

View File

@ -172,23 +172,18 @@ class Charge
$data = [ $data = [
'gateway_type_id' => $cgt->gateway_type_id, 'gateway_type_id' => $cgt->gateway_type_id,
'type_id' => $this->transformPaymentTypeToConstant($payment_method_type), 'payment_type' => $this->transformPaymentTypeToConstant($payment_method_type),
'transaction_reference' => $response->charges->data[0]->id, 'transaction_reference' => $response->charges->data[0]->id,
'amount' => $amount,
]; ];
$payment = $this->stripe->createPaymentRecord($data, $amount); $payment = $this->stripe->createPayment($data);
$payment->meta = $cgt->meta; $payment->meta = $cgt->meta;
$payment->save(); $payment->save();
$payment_hash->payment_id = $payment->id; $payment_hash->payment_id = $payment->id;
$payment_hash->save(); $payment_hash->save();
$this->stripe->attachInvoices($payment, $payment_hash);
$payment->service()->updateInvoicePayment($payment_hash);
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
return $payment; return $payment;
} }

View File

@ -95,7 +95,6 @@ class CreditCard
$server_response = $this->stripe->payment_hash->data->server_response; $server_response = $this->stripe->payment_hash->data->server_response;
if ($server_response->status == 'succeeded') { if ($server_response->status == 'succeeded') {
$this->stripe->confirmGatewayFee($request);
$this->stripe->logSuccessfulGatewayResponse(['response' => json_decode($request->gateway_response), 'data' => $this->stripe->payment_hash], SystemLog::TYPE_STRIPE); $this->stripe->logSuccessfulGatewayResponse(['response' => json_decode($request->gateway_response), 'data' => $this->stripe->payment_hash], SystemLog::TYPE_STRIPE);
@ -114,6 +113,7 @@ class CreditCard
'payment_type' => PaymentType::parseCardType(strtolower($stripe_method->card->brand)), 'payment_type' => PaymentType::parseCardType(strtolower($stripe_method->card->brand)),
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->server_response->amount, $this->stripe->client->currency()->precision), 'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->server_response->amount, $this->stripe->client->currency()->precision),
'transaction_reference' => optional($this->stripe->payment_hash->data->payment_intent->charges->data[0])->id, 'transaction_reference' => optional($this->stripe->payment_hash->data->payment_intent->charges->data[0])->id,
'gateway_type_id' => GatewayType::CREDIT_CARD,
]; ];

View File

@ -82,6 +82,7 @@ class SOFORT
'payment_type' => PaymentType::SOFORT, 'payment_type' => PaymentType::SOFORT,
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision), 'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision),
'transaction_reference' => $source, 'transaction_reference' => $source,
'gateway_type_id' => GatewayType::SOFORT,
]; ];
$payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);

View File

@ -95,32 +95,17 @@ class StripePaymentDriver extends BaseDriver
{ {
$types = [ $types = [
GatewayType::CREDIT_CARD, GatewayType::CREDIT_CARD,
GatewayType::BANK_TRANSFER,
GatewayType::CRYPTO,
GatewayType::ALIPAY,
// GatewayType::SEPA, // TODO: Missing implementation
// GatewayType::APPLE_PAY, // TODO:: Missing implementation
]; ];
if ($this->company_gateway->getSofortEnabled() && $this->invitation && $this->client() && isset($this->client()->country) && in_array($this->client()->country, ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'])) { if ($this->company_gateway->getSofortEnabled() && $this->invitation && $this->client() && isset($this->client()->country) && in_array($this->client()->country, ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'])) {
$types[] = GatewayType::SOFORT; $types[] = GatewayType::SOFORT;
} }
if ($this->company_gateway->getAchEnabled()) {
$types[] = GatewayType::BANK_TRANSFER;
}
if ($this->company_gateway->getSepaEnabled()) {
$types[] = GatewayType::SEPA;
}
if ($this->company_gateway->getBitcoinEnabled()) {
$types[] = GatewayType::CRYPTO;
}
if ($this->company_gateway->getAlipayEnabled()) {
$types[] = GatewayType::ALIPAY;
}
if ($this->company_gateway->getApplePayEnabled()) {
$types[] = GatewayType::APPLE_PAY;
}
return $types; return $types;
} }
@ -190,7 +175,7 @@ class StripePaymentDriver extends BaseDriver
return $this->payment_method->paymentView($data); return $this->payment_method->paymentView($data);
} }
public function processPaymentResponse($request) //We never have to worry about unsuccessful payments as failures are handled at the front end for this driver. public function processPaymentResponse($request)
{ {
return $this->payment_method->paymentResponse($request); return $this->payment_method->paymentResponse($request);
} }
@ -340,31 +325,6 @@ class StripePaymentDriver extends BaseDriver
return (new Charge($this))->tokenBilling($cgt, $payment_hash); return (new Charge($this))->tokenBilling($cgt, $payment_hash);
} }
/**
* Creates a payment record for the given
* data array.
*
* @param array $data An array of payment attributes
* @param float $amount The amount of the payment
* @return Payment The payment object
*/
public function createPaymentRecord($data, $amount): ?Payment
{
$payment = PaymentFactory::create($this->client->company_id, $this->client->user_id);
$payment->client_id = $this->client->id;
$payment->company_gateway_id = $this->company_gateway->id;
$payment->status_id = Payment::STATUS_COMPLETED;
$payment->gateway_type_id = $data['gateway_type_id'];
$payment->type_id = $data['type_id'];
$payment->currency_id = $this->client->getSetting('currency_id');
$payment->date = Carbon::now();
$payment->transaction_reference = $data['transaction_reference'];
$payment->amount = $amount;
$payment->save();
return $payment->service()->applyNumber()->save();
}
/** /**
* Attach Stripe payment method to Stripe client. * Attach Stripe payment method to Stripe client.
* *

View File

@ -89,7 +89,6 @@ class PaymentMethod
} }
return $this; return $this;
} }
@ -108,7 +107,7 @@ class PaymentMethod
->company ->company
->company_gateways ->company_gateways
->whereIn('id', $transformed_ids) ->whereIn('id', $transformed_ids)
->where('gateway_key', '=', '54faab2ab6e3223dbe848b1686490baa') ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
return array_search($model->id, $transformed_ids);// this closure sorts for us return array_search($model->id, $transformed_ids);// this closure sorts for us
}); });
@ -118,7 +117,7 @@ class PaymentMethod
$this->gateways = $this->client $this->gateways = $this->client
->company ->company
->company_gateways ->company_gateways
->where('gateway_key', '=', '54faab2ab6e3223dbe848b1686490baa') ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
->where('is_deleted', false); ->where('is_deleted', false);
} }
@ -134,10 +133,15 @@ class PaymentMethod
$this->payment_methods = []; $this->payment_methods = [];
foreach ($this->gateways as $gateway) { foreach ($this->gateways as $gateway) {
foreach ($gateway->driver($this->client)->gatewayTypes() as $type) { foreach ($gateway->driver($this->client)->gatewayTypes() as $type) {
if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) {
if ($this->validGatewayForAmount($gateway->fees_and_limits->{$type}, $this->amount) && $gateway->fees_and_limits->{$type}->is_enabled) { if ($this->validGatewayForAmount($gateway->fees_and_limits->{$type}, $this->amount) && $gateway->fees_and_limits->{$type}->is_enabled) {
if($type == GatewayType::BANK_TRANSFER);
$this->payment_methods[] = [$gateway->id => $type]; $this->payment_methods[] = [$gateway->id => $type];
} }
@ -158,13 +162,16 @@ class PaymentMethod
//note we have to use GatewayType::CREDIT_CARD as alias for CUSTOM //note we have to use GatewayType::CREDIT_CARD as alias for CUSTOM
foreach ($this->gateways as $gateway) { foreach ($this->gateways as $gateway) {
foreach ($gateway->driver($this->client)->gatewayTypes() as $type) { foreach ($gateway->driver($this->client)->gatewayTypes() as $type) {
if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) { if (isset($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, $type)) {
if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $this->amount)) {
$this->payment_methods->push([$gateway->id => $type]); if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $this->amount))
} $this->payment_methods[] = [$gateway->id => $type];
} else { } else {
$this->payment_methods->push([$gateway->id => NULL]); $this->payment_methods[] = [$gateway->id => NULL];
} }
} }
} }

View File

@ -41,9 +41,8 @@ class AutoBillInvoice extends AbstractService
public function run() public function run()
{ {
/* Is the invoice payable? */ /* Is the invoice payable? */
if (! $this->invoice->isPayable()) { if (! $this->invoice->isPayable())
return $this->invoice; return $this->invoice;
}
/* Mark the invoice as sent */ /* Mark the invoice as sent */
$this->invoice = $this->invoice->service()->markSent()->save(); $this->invoice = $this->invoice->service()->markSent()->save();
@ -67,6 +66,7 @@ class AutoBillInvoice extends AbstractService
info("balance remains to be paid!!"); info("balance remains to be paid!!");
/* Retrieve the Client Gateway Token */
$gateway_token = $this->getGateway($amount); $gateway_token = $this->getGateway($amount);
/* Bail out if no payment methods available */ /* Bail out if no payment methods available */
@ -74,7 +74,10 @@ class AutoBillInvoice extends AbstractService
return $this->invoice; return $this->invoice;
/* $gateway fee */ /* $gateway fee */
$fee = $gateway_token->gateway->calcGatewayFee($amount, $gateway_token->gateway_type_id, $this->invoice->uses_inclusive_taxes); //$fee = $gateway_token->gateway->calcGatewayFee($amount, $gateway_token->gateway_type_id, $this->invoice->uses_inclusive_taxes);
$this->invoice = $this->invoice->service()->addGatewayFee($gateway_token->gateway, $gateway_token->gateway_type_id, $amount)->save();
$fee = $this->invoice->amount - $amount;
/* Build payment hash */ /* Build payment hash */
$payment_hash = PaymentHash::create([ $payment_hash = PaymentHash::create([
@ -86,6 +89,7 @@ class AutoBillInvoice extends AbstractService
$payment = $gateway_token->gateway $payment = $gateway_token->gateway
->driver($this->client) ->driver($this->client)
->setPaymentHash($payment_hash)
->tokenBilling($gateway_token, $payment_hash); ->tokenBilling($gateway_token, $payment_hash);
return $this->invoice; return $this->invoice;

View File

@ -309,13 +309,13 @@ class Design extends BaseDesign
foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) { foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
if (array_key_exists($column, $aliases)) { if (array_key_exists($column, $aliases)) {
$elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['hidden' => $this->client->company->hide_empty_columns_on_pdf]]; $elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['hidden' => $this->client->getSetting('hide_empty_columns_on_pdf')]];
} elseif ($column == '$product.discount' && !$this->client->company->enable_product_discount) { } elseif ($column == '$product.discount' && !$this->client->company->enable_product_discount) {
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']]; $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']];
} elseif ($column == '$product.quantity' && !$this->client->company->enable_product_quantity) { } elseif ($column == '$product.quantity' && !$this->client->company->enable_product_quantity) {
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']]; $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']];
} else { } else {
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'hidden' => $this->client->company->hide_empty_columns_on_pdf]]; $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'hidden' => $this->client->getSetting('hide_empty_columns_on_pdf')]];
} }
} }

View File

@ -276,7 +276,7 @@ class HtmlEngine
$data['$company.website'] = ['value' => $this->settings->website ?: '&nbsp;', 'label' => ctrans('texts.website')]; $data['$company.website'] = ['value' => $this->settings->website ?: '&nbsp;', 'label' => ctrans('texts.website')];
$data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: '&nbsp;', 'label' => ctrans('texts.address')]; $data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: '&nbsp;', 'label' => ctrans('texts.address')];
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->custom1, $this->entity->number, $this->entity->balance), 'label' => '']; $data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->currency()->code, $this->entity->number, $this->entity->balance), 'label' => ''];
$logo = $this->company->present()->logo($this->settings); $logo = $this->company->present()->logo($this->settings);

View File

@ -70,6 +70,7 @@
"php": "^7.4", "php": "^7.4",
"anahkiasen/former": "^4.2", "anahkiasen/former": "^4.2",
"barryvdh/laravel-debugbar": "^3.4", "barryvdh/laravel-debugbar": "^3.4",
"brianium/paratest": "^6.1",
"darkaonline/l5-swagger": "^8.0", "darkaonline/l5-swagger": "^8.0",
"facade/ignition": "^2.3.6", "facade/ignition": "^2.3.6",
"filp/whoops": "^2.7", "filp/whoops": "^2.7",

429
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": "94ab2953278081e3fdf663e1e7cf14c4", "content-hash": "d7265c55f98aa6cfeb2cfd26bd438c7f",
"packages": [ "packages": [
{ {
"name": "asgrim/ofxparser", "name": "asgrim/ofxparser",
@ -116,16 +116,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.171.20", "version": "3.172.1",
"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": "02aaf7007c5678a6358ea924cd85531300aa1747" "reference": "28a0929598be6e9e0b652091712068d37acd9d0a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/02aaf7007c5678a6358ea924cd85531300aa1747", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/28a0929598be6e9e0b652091712068d37acd9d0a",
"reference": "02aaf7007c5678a6358ea924cd85531300aa1747", "reference": "28a0929598be6e9e0b652091712068d37acd9d0a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -200,9 +200,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.171.20" "source": "https://github.com/aws/aws-sdk-php/tree/3.172.1"
}, },
"time": "2021-01-19T19:13:08+00:00" "time": "2021-01-26T19:11:49+00:00"
}, },
{ {
"name": "beganovich/snappdf", "name": "beganovich/snappdf",
@ -259,26 +259,26 @@
}, },
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.9.1", "version": "0.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/brick/math.git", "url": "https://github.com/brick/math.git",
"reference": "283a40c901101e66de7061bd359252c013dcc43c" "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/283a40c901101e66de7061bd359252c013dcc43c", "url": "https://api.github.com/repos/brick/math/zipball/dff976c2f3487d42c1db75a3b180e2b9f0e72ce0",
"reference": "283a40c901101e66de7061bd359252c013dcc43c", "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"php": "^7.1|^8.0" "php": "^7.1 || ^8.0"
}, },
"require-dev": { "require-dev": {
"php-coveralls/php-coveralls": "^2.2", "php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^7.5.15|^8.5", "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0",
"vimeo/psalm": "^3.5" "vimeo/psalm": "4.3.2"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -303,7 +303,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/brick/math/issues", "issues": "https://github.com/brick/math/issues",
"source": "https://github.com/brick/math/tree/master" "source": "https://github.com/brick/math/tree/0.9.2"
}, },
"funding": [ "funding": [
{ {
@ -311,7 +311,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-08-18T23:57:15+00:00" "time": "2021-01-20T22:51:39+00:00"
}, },
{ {
"name": "checkout/checkout-sdk-php", "name": "checkout/checkout-sdk-php",
@ -436,12 +436,12 @@
"version": "v1.5.0", "version": "v1.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/clue/php-stream-filter.git", "url": "https://github.com/clue/stream-filter.git",
"reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/clue/php-stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320",
"reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320",
"shasum": "" "shasum": ""
}, },
@ -482,8 +482,8 @@
"stream_filter_register" "stream_filter_register"
], ],
"support": { "support": {
"issues": "https://github.com/clue/php-stream-filter/issues", "issues": "https://github.com/clue/stream-filter/issues",
"source": "https://github.com/clue/php-stream-filter/tree/v1.5.0" "source": "https://github.com/clue/stream-filter/tree/v1.5.0"
}, },
"funding": [ "funding": [
{ {
@ -2665,16 +2665,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v8.23.1", "version": "v8.25.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "a813df1b248ca305e5f5ce23ea981ed6c6905504" "reference": "05da44d6823c2923597519ac10151f5827a24f80"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/a813df1b248ca305e5f5ce23ea981ed6c6905504", "url": "https://api.github.com/repos/laravel/framework/zipball/05da44d6823c2923597519ac10151f5827a24f80",
"reference": "a813df1b248ca305e5f5ce23ea981ed6c6905504", "reference": "05da44d6823c2923597519ac10151f5827a24f80",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2761,6 +2761,7 @@
}, },
"suggest": { "suggest": {
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).", "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).",
"brianium/paratest": "Required to run tests in parallel (^6.0).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).",
"ext-ftp": "Required to use the Flysystem FTP driver.", "ext-ftp": "Required to use the Flysystem FTP driver.",
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
@ -2828,20 +2829,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": "2021-01-19T14:10:48+00:00" "time": "2021-01-26T14:40:21+00:00"
}, },
{ {
"name": "laravel/slack-notification-channel", "name": "laravel/slack-notification-channel",
"version": "v2.3.0", "version": "v2.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/slack-notification-channel.git", "url": "https://github.com/laravel/slack-notification-channel.git",
"reference": "f8a3893d9de36b86e941dac76c06c28141209970" "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/f8a3893d9de36b86e941dac76c06c28141209970", "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20",
"reference": "f8a3893d9de36b86e941dac76c06c28141209970", "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2887,9 +2888,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/laravel/slack-notification-channel/issues", "issues": "https://github.com/laravel/slack-notification-channel/issues",
"source": "https://github.com/laravel/slack-notification-channel/tree/v2.3.0" "source": "https://github.com/laravel/slack-notification-channel/tree/v2.3.1"
}, },
"time": "2020-11-03T19:18:22+00:00" "time": "2021-01-26T20:04:54+00:00"
}, },
{ {
"name": "laravel/socialite", "name": "laravel/socialite",
@ -3594,30 +3595,30 @@
}, },
{ {
"name": "league/oauth1-client", "name": "league/oauth1-client",
"version": "v1.8.2", "version": "v1.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/oauth1-client.git", "url": "https://github.com/thephpleague/oauth1-client.git",
"reference": "159c3d2bf27568f9af87d6c3f4bb616a251eb12b" "reference": "1e7e6be2dc543bf466236fb171e5b20e1b06aee6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/159c3d2bf27568f9af87d6c3f4bb616a251eb12b", "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/1e7e6be2dc543bf466236fb171e5b20e1b06aee6",
"reference": "159c3d2bf27568f9af87d6c3f4bb616a251eb12b", "reference": "1e7e6be2dc543bf466236fb171e5b20e1b06aee6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"ext-openssl": "*", "ext-openssl": "*",
"guzzlehttp/guzzle": "^6.0|^7.0", "guzzlehttp/guzzle": "^6.0|^7.0",
"php": ">=7.1" "php": ">=7.1||>=8.0"
}, },
"require-dev": { "require-dev": {
"ext-simplexml": "*", "ext-simplexml": "*",
"friendsofphp/php-cs-fixer": "^2.16.1", "friendsofphp/php-cs-fixer": "^2.17",
"mockery/mockery": "^1.3", "mockery/mockery": "^1.3.3",
"phpstan/phpstan": "^0.12.42", "phpstan/phpstan": "^0.12.42",
"phpunit/phpunit": "^7.5" "phpunit/phpunit": "^7.5||9.5"
}, },
"suggest": { "suggest": {
"ext-simplexml": "For decoding XML-based responses." "ext-simplexml": "For decoding XML-based responses."
@ -3663,9 +3664,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/oauth1-client/issues", "issues": "https://github.com/thephpleague/oauth1-client/issues",
"source": "https://github.com/thephpleague/oauth1-client/tree/v1.8.2" "source": "https://github.com/thephpleague/oauth1-client/tree/v1.9.0"
}, },
"time": "2020-09-28T09:39:08+00:00" "time": "2021-01-20T01:40:53+00:00"
}, },
{ {
"name": "league/omnipay", "name": "league/omnipay",
@ -3726,16 +3727,16 @@
}, },
{ {
"name": "livewire/livewire", "name": "livewire/livewire",
"version": "v2.3.6", "version": "v2.3.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/livewire/livewire.git", "url": "https://github.com/livewire/livewire.git",
"reference": "8663232c198ef12964b62559e9bb2023eb86701d" "reference": "c661e295428b2baaff04320d0a9424db5ca72be5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/8663232c198ef12964b62559e9bb2023eb86701d", "url": "https://api.github.com/repos/livewire/livewire/zipball/c661e295428b2baaff04320d0a9424db5ca72be5",
"reference": "8663232c198ef12964b62559e9bb2023eb86701d", "reference": "c661e295428b2baaff04320d0a9424db5ca72be5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3786,7 +3787,7 @@
"description": "A front-end framework for Laravel.", "description": "A front-end framework for Laravel.",
"support": { "support": {
"issues": "https://github.com/livewire/livewire/issues", "issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v2.3.6" "source": "https://github.com/livewire/livewire/tree/v2.3.8"
}, },
"funding": [ "funding": [
{ {
@ -3794,7 +3795,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-01-08T17:33:29+00:00" "time": "2021-01-21T14:01:48+00:00"
}, },
{ {
"name": "maennchen/zipstream-php", "name": "maennchen/zipstream-php",
@ -4678,33 +4679,29 @@
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
"version": "v2.0.19", "version": "v9.99.100",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/paragonie/random_compat.git", "url": "https://github.com/paragonie/random_compat.git",
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241" "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241", "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241", "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.2.0" "php": ">= 7"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "4.*|5.*" "phpunit/phpunit": "4.*|5.*",
"vimeo/psalm": "^1"
}, },
"suggest": { "suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
}, },
"type": "library", "type": "library",
"autoload": {
"files": [
"lib/random.php"
]
},
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
@ -4728,7 +4725,7 @@
"issues": "https://github.com/paragonie/random_compat/issues", "issues": "https://github.com/paragonie/random_compat/issues",
"source": "https://github.com/paragonie/random_compat" "source": "https://github.com/paragonie/random_compat"
}, },
"time": "2020-10-15T10:06:57+00:00" "time": "2020-10-15T08:29:30+00:00"
}, },
{ {
"name": "php-http/client-common", "name": "php-http/client-common",
@ -5254,21 +5251,21 @@
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
"version": "3.0.3", "version": "3.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpseclib/phpseclib.git", "url": "https://github.com/phpseclib/phpseclib.git",
"reference": "97a5a270e4a9ebfc1a7e2f462e917cbce1a8e6d9" "reference": "845a2275e886ba9fb386c8f59cb383dd9c8963e9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/97a5a270e4a9ebfc1a7e2f462e917cbce1a8e6d9", "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/845a2275e886ba9fb386c8f59cb383dd9c8963e9",
"reference": "97a5a270e4a9ebfc1a7e2f462e917cbce1a8e6d9", "reference": "845a2275e886ba9fb386c8f59cb383dd9c8963e9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"paragonie/constant_time_encoding": "^1|^2", "paragonie/constant_time_encoding": "^1|^2",
"paragonie/random_compat": "^1.4|^2.0", "paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php": ">=5.6.1" "php": ">=5.6.1"
}, },
"require-dev": { "require-dev": {
@ -5345,7 +5342,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpseclib/phpseclib/issues", "issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.3" "source": "https://github.com/phpseclib/phpseclib/tree/3.0.4"
}, },
"funding": [ "funding": [
{ {
@ -5361,7 +5358,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-01-16T17:35:19+00:00" "time": "2021-01-25T19:02:05+00:00"
}, },
{ {
"name": "predis/predis", "name": "predis/predis",
@ -5977,16 +5974,16 @@
}, },
{ {
"name": "ramsey/collection", "name": "ramsey/collection",
"version": "1.1.1", "version": "1.1.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/collection.git", "url": "https://github.com/ramsey/collection.git",
"reference": "24d93aefb2cd786b7edd9f45b554aea20b28b9b1" "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/collection/zipball/24d93aefb2cd786b7edd9f45b554aea20b28b9b1", "url": "https://api.github.com/repos/ramsey/collection/zipball/28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1",
"reference": "24d93aefb2cd786b7edd9f45b554aea20b28b9b1", "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5996,19 +5993,19 @@
"captainhook/captainhook": "^5.3", "captainhook/captainhook": "^5.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"ergebnis/composer-normalize": "^2.6", "ergebnis/composer-normalize": "^2.6",
"fzaninotto/faker": "^1.5", "fakerphp/faker": "^1.5",
"hamcrest/hamcrest-php": "^2", "hamcrest/hamcrest-php": "^2",
"jangregor/phpstan-prophecy": "^0.6", "jangregor/phpstan-prophecy": "^0.8",
"mockery/mockery": "^1.3", "mockery/mockery": "^1.3",
"phpstan/extension-installer": "^1", "phpstan/extension-installer": "^1",
"phpstan/phpstan": "^0.12.32", "phpstan/phpstan": "^0.12.32",
"phpstan/phpstan-mockery": "^0.12.5", "phpstan/phpstan-mockery": "^0.12.5",
"phpstan/phpstan-phpunit": "^0.12.11", "phpstan/phpstan-phpunit": "^0.12.11",
"phpunit/phpunit": "^8.5", "phpunit/phpunit": "^8.5 || ^9",
"psy/psysh": "^0.10.4", "psy/psysh": "^0.10.4",
"slevomat/coding-standard": "^6.3", "slevomat/coding-standard": "^6.3",
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^3.12.2" "vimeo/psalm": "^4.4"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -6038,15 +6035,19 @@
], ],
"support": { "support": {
"issues": "https://github.com/ramsey/collection/issues", "issues": "https://github.com/ramsey/collection/issues",
"source": "https://github.com/ramsey/collection/tree/1.1.1" "source": "https://github.com/ramsey/collection/tree/1.1.3"
}, },
"funding": [ "funding": [
{ {
"url": "https://github.com/ramsey", "url": "https://github.com/ramsey",
"type": "github" "type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/ramsey/collection",
"type": "tidelift"
} }
], ],
"time": "2020-09-10T20:58:17+00:00" "time": "2021-01-21T17:40:04+00:00"
}, },
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
@ -6484,16 +6485,16 @@
}, },
{ {
"name": "sentry/sentry", "name": "sentry/sentry",
"version": "3.1.2", "version": "3.1.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-php.git", "url": "https://github.com/getsentry/sentry-php.git",
"reference": "e9b2d45b248d75f4c79a9d166b13b947b72f01fa" "reference": "db8a322f87983bb4f3cd8db01f9a9a593efe72a3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/e9b2d45b248d75f4c79a9d166b13b947b72f01fa", "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/db8a322f87983bb4f3cd8db01f9a9a593efe72a3",
"reference": "e9b2d45b248d75f4c79a9d166b13b947b72f01fa", "reference": "db8a322f87983bb4f3cd8db01f9a9a593efe72a3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6573,7 +6574,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-php/issues", "issues": "https://github.com/getsentry/sentry-php/issues",
"source": "https://github.com/getsentry/sentry-php/tree/3.1.2" "source": "https://github.com/getsentry/sentry-php/tree/3.1.3"
}, },
"funding": [ "funding": [
{ {
@ -6585,7 +6586,7 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2021-01-07T18:51:44+00:00" "time": "2021-01-25T08:47:45+00:00"
}, },
{ {
"name": "sentry/sentry-laravel", "name": "sentry/sentry-laravel",
@ -6675,16 +6676,16 @@
}, },
{ {
"name": "stripe/stripe-php", "name": "stripe/stripe-php",
"version": "v7.68.0", "version": "v7.69.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/stripe/stripe-php.git", "url": "https://github.com/stripe/stripe-php.git",
"reference": "36b10e1f0e9d973f00f802bbd098bce85d0438e4" "reference": "6716cbc4ebf8cba7d45374a059c7c6e5bf53277d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/36b10e1f0e9d973f00f802bbd098bce85d0438e4", "url": "https://api.github.com/repos/stripe/stripe-php/zipball/6716cbc4ebf8cba7d45374a059c7c6e5bf53277d",
"reference": "36b10e1f0e9d973f00f802bbd098bce85d0438e4", "reference": "6716cbc4ebf8cba7d45374a059c7c6e5bf53277d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6730,9 +6731,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/stripe/stripe-php/issues", "issues": "https://github.com/stripe/stripe-php/issues",
"source": "https://github.com/stripe/stripe-php/tree/v7.68.0" "source": "https://github.com/stripe/stripe-php/tree/v7.69.0"
}, },
"time": "2021-01-15T00:38:28+00:00" "time": "2021-01-22T03:21:13+00:00"
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
@ -9461,16 +9462,16 @@
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
"version": "v5.2.0", "version": "v5.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vlucas/phpdotenv.git", "url": "https://github.com/vlucas/phpdotenv.git",
"reference": "fba64139db67123c7a57072e5f8d3db10d160b66" "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/fba64139db67123c7a57072e5f8d3db10d160b66", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56",
"reference": "fba64139db67123c7a57072e5f8d3db10d160b66", "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9485,7 +9486,7 @@
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1", "bamarni/composer-bin-plugin": "^1.4.1",
"ext-filter": "*", "ext-filter": "*",
"phpunit/phpunit": "^7.5.20 || ^8.5.2 || ^9.0" "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1"
}, },
"suggest": { "suggest": {
"ext-filter": "Required to use the boolean validator." "ext-filter": "Required to use the boolean validator."
@ -9493,7 +9494,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "5.2-dev" "dev-master": "5.3-dev"
} }
}, },
"autoload": { "autoload": {
@ -9525,7 +9526,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/vlucas/phpdotenv/issues", "issues": "https://github.com/vlucas/phpdotenv/issues",
"source": "https://github.com/vlucas/phpdotenv/tree/v5.2.0" "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0"
}, },
"funding": [ "funding": [
{ {
@ -9537,7 +9538,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-14T15:57:31+00:00" "time": "2021-01-20T15:23:13+00:00"
}, },
{ {
"name": "voku/portable-ascii", "name": "voku/portable-ascii",
@ -9618,12 +9619,12 @@
"version": "1.9.1", "version": "1.9.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozart/assert.git", "url": "https://github.com/webmozarts/assert.git",
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": "" "shasum": ""
}, },
@ -9661,8 +9662,8 @@
"validate" "validate"
], ],
"support": { "support": {
"issues": "https://github.com/webmozart/assert/issues", "issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozart/assert/tree/master" "source": "https://github.com/webmozarts/assert/tree/1.9.1"
}, },
"time": "2020-07-08T17:02:28+00:00" "time": "2020-07-08T17:02:28+00:00"
}, },
@ -10100,6 +10101,86 @@
], ],
"time": "2021-01-06T14:21:44+00:00" "time": "2021-01-06T14:21:44+00:00"
}, },
{
"name": "brianium/paratest",
"version": "v6.1.2",
"source": {
"type": "git",
"url": "https://github.com/paratestphp/paratest.git",
"reference": "235db99a43401d68fdc4495b20b49291ea2e767d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/235db99a43401d68fdc4495b20b49291ea2e767d",
"reference": "235db99a43401d68fdc4495b20b49291ea2e767d",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-simplexml": "*",
"php": "^7.3 || ^8.0",
"phpunit/php-code-coverage": "^9.2.5",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-timer": "^5.0.3",
"phpunit/phpunit": "^9.5.0",
"sebastian/environment": "^5.1.3",
"symfony/console": "^4.4 || ^5.2",
"symfony/process": "^4.4 || ^5.2"
},
"require-dev": {
"doctrine/coding-standard": "^8.2.0",
"ekino/phpstan-banned-code": "^0.3.1",
"ergebnis/phpstan-rules": "^0.15.3",
"ext-posix": "*",
"infection/infection": "^0.18.2",
"phpstan/phpstan": "^0.12.58",
"phpstan/phpstan-deprecation-rules": "^0.12.5",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpstan/phpstan-strict-rules": "^0.12.5",
"squizlabs/php_codesniffer": "^3.5.8",
"symfony/filesystem": "^5.2.0",
"thecodingmachine/phpstan-strict-rules": "^0.12.1",
"vimeo/psalm": "^4.3.1"
},
"bin": [
"bin/paratest"
],
"type": "library",
"autoload": {
"psr-4": {
"ParaTest\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Brian Scaturro",
"email": "scaturrob@gmail.com",
"homepage": "http://brianscaturro.com",
"role": "Lead"
}
],
"description": "Parallel testing for PHP",
"homepage": "https://github.com/paratestphp/paratest",
"keywords": [
"concurrent",
"parallel",
"phpunit",
"testing"
],
"support": {
"issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v6.1.2"
},
"time": "2020-12-15T11:41:54+00:00"
},
{ {
"name": "darkaonline/l5-swagger", "name": "darkaonline/l5-swagger",
"version": "8.0.4", "version": "8.0.4",
@ -10390,16 +10471,16 @@
}, },
{ {
"name": "facade/ignition", "name": "facade/ignition",
"version": "2.5.8", "version": "2.5.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/facade/ignition.git", "url": "https://github.com/facade/ignition.git",
"reference": "8e907d81244649c5ea746e2ec30c32c5f59df472" "reference": "66b3138ecce38024723fb3bfc66ef8852a779ea9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/facade/ignition/zipball/8e907d81244649c5ea746e2ec30c32c5f59df472", "url": "https://api.github.com/repos/facade/ignition/zipball/66b3138ecce38024723fb3bfc66ef8852a779ea9",
"reference": "8e907d81244649c5ea746e2ec30c32c5f59df472", "reference": "66b3138ecce38024723fb3bfc66ef8852a779ea9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -10463,7 +10544,7 @@
"issues": "https://github.com/facade/ignition/issues", "issues": "https://github.com/facade/ignition/issues",
"source": "https://github.com/facade/ignition" "source": "https://github.com/facade/ignition"
}, },
"time": "2020-12-29T09:12:55+00:00" "time": "2021-01-26T14:45:19+00:00"
}, },
{ {
"name": "facade/ignition-contracts", "name": "facade/ignition-contracts",
@ -10621,16 +10702,16 @@
}, },
{ {
"name": "filp/whoops", "name": "filp/whoops",
"version": "2.9.1", "version": "2.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/filp/whoops.git", "url": "https://github.com/filp/whoops.git",
"reference": "307fb34a5ab697461ec4c9db865b20ff2fd40771" "reference": "df7933820090489623ce0be5e85c7e693638e536"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/307fb34a5ab697461ec4c9db865b20ff2fd40771", "url": "https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536",
"reference": "307fb34a5ab697461ec4c9db865b20ff2fd40771", "reference": "df7933820090489623ce0be5e85c7e693638e536",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -10680,22 +10761,28 @@
], ],
"support": { "support": {
"issues": "https://github.com/filp/whoops/issues", "issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.9.1" "source": "https://github.com/filp/whoops/tree/2.9.2"
}, },
"time": "2020-11-01T12:00:00+00:00" "funding": [
{
"url": "https://github.com/denis-sokolov",
"type": "github"
}
],
"time": "2021-01-24T12:00:00+00:00"
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v2.18.0", "version": "v2.18.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
"reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef" "reference": "18f8c9d184ba777380794a389fabc179896ba913"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/18f8c9d184ba777380794a389fabc179896ba913",
"reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", "reference": "18f8c9d184ba777380794a389fabc179896ba913",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -10777,7 +10864,7 @@
"description": "A tool to automatically fix PHP code style", "description": "A tool to automatically fix PHP code style",
"support": { "support": {
"issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues",
"source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.0" "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.2"
}, },
"funding": [ "funding": [
{ {
@ -10785,7 +10872,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-01-18T03:31:06+00:00" "time": "2021-01-26T00:22:21+00:00"
}, },
{ {
"name": "hamcrest/hamcrest-php", "name": "hamcrest/hamcrest-php",
@ -11086,16 +11173,16 @@
}, },
{ {
"name": "nunomaduro/collision", "name": "nunomaduro/collision",
"version": "v5.2.0", "version": "v5.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nunomaduro/collision.git", "url": "https://github.com/nunomaduro/collision.git",
"reference": "aca954fd03414ba0dd85d7d8e42ba9b251893d1f" "reference": "aca63581f380f63a492b1e3114604e411e39133a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/aca954fd03414ba0dd85d7d8e42ba9b251893d1f", "url": "https://api.github.com/repos/nunomaduro/collision/zipball/aca63581f380f63a492b1e3114604e411e39133a",
"reference": "aca954fd03414ba0dd85d7d8e42ba9b251893d1f", "reference": "aca63581f380f63a492b1e3114604e411e39133a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -11170,7 +11257,7 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2021-01-13T10:00:08+00:00" "time": "2021-01-25T15:34:13+00:00"
}, },
{ {
"name": "openlss/lib-array2xml", "name": "openlss/lib-array2xml",
@ -13064,32 +13151,94 @@
"time": "2020-11-24T11:46:24+00:00" "time": "2020-11-24T11:46:24+00:00"
}, },
{ {
"name": "spatie/laravel-ray", "name": "spatie/laravel-package-tools",
"version": "1.8.0", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/laravel-ray.git", "url": "https://github.com/spatie/laravel-package-tools.git",
"reference": "976e1501a5ffc2bd266c39cdc545c0c77c581f3d" "reference": "40d0df6ef74f2478ed66cbaa821b4df0007daa15"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-ray/zipball/976e1501a5ffc2bd266c39cdc545c0c77c581f3d", "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/40d0df6ef74f2478ed66cbaa821b4df0007daa15",
"reference": "976e1501a5ffc2bd266c39cdc545c0c77c581f3d", "reference": "40d0df6ef74f2478ed66cbaa821b4df0007daa15",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/contracts": "^7.0|^8.0", "illuminate/contracts": "^7.0|^8.0",
"illuminate/database": "^7.0|^8.13", "mockery/mockery": "^1.4",
"illuminate/support": "^7.0|^8.13", "php": "^7.4|^8.0"
},
"require-dev": {
"orchestra/testbench": "^5.0|^6.0",
"phpunit/phpunit": "^9.3",
"spatie/test-time": "^1.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\LaravelPackageTools\\": "src",
"Spatie\\LaravelPackageTools\\Database\\Factories\\": "database/factories"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"role": "Developer"
}
],
"description": "Tools for creating Laravel packages",
"homepage": "https://github.com/spatie/laravel-package-tools",
"keywords": [
"laravel-package-tools",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/laravel-package-tools/issues",
"source": "https://github.com/spatie/laravel-package-tools/tree/1.1.0"
},
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2021-01-25T14:41:19+00:00"
},
{
"name": "spatie/laravel-ray",
"version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-ray.git",
"reference": "48ea89c80fdc155c2c6c20a7785fc8b484efa440"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-ray/zipball/48ea89c80fdc155c2c6c20a7785fc8b484efa440",
"reference": "48ea89c80fdc155c2c6c20a7785fc8b484efa440",
"shasum": ""
},
"require": {
"illuminate/contracts": "^7.20|^8.0",
"illuminate/database": "^7.20|^8.13",
"illuminate/queue": "^7.20|^8.13",
"illuminate/support": "^7.20|^8.13",
"php": "^7.4|^8.0", "php": "^7.4|^8.0",
"spatie/backtrace": "^1.0", "spatie/backtrace": "^1.0",
"spatie/laravel-package-tools": "^1.0.1",
"spatie/ray": "^1.13", "spatie/ray": "^1.13",
"symfony/stopwatch": "4.2|^5.1", "symfony/stopwatch": "4.2|^5.1",
"zbateson/mail-mime-parser": "^1.3.1" "zbateson/mail-mime-parser": "^1.3.1"
}, },
"require-dev": { "require-dev": {
"illuminate/mail": "^7.0|^8.19", "illuminate/mail": "^7.20|^8.19",
"illuminate/view": "^7.0|^8.19", "illuminate/view": "^7.20|^8.19",
"orchestra/testbench": "^5.0|^6.0", "orchestra/testbench": "^5.0|^6.0",
"phpunit/phpunit": "^9.3", "phpunit/phpunit": "^9.3",
"spatie/phpunit-snapshot-assertions": "^4.2" "spatie/phpunit-snapshot-assertions": "^4.2"
@ -13127,7 +13276,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/spatie/laravel-ray/issues", "issues": "https://github.com/spatie/laravel-ray/issues",
"source": "https://github.com/spatie/laravel-ray/tree/1.8.0" "source": "https://github.com/spatie/laravel-ray/tree/1.9.1"
}, },
"funding": [ "funding": [
{ {
@ -13139,7 +13288,7 @@
"type": "other" "type": "other"
} }
], ],
"time": "2021-01-19T19:44:06+00:00" "time": "2021-01-25T12:49:31+00:00"
}, },
{ {
"name": "spatie/macroable", "name": "spatie/macroable",
@ -13193,16 +13342,16 @@
}, },
{ {
"name": "spatie/ray", "name": "spatie/ray",
"version": "1.13.0", "version": "1.17.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/ray.git", "url": "https://github.com/spatie/ray.git",
"reference": "1df552d740f71f9866fa5b531ac7077726922f4e" "reference": "d76c9e4b95292afdcfe59495a9fe9a6995da1c62"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/ray/zipball/1df552d740f71f9866fa5b531ac7077726922f4e", "url": "https://api.github.com/repos/spatie/ray/zipball/d76c9e4b95292afdcfe59495a9fe9a6995da1c62",
"reference": "1df552d740f71f9866fa5b531ac7077726922f4e", "reference": "d76c9e4b95292afdcfe59495a9fe9a6995da1c62",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -13251,7 +13400,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/spatie/ray/issues", "issues": "https://github.com/spatie/ray/issues",
"source": "https://github.com/spatie/ray/tree/1.13.0" "source": "https://github.com/spatie/ray/tree/1.17.0"
}, },
"funding": [ "funding": [
{ {
@ -13263,7 +13412,7 @@
"type": "other" "type": "other"
} }
], ],
"time": "2021-01-19T19:28:53+00:00" "time": "2021-01-25T11:17:00+00:00"
}, },
{ {
"name": "swagger-api/swagger-ui", "name": "swagger-api/swagger-ui",

View File

@ -13,7 +13,7 @@ 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', ''), 'app_domain' => env('APP_DOMAIN', ''),
'app_version' => '5.0.54', 'app_version' => '5.0.55',
'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', false), 'api_secret' => env('API_SECRET', false),

View File

@ -30,8 +30,8 @@ const RESOURCES = {
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f", "assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
"assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac", "assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac",
"/": "23224b5e03519aaa87594403d54412cf", "/": "23224b5e03519aaa87594403d54412cf",
"version.json": "7e4c19c87f9676a83714d8b531ea766f", "version.json": "24380404aa64649901a0878a4f6aae18",
"main.dart.js": "ad2b36177ad8810c05f36c75b03f6d40", "main.dart.js": "1071216a656504599447ac0e362ca27a",
"favicon.png": "dca91c54388f52eded692718d5a98b8b" "favicon.png": "dca91c54388f52eded692718d5a98b8b"
}; };

View File

@ -1,2 +1,2 @@
/*! For license information please see authorize-authorize-card.js.LICENSE.txt */ /*! For license information please see authorize-authorize-card.js.LICENSE.txt */
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}({1:function(e,t,n){e.exports=n("6vDv")},"6vDv":function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}new(function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}var t,r,a;return t=e,(r=[{key:"handleAuthorization",value:function(){var e=$("#my-card"),t={};t.clientKey=this.publicKey,t.apiLoginID=this.loginId;var n={};n.cardNumber=e.CardJs("cardNumber"),n.month=e.CardJs("expiryMonth"),n.year=e.CardJs("expiryYear"),n.cardCode=document.getElementById("cvv").value;var r={};return r.authData=t,r.cardData=n,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(r,this.responseHandler),!1}},{key:"responseHandler",value:function(e){if("Error"===e.messages.resultCode){for(var t=0;t<e.messages.message.length;)console.log(e.messages.message[t].code+": "+e.messages.message[t].text),t+=1;document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")}else"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit());return!1}},{key:"handle",value:function(){var e=this;return this.cardButton.addEventListener("click",(function(){e.cardButton.disabled=!e.cardButton.disabled,e.handleAuthorization()})),this}}])&&n(t.prototype,r),a&&n(t,a),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}}); !function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}({1:function(e,t,n){e.exports=n("6vDv")},"6vDv":function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}new(function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}var t,r,a;return t=e,(r=[{key:"handleAuthorization",value:function(){var e=$("#my-card"),t={};t.clientKey=this.publicKey,t.apiLoginID=this.loginId;var n={};n.cardNumber=e.CardJs("cardNumber"),n.month=e.CardJs("expiryMonth"),n.year=e.CardJs("expiryYear"),n.cardCode=document.getElementById("cvv").value;var r={};return r.authData=t,r.cardData=n,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(r,this.responseHandler),!1}},{key:"responseHandler",value:function(e){return"Error"===e.messages.resultCode?($("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")):"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit()),!1}},{key:"handle",value:function(){var e=this;return this.cardButton.addEventListener("click",(function(){e.cardButton.disabled=!e.cardButton.disabled,e.handleAuthorization()})),this}}])&&n(t.prototype,r),a&&n(t,a),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}});

View File

@ -1,2 +1,2 @@
/*! For license information please see authorize-credit-card-payment.js.LICENSE.txt */ /*! For license information please see authorize-credit-card-payment.js.LICENSE.txt */
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=2)}({2:function(e,t,n){e.exports=n("hK5p")},hK5p:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new(function(){function e(t,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,"handleAuthorization",(function(){var e=$("#my-card"),t={};t.clientKey=a.publicKey,t.apiLoginID=a.loginId;var n={};n.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),n.month=e.CardJs("expiryMonth"),n.year=e.CardJs("expiryYear"),n.cardCode=document.getElementById("cvv").value;var r={};return r.authData=t,r.cardData=n,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(r,a.responseHandler),!1})),r(this,"responseHandler",(function(e){if("Error"===e.messages.resultCode){$("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")}else if("Ok"===e.messages.resultCode){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;var t=document.querySelector("input[name=token-billing-checkbox]:checked");t&&(document.getElementById("store_card").value=t.value),document.getElementById("server_response").submit()}return!1})),r(this,"handle",(function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=e.target.dataset.token}))}));var e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",(function(){document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null})),a.cardButton&&a.cardButton.addEventListener("click",(function(){a.cardButton.disabled=!0,a.handleAuthorization()}));var t=document.getElementById("pay-now");return t&&t.addEventListener("click",(function(e){var t=document.getElementById("token");t.value?a.handlePayNowAction(t.value):a.handleAuthorization()})),a})),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}var t,a,o;return t=e,(a=[{key:"handlePayNowAction",value:function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}])&&n(t.prototype,a),o&&n(t,o),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}}); !function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=2)}({2:function(e,t,n){e.exports=n("hK5p")},hK5p:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new(function(){function e(t,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,"handleAuthorization",(function(){var e=$("#my-card"),t={};t.clientKey=a.publicKey,t.apiLoginID=a.loginId;var n={};n.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),n.month=e.CardJs("expiryMonth"),n.year=e.CardJs("expiryYear"),n.cardCode=document.getElementById("cvv").value;var r={};return r.authData=t,r.cardData=n,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(r,a.responseHandler),!1})),r(this,"responseHandler",(function(e){if("Error"===e.messages.resultCode){$("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if("Ok"===e.messages.resultCode){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;var t=document.querySelector("input[name=token-billing-checkbox]:checked");t&&(document.getElementById("store_card").value=t.value),document.getElementById("server_response").submit()}return!1})),r(this,"handle",(function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=e.target.dataset.token}))}));var e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",(function(){document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null}));var t=document.getElementById("pay-now");return t&&t.addEventListener("click",(function(e){var t=document.getElementById("token");t.value?a.handlePayNowAction(t.value):a.handleAuthorization()})),a})),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name")}var t,a,o;return t=e,(a=[{key:"handlePayNowAction",value:function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}])&&n(t.prototype,a),o&&n(t,o),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}});

View File

@ -1,2 +1,2 @@
/*! For license information please see checkout-credit-card.js.LICENSE.txt */ /*! For license information please see checkout-credit-card.js.LICENSE.txt */
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=8)}({8:function(e,t,n){e.exports=n("fQHp")},fQHp:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tokens=[]}var t,r,o;return t=e,(r=[{key:"mountFrames",value:function(){console.log("Mount checkout frames..")}},{key:"handlePaymentUsingToken",value:function(e){document.getElementById("checkout--container").classList.add("hidden"),document.getElementById("pay-now-with-token--container").classList.remove("hidden"),document.querySelector("input[name=token]").value=e.target.dataset.token}},{key:"handlePaymentUsingCreditCard",value:function(e){var t;document.getElementById("checkout--container").classList.remove("hidden"),document.getElementById("pay-now-with-token--container").classList.add("hidden");var n=document.getElementById("pay-button"),r=null!==(t=document.querySelector('meta[name="public-key"]').content)&&void 0!==t?t:"",o=document.getElementById("payment-form");Frames.init(r),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(e){n.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e),document.querySelector('input[name="store_card"]').value=document.querySelector("input[name=token-billing-checkbox]:checked").value,document.getElementById("server-response").submit()})),o.addEventListener("submit",(function(e){e.preventDefault(),Frames.submitCard()}))}},{key:"completePaymentUsingToken",value:function(e){var t=document.getElementById("pay-now-with-token");t.disabled=!0,t.querySelector("svg").classList.remove("hidden"),t.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}},{key:"handle",value:function(){var e=this;this.handlePaymentUsingCreditCard(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(t){return t.addEventListener("click",e.handlePaymentUsingToken)})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",this.handlePaymentUsingCreditCard),document.getElementById("pay-now-with-token").addEventListener("click",this.completePaymentUsingToken)}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}}); !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=8)}({8:function(e,t,n){e.exports=n("fQHp")},fQHp:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tokens=[]}var t,r,o;return t=e,(r=[{key:"mountFrames",value:function(){console.log("Mount checkout frames..")}},{key:"handlePaymentUsingToken",value:function(e){document.getElementById("checkout--container").classList.add("hidden"),document.getElementById("pay-now-with-token--container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}},{key:"handlePaymentUsingCreditCard",value:function(e){var t;document.getElementById("checkout--container").classList.remove("hidden"),document.getElementById("pay-now-with-token--container").classList.add("hidden"),document.getElementById("save-card--container").style.display="grid";var n=document.getElementById("pay-button"),r=null!==(t=document.querySelector('meta[name="public-key"]').content)&&void 0!==t?t:"",o=document.getElementById("payment-form");Frames.init(r),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(e){n.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e),document.querySelector('input[name="store_card"]').value=document.querySelector("input[name=token-billing-checkbox]:checked").value,document.getElementById("server-response").submit()})),o.addEventListener("submit",(function(e){e.preventDefault(),Frames.submitCard()}))}},{key:"completePaymentUsingToken",value:function(e){var t=document.getElementById("pay-now-with-token");t.disabled=!0,t.querySelector("svg").classList.remove("hidden"),t.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}},{key:"handle",value:function(){var e=this;this.handlePaymentUsingCreditCard(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(t){return t.addEventListener("click",e.handlePaymentUsingToken)})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",this.handlePaymentUsingCreditCard),document.getElementById("pay-now-with-token").addEventListener("click",this.completePaymentUsingToken)}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});

File diff suppressed because one or more lines are too long

237408
public/main.dart.js vendored

File diff suppressed because one or more lines are too long

View File

@ -3,13 +3,13 @@
"/css/app.css": "/css/app.css?id=599b11149976e86c83a3", "/css/app.css": "/css/app.css?id=599b11149976e86c83a3",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=a09bb529b8e1826f13b4", "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=a09bb529b8e1826f13b4",
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=8ce8955ba775ea5f47d1", "/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=8ce8955ba775ea5f47d1",
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=cddcd46c630c71737bda", "/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=206d7de4ac97612980ff",
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=d7160227f23b73fd1e63", "/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=a376eff2227da398b0ba",
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=5469146cd629ea1b5c20", "/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=5469146cd629ea1b5c20",
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=935645b176c73b7831f4", "/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=edc30120fdc238cd15ea",
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=c4012ad90f17d60432ad", "/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=c4012ad90f17d60432ad",
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=6dbe9316b98deea55421", "/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=6dbe9316b98deea55421",
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=e2ccaed999d2ae077c1f", "/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=9418a9c5c137994c4bd8",
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=9b9fd56d655ad238f149", "/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=9b9fd56d655ad238f149",
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=1b8f9325aa6e8595e7fa", "/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=1b8f9325aa6e8595e7fa",
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12", "/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12",

View File

@ -1 +1 @@
{"app_name":"invoiceninja_flutter","version":"5.0.39","build_number":"39"} {"app_name":"invoiceninja_flutter","version":"5.0.40","build_number":"40"}

View File

@ -47,13 +47,9 @@ class AuthorizeAuthorizeCard {
responseHandler(response) { responseHandler(response) {
if (response.messages.resultCode === "Error") { if (response.messages.resultCode === "Error") {
var i = 0; var i = 0;
while (i < response.messages.message.length) {
console.log( var $errors = $('#errors'); // get the reference of the div
response.messages.message[i].code + ": " + $errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>");
response.messages.message[i].text
);
i = i + 1;
}
document.getElementById('card_button').disabled = false; document.getElementById('card_button').disabled = false;
document.querySelector('#card_button > svg').classList.add('hidden'); document.querySelector('#card_button > svg').classList.add('hidden');

View File

@ -14,7 +14,6 @@ class AuthorizeAuthorizeCard {
this.publicKey = publicKey; this.publicKey = publicKey;
this.loginId = loginId; this.loginId = loginId;
this.cardHolderName = document.getElementById("cardholder_name"); this.cardHolderName = document.getElementById("cardholder_name");
this.cardButton = document.getElementById("card_button");
} }
handleAuthorization = () => { handleAuthorization = () => {
@ -68,9 +67,9 @@ class AuthorizeAuthorizeCard {
var $errors = $('#errors'); // get the reference of the div var $errors = $('#errors'); // get the reference of the div
$errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>"); $errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>");
document.getElementById('card_button').disabled = false; document.getElementById('pay-now').disabled = false;
document.querySelector('#card_button > svg').classList.add('hidden'); document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#card_button > span').classList.remove('hidden'); document.querySelector('#pay-now > span').classList.remove('hidden');
} else if (response.messages.resultCode === "Ok") { } else if (response.messages.resultCode === "Ok") {
document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor; document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor;
@ -117,16 +116,6 @@ class AuthorizeAuthorizeCard {
}); });
} }
if (this.cardButton) {
this.cardButton.addEventListener("click", () => {
this.cardButton.disabled = true;
this.handleAuthorization();
});
}
let payNowButton = document.getElementById('pay-now'); let payNowButton = document.getElementById('pay-now');
if (payNowButton) { if (payNowButton) {

View File

@ -20,6 +20,7 @@ class CheckoutCreditCard {
handlePaymentUsingToken(e) { handlePaymentUsingToken(e) {
document.getElementById('checkout--container').classList.add('hidden'); document.getElementById('checkout--container').classList.add('hidden');
document.getElementById('pay-now-with-token--container').classList.remove('hidden'); document.getElementById('pay-now-with-token--container').classList.remove('hidden');
document.getElementById('save-card--container').style.display = 'none';
document document
.querySelector('input[name=token]') .querySelector('input[name=token]')
@ -29,6 +30,7 @@ class CheckoutCreditCard {
handlePaymentUsingCreditCard(e) { handlePaymentUsingCreditCard(e) {
document.getElementById('checkout--container').classList.remove('hidden'); document.getElementById('checkout--container').classList.remove('hidden');
document.getElementById('pay-now-with-token--container').classList.add('hidden'); document.getElementById('pay-now-with-token--container').classList.add('hidden');
document.getElementById('save-card--container').style.display = 'grid';
const payButton = document.getElementById('pay-button'); const payButton = document.getElementById('pay-button');
const publicKey = document.querySelector('meta[name="public-key"]').content ?? ''; const publicKey = document.querySelector('meta[name="public-key"]').content ?? '';

View File

@ -90,7 +90,7 @@ class StripeCreditCard {
).value = JSON.stringify(result.paymentIntent); ).value = JSON.stringify(result.paymentIntent);
let tokenBillingCheckbox = document.querySelector( let tokenBillingCheckbox = document.querySelector(
'input[name="token-billing-checkbox"]' 'input[name="token-billing-checkbox"]:checked'
); );
if (tokenBillingCheckbox) { if (tokenBillingCheckbox) {
@ -163,6 +163,7 @@ class StripeCreditCard {
.from(document.getElementsByClassName('toggle-payment-with-token')) .from(document.getElementsByClassName('toggle-payment-with-token'))
.forEach((element) => element.addEventListener('click', (element) => { .forEach((element) => element.addEventListener('click', (element) => {
document.getElementById('stripe--payment-container').classList.add('hidden'); document.getElementById('stripe--payment-container').classList.add('hidden');
document.getElementById('save-card--container').style.display = 'none';
document.querySelector('input[name=token]').value = element.target.dataset.token; document.querySelector('input[name=token]').value = element.target.dataset.token;
})); }));
@ -170,6 +171,7 @@ class StripeCreditCard {
.getElementById('toggle-payment-with-credit-card') .getElementById('toggle-payment-with-credit-card')
.addEventListener('click', (element) => { .addEventListener('click', (element) => {
document.getElementById('stripe--payment-container').classList.remove('hidden'); document.getElementById('stripe--payment-container').classList.remove('hidden');
document.getElementById('save-card--container').style.display = 'grid';
document.querySelector('input[name=token]').value = ""; document.querySelector('input[name=token]').value = "";
}); });

View File

@ -3382,4 +3382,6 @@ return [
'user_detached' => 'User detached from company', 'user_detached' => 'User detached from company',
'create_webhook_failure' => 'Failed to create Webhook', 'create_webhook_failure' => 'Failed to create Webhook',
'number' => 'Number', 'number' => 'Number',
'payment_message_extended' => 'Thank you for your payment of :amount for :invoice',
]; ];

View File

@ -7,9 +7,7 @@
<p>{{ $title }}</p> <p>{{ $title }}</p>
@slot('greeting') <p>{{ $message }}</p>
@lang($message)
@endslot
@component('email.components.button', ['url' => $url]) @component('email.components.button', ['url' => $url])
@lang($button) @lang($button)

View File

@ -18,7 +18,7 @@
method="post" id="server_response"> method="post" id="server_response">
@csrf @csrf
<input type="hidden" name="company_gateway_id" value="{{ $gateway->id }}"> <input type="hidden" name="company_gateway_id" value="{{ $gateway->company_gateway->id }}">
<input type="hidden" name="payment_method_id" value="1"> <input type="hidden" name="payment_method_id" value="1">
<input type="hidden" name="gateway_response" id="gateway_response"> <input type="hidden" name="gateway_response" id="gateway_response">
<input type="hidden" name="is_default" id="is_default"> <input type="hidden" name="is_default" id="is_default">
@ -44,7 +44,7 @@
@endsection @endsection
@section('gateway_footer') @section('gateway_footer')
@if($gateway->getConfigField('testMode')) @if($gateway->company_gateway->getConfigField('testMode'))
<script src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"></script> <script src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"></script>
@else @else
<script src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script> <script src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>

View File

@ -1,17 +1,28 @@
@unless(isset($show_save) && $show_save == false) @if($gateway->company_gateway->token_billing !== 'always')
<div class="{{ ($gateway->token_billing == 'optin' || $gateway->token_billing == 'optout') ? 'sm:grid' : 'hidden' }} px-4 py-5 sm:grid-cols-3 sm:gap-4 sm:px-6" id="save-card--container"> <div class="sm:grid px-4 py-5 sm:grid-cols-3 sm:gap-4 sm:px-6" id="save-card--container">
<dt class="text-sm leading-5 font-medium text-gray-500"> <dt class="text-sm leading-5 font-medium text-gray-500">
{{ ctrans('texts.save_payment_method_details') }} {{ ctrans('texts.save_payment_method_details') }}
</dt> </dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2"> <dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<label class="mr-4"> <label class="mr-4">
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox" id="proxy_is_default" value="true" {{ ($gateway->token_billing == 'always' || $gateway->token_billing == 'optout') ? 'checked' : '' }} /> <input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox"
id="proxy_is_default"
value="true"/>
<span class="ml-1 cursor-pointer">{{ ctrans('texts.yes') }}</span> <span class="ml-1 cursor-pointer">{{ ctrans('texts.yes') }}</span>
</label> </label>
<label> <label>
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox" id="proxy_is_default" value="false" {{ ($gateway->token_billing == 'off' || $gateway->token_billing == 'optin') ? 'checked' : '' }} /> <input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox"
id="proxy_is_default"
value="false" checked />
<span class="ml-1 cursor-pointer">{{ ctrans('texts.no') }}</span> <span class="ml-1 cursor-pointer">{{ ctrans('texts.no') }}</span>
</label> </label>
</dd> </dd>
</div> </div>
@endunless @else
<div id="save-card--container" class="hidden" style="display: none !important;">
<input type="radio" class="form-radio cursor-pointer hidden" style="display: none !important;"
name="token-billing-checkbox"
id="proxy_is_default"
value="true" checked hidden disabled/>
</div>
@endif

View File

@ -126,7 +126,7 @@
@yield('footer') @yield('footer')
@stack('footer') @stack('footer')
@if((bool) \App\Utils\Ninja::isSelfHost()) @if((bool) \App\Utils\Ninja::isSelfHost() && !empty($client->getSetting('portal_custom_footer')))
<div class="py-1 text-sm text-center text-white bg-primary"> <div class="py-1 text-sm text-center text-white bg-primary">
{!! $client->getSetting('portal_custom_footer') !!} {!! $client->getSetting('portal_custom_footer') !!}
</div> </div>

View File

@ -48,7 +48,7 @@
document document
.querySelector('div[data-ref="gateway-container"]') .querySelector('div[data-ref="gateway-container"]')
.scrollIntoView({ behavior: "smooth" }); .scrollIntoView({behavior: "smooth"});
}); });
</script> </script>
@endpush @endpush

View File

@ -70,6 +70,7 @@
</div> </div>
</div> </div>
@if($payment->refunded > 0)
<div class="px-4 py-5 bg-white sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"> <div class="px-4 py-5 bg-white sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium leading-5 text-gray-500"> <dt class="text-sm font-medium leading-5 text-gray-500">
{{ ctrans('texts.refunded') }} {{ ctrans('texts.refunded') }}
@ -79,6 +80,7 @@
</div> </div>
</div> </div>
@endif @endif
@endif
</dl> </dl>
</div> </div>
</div> </div>

View File

@ -39,74 +39,14 @@ class ClientModelTest extends TestCase
} }
} }
public function testPaymentMethods() public function testPaymentMethodsWithCreditsEnforced()
{ {
$amount = 40; $amount = 40;
$company_gateways = $this->client->getSetting('company_gateway_ids'); $payment_methods = $this->client->service()->getPaymentMethods(40);
//todo create a test where we actually SET a value in the settings->company_gateways object and test if we can harvest. $this->assertEquals(1, count($payment_methods));
if ($company_gateways) {
$gateways = $this->company->company_gateways->whereIn('id', $payment_gateways);
} else {
$gateways = $this->company->company_gateways;
} }
$this->assertNotNull($gateways);
$pre_count = $gateways->count();
$gateways->filter(function ($method) use ($amount) {
if ($method->min_limit !== null && $amount < $method->min_limit) {
return false;
}
if ($method->max_limit !== null && $amount > $method->min_limit) {
return false;
}
});
$post_count = $gateways->count();
$this->assertEquals($pre_count, $post_count);
$payment_methods = [];
foreach ($gateways as $gateway) {
foreach ($gateway->driver($this->client)->gatewayTypes() as $type) {
$payment_methods[] = [$gateway->id => $type];
}
}
$this->assertEquals(8, count($payment_methods));
$payment_methods_collections = collect($payment_methods);
//** Plucks the remaining keys into its own collection
$payment_methods_intersect = $payment_methods_collections->intersectByKeys($payment_methods_collections->flatten(1)->unique());
$this->assertEquals(4, $payment_methods_intersect->count());
$payment_urls = [];
foreach ($payment_methods_intersect as $key => $child_array) {
foreach ($child_array as $gateway_id => $gateway_type_id) {
$gateway = $gateways->where('id', $gateway_id)->first();
$this->assertNotNull($gateway);
$fee_label = $gateway->calcGatewayFeeLabel($amount, $this->client);
$payment_urls[] = [
'label' => ctrans('texts.'.$gateway->getTypeAlias($gateway_type_id)).$fee_label,
'url' => URL::signedRoute('client.payments.process', [
'company_gateway_id' => $gateway_id,
'gateway_type_id' => $gateway_type_id, ]),
];
}
}
$this->assertEquals(4, count($payment_urls));
}
} }

View File

@ -53,6 +53,8 @@ class CompanyGatewayResolutionTest extends TestCase
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
CompanyGateway::whereNotNull('id')->delete();
$data = []; $data = [];
$data[1]['min_limit'] = -1; $data[1]['min_limit'] = -1;
$data[1]['max_limit'] = -1; $data[1]['max_limit'] = -1;
@ -66,6 +68,7 @@ class CompanyGatewayResolutionTest extends TestCase
$data[1]['fee_tax_rate3'] = 10; $data[1]['fee_tax_rate3'] = 10;
$data[1]['adjust_fee_percent'] = true; $data[1]['adjust_fee_percent'] = true;
$data[1]['fee_cap'] = 0; $data[1]['fee_cap'] = 0;
$data[1]['is_enabled'] = true;
$data[2]['min_limit'] = -1; $data[2]['min_limit'] = -1;
$data[2]['max_limit'] = -1; $data[2]['max_limit'] = -1;
@ -79,10 +82,10 @@ class CompanyGatewayResolutionTest extends TestCase
$data[2]['fee_tax_rate3'] = 10; $data[2]['fee_tax_rate3'] = 10;
$data[2]['adjust_fee_percent'] = true; $data[2]['adjust_fee_percent'] = true;
$data[2]['fee_cap'] = 0; $data[2]['fee_cap'] = 0;
$data[2]['is_enabled'] = true;
//disable ach here //disable ach here
$json_config = json_decode(config('ninja.testvars.stripe')); $json_config = json_decode(config('ninja.testvars.stripe'));
$json_config->enable_ach = "0";
$this->cg = new CompanyGateway; $this->cg = new CompanyGateway;
$this->cg->company_id = $this->company->id; $this->cg->company_id = $this->company->id;
@ -104,8 +107,6 @@ class CompanyGatewayResolutionTest extends TestCase
{ {
$fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false); $fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
$this->assertEquals(0.2, $fee); $this->assertEquals(0.2, $fee);
// $fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
// $this->assertEquals(0.1, $fee);
} }
/** /**
@ -121,35 +122,68 @@ class CompanyGatewayResolutionTest extends TestCase
public function testAvailablePaymentMethodsCount() public function testAvailablePaymentMethodsCount()
{ {
$amount = 10; $amount = 10;
$payment_methods = [];
$this->assertInstanceOf("\\stdClass", $this->cg->fees_and_limits); $this->assertInstanceOf("\\stdClass", $this->cg->fees_and_limits);
$this->assertObjectHasAttribute('min_limit', $this->cg->fees_and_limits->{1}); $this->assertObjectHasAttribute('min_limit', $this->cg->fees_and_limits->{1});
foreach ($this->cg->driver($this->client)->gatewayTypes() as $type) { $payment_methods = $this->client->service()->getPaymentMethods($amount);
if (property_exists($this->cg->fees_and_limits, $type)) {
if ($this->client->validGatewayForAmount($this->cg->fees_and_limits->{$type}, $amount)) {
$payment_methods[] = [$this->cg->id => $type];
}
} else {
$payment_methods[] = [$this->cg->id => $type];
}
}
$this->assertEquals(3, count($payment_methods)); $this->assertEquals(3, count($payment_methods));
} }
public function testAddAchBackIntoMethods() public function testRemoveMethods()
{ {
$this->assertEquals(3, count($this->cg->driver($this->client)->gatewayTypes())); $amount = 10;
$cg_config = json_decode(decrypt($this->cg->config)); CompanyGateway::whereNotNull('id')->delete();
$cg_config->enable_ach = "1";
$this->cg->config = encrypt(json_encode($cg_config)); $data = [];
$data[1]['min_limit'] = -1;
$data[1]['max_limit'] = -1;
$data[1]['fee_amount'] = 0.00;
$data[1]['fee_percent'] = 2;
$data[1]['fee_tax_name1'] = 'GST';
$data[1]['fee_tax_rate1'] = 10;
$data[1]['fee_tax_name2'] = 'GST';
$data[1]['fee_tax_rate2'] = 10;
$data[1]['fee_tax_name3'] = 'GST';
$data[1]['fee_tax_rate3'] = 10;
$data[1]['adjust_fee_percent'] = true;
$data[1]['fee_cap'] = 0;
$data[1]['is_enabled'] = true;
$data[2]['min_limit'] = -1;
$data[2]['max_limit'] = -1;
$data[2]['fee_amount'] = 0.00;
$data[2]['fee_percent'] = 1;
$data[2]['fee_tax_name1'] = 'GST';
$data[2]['fee_tax_rate1'] = 10;
$data[2]['fee_tax_name2'] = 'GST';
$data[2]['fee_tax_rate2'] = 10;
$data[2]['fee_tax_name3'] = 'GST';
$data[2]['fee_tax_rate3'] = 10;
$data[2]['adjust_fee_percent'] = true;
$data[2]['fee_cap'] = 0;
$data[2]['is_enabled'] = false;
//disable ach here
$json_config = json_decode(config('ninja.testvars.stripe'));
$this->cg = new CompanyGateway;
$this->cg->company_id = $this->company->id;
$this->cg->user_id = $this->user->id;
$this->cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
$this->cg->require_cvv = true;
$this->cg->require_billing_address = true;
$this->cg->require_shipping_address = true;
$this->cg->update_details = true;
$this->cg->config = encrypt(json_encode($json_config));
$this->cg->fees_and_limits = $data;
$this->cg->save(); $this->cg->save();
$this->assertEquals(4, count($this->cg->driver($this->client)->gatewayTypes())); // nlog($this->client->service()->getPaymentMethods($amount));
$this->assertEquals(2, count($this->client->service()->getPaymentMethods($amount)));
// nlog(print_r($this->client->getPaymentMethods(10),1));
} }
} }

View File

@ -57,6 +57,7 @@ class CompanyGatewayTest extends TestCase
$data[1]['fee_tax_rate3'] = 0; $data[1]['fee_tax_rate3'] = 0;
$data[1]['adjust_fee_percent'] = true; $data[1]['adjust_fee_percent'] = true;
$data[1]['fee_cap'] = 0; $data[1]['fee_cap'] = 0;
$data[1]['is_enabled'] = true;
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $this->company->id; $cg->company_id = $this->company->id;
@ -128,6 +129,7 @@ class CompanyGatewayTest extends TestCase
$data[1]['fee_tax_rate3'] = 0; $data[1]['fee_tax_rate3'] = 0;
$data[1]['adjust_fee_percent'] = true; $data[1]['adjust_fee_percent'] = true;
$data[1]['fee_cap'] = 0; $data[1]['fee_cap'] = 0;
$data[1]['is_enabled'] = true;
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $this->company->id; $cg->company_id = $this->company->id;
@ -166,6 +168,7 @@ class CompanyGatewayTest extends TestCase
$data[1]['fee_tax_rate3'] = 10; $data[1]['fee_tax_rate3'] = 10;
$data[1]['adjust_fee_percent'] = true; $data[1]['adjust_fee_percent'] = true;
$data[1]['fee_cap'] = 0; $data[1]['fee_cap'] = 0;
$data[1]['is_enabled'] = true;
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $this->company->id; $cg->company_id = $this->company->id;
@ -188,41 +191,5 @@ class CompanyGatewayTest extends TestCase
/*simple pro rata*/ /*simple pro rata*/
$fees_and_limits = $cg->getFeesAndLimits(GatewayType::CREDIT_CARD); $fees_and_limits = $cg->getFeesAndLimits(GatewayType::CREDIT_CARD);
/*Calculate all subcomponents of the fee*/
// $fee_component_amount = $fees_and_limits->fee_amount ?: 0;
// $fee_component_percent = $fees_and_limits->fee_percent ? ($total * $fees_and_limits->fee_percent / 100) : 0;
// $combined_fee_component = $fee_component_amount + $fee_component_percent;
// $fee_component_tax_name1 = $fees_and_limits->fee_tax_name1 ?: '';
// $fee_component_tax_rate1 = $fees_and_limits->fee_tax_rate1 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate1 / 100) : 0;
// $fee_component_tax_name2 = $fees_and_limits->fee_tax_name2 ?: '';
// $fee_component_tax_rate2 = $fees_and_limits->fee_tax_rate2 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate2 / 100) : 0;
// $fee_component_tax_name3 = $fees_and_limits->fee_tax_name3 ?: '';
// $fee_component_tax_rate3 = $fees_and_limits->fee_tax_rate3 ? ($combined_fee_component * $fees_and_limits->fee_tax_rate3 / 100) : 0;
// $pro_rata_fee = round($total_gateway_fee / $total_invoice_count,2);
// while($pro_rata_fee * $total_invoice_count != $total_gateway_fee) {
// //nudge one pro rata fee until we get the desired amount
// $sub_total_fees = ($pro_rata_fee*($total_invoice_count--));
// //work out if we have to nudge up or down
// if($pro_rata_fee*$total_invoice_count > $total_gateway_fee) {
// //nudge DOWN
// $pro_rata_fee - 0.01; //this will break if the currency doesn't have decimals
// }
// else {
// //nudge UP
// }
// }
// $this->assertEquals(1.56, $pro_rata_fee*$total_invoice_count);
} }
} }

View File

@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
use Tests\MockAccountData;
use Tests\TestCase; use Tests\TestCase;
/** @test*/ /** @test*/
@ -50,6 +51,7 @@ class CompanyLedgerTest extends TestCase
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
$this->artisan('db:seed');
/* Warm up the cache !*/ /* Warm up the cache !*/
$cached_tables = config('ninja.cached_tables'); $cached_tables = config('ninja.cached_tables');
@ -94,6 +96,7 @@ class CompanyLedgerTest extends TestCase
$settings->country_id = '840'; $settings->country_id = '840';
$settings->vat_number = 'vat number'; $settings->vat_number = 'vat number';
$settings->id_number = 'id number'; $settings->id_number = 'id number';
$settings->timezone_id = '1';
$this->company->settings = $settings; $this->company->settings = $settings;
$this->company->save(); $this->company->save();
@ -101,17 +104,17 @@ class CompanyLedgerTest extends TestCase
$this->account->default_company_id = $this->company->id; $this->account->default_company_id = $this->company->id;
$this->account->save(); $this->account->save();
$this->user = User::whereEmail('user@example.com')->first(); $user = User::whereEmail('user@example.com')->first();
if (! $this->user) { if (! $user) {
$this->user = User::factory()->create([ $user = User::factory()->create([
'account_id' => $this->account->id, 'account_id' => $this->account->id,
'password' => Hash::make('ALongAndBriliantPassword'), 'password' => Hash::make('ALongAndBriliantPassword'),
'confirmation_code' => $this->createDbHash(config('database.default')), 'confirmation_code' => $this->createDbHash(config('database.default')),
]); ]);
} }
$cu = CompanyUserFactory::create($this->user->id, $this->company->id, $this->account->id); $cu = CompanyUserFactory::create($user->id, $this->company->id, $this->account->id);
$cu->is_owner = true; $cu->is_owner = true;
$cu->is_admin = true; $cu->is_admin = true;
$cu->save(); $cu->save();
@ -119,7 +122,7 @@ class CompanyLedgerTest extends TestCase
$this->token = \Illuminate\Support\Str::random(64); $this->token = \Illuminate\Support\Str::random(64);
$company_token = new CompanyToken; $company_token = new CompanyToken;
$company_token->user_id = $this->user->id; $company_token->user_id = $user->id;
$company_token->company_id = $this->company->id; $company_token->company_id = $this->company->id;
$company_token->account_id = $this->account->id; $company_token->account_id = $this->account->id;
$company_token->name = 'test token'; $company_token->name = 'test token';
@ -127,12 +130,12 @@ class CompanyLedgerTest extends TestCase
$company_token->save(); $company_token->save();
$this->client = Client::factory()->create([ $this->client = Client::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
ClientContact::factory()->create([ ClientContact::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user->id,
'client_id' => $this->client->id, 'client_id' => $this->client->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'is_primary' => 1, 'is_primary' => 1,
@ -266,5 +269,6 @@ class CompanyLedgerTest extends TestCase
$invoice = Invoice::find($invoice->id); $invoice = Invoice::find($invoice->id);
$this->assertEquals($refund, $invoice->balance); $this->assertEquals($refund, $invoice->balance);
} }
} }

View File

@ -51,7 +51,6 @@ class AuthorizeTest extends TestCase
$this->markTestSkipped('authorize.net not configured'); $this->markTestSkipped('authorize.net not configured');
} }
$this->makeTestData();
} }
public function testUnpackingVars() public function testUnpackingVars()

View File

@ -131,6 +131,8 @@ trait MockAccountData
/* Warm up the cache !*/ /* Warm up the cache !*/
$cached_tables = config('ninja.cached_tables'); $cached_tables = config('ninja.cached_tables');
$this->artisan('db:seed');
foreach ($cached_tables as $name => $class) { foreach ($cached_tables as $name => $class) {
// check that the table exists in case the migration is pending // check that the table exists in case the migration is pending
@ -176,6 +178,7 @@ trait MockAccountData
$settings->vat_number = 'vat number'; $settings->vat_number = 'vat number';
$settings->id_number = 'id number'; $settings->id_number = 'id number';
$settings->use_credits_payment = 'always'; $settings->use_credits_payment = 'always';
$settings->timezone_id = '1';
$this->company->settings = $settings; $this->company->settings = $settings;
$this->company->save(); $this->company->save();
@ -183,19 +186,22 @@ trait MockAccountData
$this->account->default_company_id = $this->company->id; $this->account->default_company_id = $this->company->id;
$this->account->save(); $this->account->save();
$this->user = User::whereEmail('user@example.com')->first(); $user = User::whereEmail('user@example.com')->first();
if (! $this->user) { if (! $user) {
$this->user = User::factory()->create([ $user = User::factory()->create([
'account_id' => $this->account->id, 'account_id' => $this->account->id,
'confirmation_code' => $this->createDbHash(config('database.default')), 'confirmation_code' => $this->createDbHash(config('database.default')),
'email' => 'user@example.com', 'email' => 'user@example.com',
]); ]);
} }
$this->user->password = Hash::make('ALongAndBriliantPassword'); $user->password = Hash::make('ALongAndBriliantPassword');
$this->cu = CompanyUserFactory::create($this->user->id, $this->company->id, $this->account->id); $user_id = $user->id;
$this->user = $user;
$this->cu = CompanyUserFactory::create($user->id, $this->company->id, $this->account->id);
$this->cu->is_owner = true; $this->cu->is_owner = true;
$this->cu->is_admin = true; $this->cu->is_admin = true;
$this->cu->save(); $this->cu->save();
@ -203,7 +209,7 @@ trait MockAccountData
$this->token = \Illuminate\Support\Str::random(64); $this->token = \Illuminate\Support\Str::random(64);
$company_token = new CompanyToken; $company_token = new CompanyToken;
$company_token->user_id = $this->user->id; $company_token->user_id = $user->id;
$company_token->company_id = $this->company->id; $company_token->company_id = $this->company->id;
$company_token->account_id = $this->account->id; $company_token->account_id = $this->account->id;
$company_token->name = 'test token'; $company_token->name = 'test token';
@ -212,15 +218,15 @@ trait MockAccountData
$company_token->save(); $company_token->save();
//todo create one token withe token name TOKEN - use firstOrCreate //todo create one token with token name TOKEN - use firstOrCreate
Product::factory()->create([ Product::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
$this->client = Client::factory()->create([ $this->client = Client::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
@ -229,7 +235,7 @@ trait MockAccountData
Storage::makeDirectory($this->company->company_key.'/'.$this->client->client_hash.'/quotes', 0755, true); Storage::makeDirectory($this->company->company_key.'/'.$this->client->client_hash.'/quotes', 0755, true);
$contact = ClientContact::factory()->create([ $contact = ClientContact::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'client_id' => $this->client->id, 'client_id' => $this->client->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'is_primary' => 1, 'is_primary' => 1,
@ -238,20 +244,20 @@ trait MockAccountData
$contact2 = ClientContact::factory()->create([ $contact2 = ClientContact::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'client_id' => $this->client->id, 'client_id' => $this->client->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'send_email' => true, 'send_email' => true,
]); ]);
$this->vendor = Vendor::factory()->create([ $this->vendor = Vendor::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
$vendor_contact = VendorContact::factory()->create([ $vendor_contact = VendorContact::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'vendor_id' => $this->vendor->id, 'vendor_id' => $this->vendor->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'is_primary' => 1, 'is_primary' => 1,
@ -259,34 +265,34 @@ trait MockAccountData
]); ]);
$vendor_contact2 = VendorContact::factory()->create([ $vendor_contact2 = VendorContact::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'vendor_id' => $this->vendor->id, 'vendor_id' => $this->vendor->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'send_email' => true, 'send_email' => true,
]); ]);
$this->project = Project::factory()->create([ $this->project = Project::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
$this->expense = Expense::factory()->create([ $this->expense = Expense::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
$this->task = Task::factory()->create([ $this->task = Task::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
$this->expense_category = ExpenseCategory::factory()->create([ $this->expense_category = ExpenseCategory::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
$this->task_status = TaskStatus::factory()->create([ $this->task_status = TaskStatus::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
@ -303,7 +309,7 @@ trait MockAccountData
$this->client->group_settings_id = $gs->id; $this->client->group_settings_id = $gs->id;
$this->client->save(); $this->client->save();
$this->invoice = InvoiceFactory::create($this->company->id, $this->user->id); //stub the company and user_id $this->invoice = InvoiceFactory::create($this->company->id, $user_id); //stub the company and user_id
$this->invoice->client_id = $this->client->id; $this->invoice->client_id = $this->client->id;
$this->invoice->line_items = $this->buildLineItems(); $this->invoice->line_items = $this->buildLineItems();
@ -321,17 +327,15 @@ trait MockAccountData
$this->invoice->save(); $this->invoice->save();
//$this->invoice->service()->createInvitations()->markSent();
//$this->invoice->service()->createInvitations();
InvoiceInvitation::factory()->create([ InvoiceInvitation::factory()->create([
'user_id' => $this->user->id, 'user_id' => $this->invoice->user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'client_contact_id' => $contact->id, 'client_contact_id' => $contact->id,
'invoice_id' => $this->invoice->id, 'invoice_id' => $this->invoice->id,
]); ]);
InvoiceInvitation::factory()->create([ InvoiceInvitation::factory()->create([
'user_id' => $this->user->id, 'user_id' => $this->invoice->user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'client_contact_id' => $contact2->id, 'client_contact_id' => $contact2->id,
'invoice_id' => $this->invoice->id, 'invoice_id' => $this->invoice->id,
@ -340,7 +344,7 @@ trait MockAccountData
$this->invoice->service()->markSent(); $this->invoice->service()->markSent();
$this->quote = Quote::factory()->create([ $this->quote = Quote::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'client_id' => $this->client->id, 'client_id' => $this->client->id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
]); ]);
@ -361,14 +365,14 @@ trait MockAccountData
//$this->quote->service()->createInvitations()->markSent(); //$this->quote->service()->createInvitations()->markSent();
QuoteInvitation::factory()->create([ QuoteInvitation::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'client_contact_id' => $contact->id, 'client_contact_id' => $contact->id,
'quote_id' => $this->quote->id, 'quote_id' => $this->quote->id,
]); ]);
QuoteInvitation::factory()->create([ QuoteInvitation::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'client_contact_id' => $contact2->id, 'client_contact_id' => $contact2->id,
'quote_id' => $this->quote->id, 'quote_id' => $this->quote->id,
@ -379,7 +383,7 @@ trait MockAccountData
$this->quote->save(); $this->quote->save();
$this->credit = CreditFactory::create($this->company->id, $this->user->id); $this->credit = CreditFactory::create($this->company->id, $user_id);
$this->credit->client_id = $this->client->id; $this->credit->client_id = $this->client->id;
$this->credit->line_items = $this->buildLineItems(); $this->credit->line_items = $this->buildLineItems();
@ -409,14 +413,14 @@ trait MockAccountData
CreditInvitation::factory()->create([ CreditInvitation::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'client_contact_id' => $contact->id, 'client_contact_id' => $contact->id,
'credit_id' => $this->credit->id, 'credit_id' => $this->credit->id,
]); ]);
CreditInvitation::factory()->create([ CreditInvitation::factory()->create([
'user_id' => $this->user->id, 'user_id' => $user_id,
'company_id' => $this->company->id, 'company_id' => $this->company->id,
'client_contact_id' => $contact2->id, 'client_contact_id' => $contact2->id,
'credit_id' => $this->credit->id, 'credit_id' => $this->credit->id,
@ -524,7 +528,7 @@ trait MockAccountData
$gs = new GroupSetting; $gs = new GroupSetting;
$gs->company_id = $this->company->id; $gs->company_id = $this->company->id;
$gs->user_id = $this->user->id; $gs->user_id = $user_id;
$gs->settings = ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults()); $gs->settings = ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults());
$gs->name = 'Default Client Settings'; $gs->name = 'Default Client Settings';
$gs->save(); $gs->save();
@ -542,9 +546,11 @@ trait MockAccountData
$data[1]['fee_tax_name3'] = ''; $data[1]['fee_tax_name3'] = '';
$data[1]['fee_tax_rate3'] = 0; $data[1]['fee_tax_rate3'] = 0;
$data[1]['fee_cap'] = ''; $data[1]['fee_cap'] = '';
$data[1]['is_enabled'] = true;
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $this->company->id; $cg->company_id = $this->company->id;
$cg->user_id = $this->user->id; $cg->user_id = $user_id;
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23'; $cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
$cg->require_cvv = true; $cg->require_cvv = true;
$cg->require_billing_address = true; $cg->require_billing_address = true;
@ -556,7 +562,7 @@ trait MockAccountData
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $this->company->id; $cg->company_id = $this->company->id;
$cg->user_id = $this->user->id; $cg->user_id = $user_id;
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23'; $cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
$cg->require_cvv = true; $cg->require_cvv = true;
$cg->require_billing_address = true; $cg->require_billing_address = true;