From 1bfc9907581fa9ed24f1ea778a0f5165a2fd562a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 4 Mar 2023 08:45:41 +1100 Subject: [PATCH 1/2] Update Authorize.net to add in PO Number --- _ide_helper.php | 172 +++++++++++------- app/Http/Controllers/ActivityController.php | 3 +- .../Authorize/ChargePaymentProfile.php | 13 +- database/seeders/RandomDataSeeder.php | 4 +- 4 files changed, 115 insertions(+), 77 deletions(-) diff --git a/_ide_helper.php b/_ide_helper.php index 26c323563f..a14275a20c 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -4,7 +4,7 @@ /** * A helper file for Laravel, to provide autocomplete information to your IDE - * Generated for Laravel 9.52.0. + * Generated for Laravel 9.52.4. * * This file should not be included in your code, only analyzed by your IDE! * @@ -4193,7 +4193,7 @@ */ public static function lock($name, $seconds = 0, $owner = null) { - /** @var \Illuminate\Cache\FileStore $instance */ + /** @var \Illuminate\Cache\RedisStore $instance */ return $instance->lock($name, $seconds, $owner); } /** @@ -4206,7 +4206,7 @@ */ public static function restoreLock($name, $owner) { - /** @var \Illuminate\Cache\FileStore $instance */ + /** @var \Illuminate\Cache\RedisStore $instance */ return $instance->restoreLock($name, $owner); } /** @@ -4217,30 +4217,65 @@ */ public static function flush() { - /** @var \Illuminate\Cache\FileStore $instance */ + /** @var \Illuminate\Cache\RedisStore $instance */ return $instance->flush(); } /** - * Get the Filesystem instance. + * Get the Redis connection instance. * - * @return \Illuminate\Filesystem\Filesystem + * @return \Illuminate\Redis\Connections\Connection * @static */ - public static function getFilesystem() + public static function connection() { - /** @var \Illuminate\Cache\FileStore $instance */ - return $instance->getFilesystem(); + /** @var \Illuminate\Cache\RedisStore $instance */ + return $instance->connection(); } /** - * Get the working directory of the cache. + * Get the Redis connection instance that should be used to manage locks. * - * @return string + * @return \Illuminate\Redis\Connections\Connection * @static */ - public static function getDirectory() + public static function lockConnection() { - /** @var \Illuminate\Cache\FileStore $instance */ - return $instance->getDirectory(); + /** @var \Illuminate\Cache\RedisStore $instance */ + return $instance->lockConnection(); + } + /** + * Specify the name of the connection that should be used to store data. + * + * @param string $connection + * @return void + * @static + */ + public static function setConnection($connection) + { + /** @var \Illuminate\Cache\RedisStore $instance */ + $instance->setConnection($connection); + } + /** + * Specify the name of the connection that should be used to manage locks. + * + * @param string $connection + * @return \Illuminate\Cache\RedisStore + * @static + */ + public static function setLockConnection($connection) + { + /** @var \Illuminate\Cache\RedisStore $instance */ + return $instance->setLockConnection($connection); + } + /** + * Get the Redis database instance. + * + * @return \Illuminate\Contracts\Redis\Factory + * @static + */ + public static function getRedis() + { + /** @var \Illuminate\Cache\RedisStore $instance */ + return $instance->getRedis(); } /** * Get the cache key prefix. @@ -4250,8 +4285,20 @@ */ public static function getPrefix() { - /** @var \Illuminate\Cache\FileStore $instance */ + /** @var \Illuminate\Cache\RedisStore $instance */ return $instance->getPrefix(); + } + /** + * Set the cache key prefix. + * + * @param string $prefix + * @return void + * @static + */ + public static function setPrefix($prefix) + { + /** @var \Illuminate\Cache\RedisStore $instance */ + $instance->setPrefix($prefix); } } @@ -9854,45 +9901,44 @@ return $instance->setConnectionName($name); } /** - * Release a reserved job back onto the queue after (n) seconds. + * Migrate the delayed jobs that are ready to the regular queue. * - * @param string $queue - * @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job - * @param int $delay - * @return mixed + * @param string $from + * @param string $to + * @param int $limit + * @return array * @static */ - public static function release($queue, $job, $delay) + public static function migrateExpiredJobs($from, $to) { - /** @var \Illuminate\Queue\DatabaseQueue $instance */ - return $instance->release($queue, $job, $delay); + /** @var \Illuminate\Queue\RedisQueue $instance */ + return $instance->migrateExpiredJobs($from, $to); } /** * Delete a reserved job from the queue. * * @param string $queue - * @param string $id + * @param \Illuminate\Queue\Jobs\RedisJob $job * @return void - * @throws \Throwable * @static */ - public static function deleteReserved($queue, $id) + public static function deleteReserved($queue, $job) { - /** @var \Illuminate\Queue\DatabaseQueue $instance */ - $instance->deleteReserved($queue, $id); + /** @var \Illuminate\Queue\RedisQueue $instance */ + $instance->deleteReserved($queue, $job); } /** * Delete a reserved job from the reserved queue and release it. * * @param string $queue - * @param \Illuminate\Queue\Jobs\DatabaseJob $job + * @param \Illuminate\Queue\Jobs\RedisJob $job * @param int $delay * @return void * @static */ public static function deleteAndRelease($queue, $job, $delay) { - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ $instance->deleteAndRelease($queue, $job, $delay); } /** @@ -9904,7 +9950,7 @@ */ public static function clear($queue) { - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ return $instance->clear($queue); } /** @@ -9916,19 +9962,30 @@ */ public static function getQueue($queue) { - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ return $instance->getQueue($queue); } /** - * Get the underlying database instance. + * Get the connection for the queue. * - * @return \Illuminate\Database\Connection + * @return \Illuminate\Redis\Connections\Connection * @static */ - public static function getDatabase() + public static function getConnection() { - /** @var \Illuminate\Queue\DatabaseQueue $instance */ - return $instance->getDatabase(); + /** @var \Illuminate\Queue\RedisQueue $instance */ + return $instance->getConnection(); + } + /** + * Get the underlying Redis instance. + * + * @return \Illuminate\Contracts\Redis\Factory + * @static + */ + public static function getRedis() + { + /** @var \Illuminate\Queue\RedisQueue $instance */ + return $instance->getRedis(); } /** * Get the backoff for an object-based queue handler. @@ -9939,7 +9996,7 @@ */ public static function getJobBackoff($job) { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ return $instance->getJobBackoff($job); } /** @@ -9951,7 +10008,7 @@ */ public static function getJobExpiration($job) { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ return $instance->getJobExpiration($job); } /** @@ -9963,7 +10020,7 @@ */ public static function createPayloadUsing($callback) { //Method inherited from \Illuminate\Queue\Queue - \Illuminate\Queue\DatabaseQueue::createPayloadUsing($callback); + \Illuminate\Queue\RedisQueue::createPayloadUsing($callback); } /** * Get the container instance being used by the connection. @@ -9973,7 +10030,7 @@ */ public static function getContainer() { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ return $instance->getContainer(); } /** @@ -9985,7 +10042,7 @@ */ public static function setContainer($container) { //Method inherited from \Illuminate\Queue\Queue - /** @var \Illuminate\Queue\DatabaseQueue $instance */ + /** @var \Illuminate\Queue\RedisQueue $instance */ $instance->setContainer($container); } @@ -10803,12 +10860,12 @@ * Clones a request and overrides some of its parameters. * * @return static - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters + * @param array|null $query The GET parameters + * @param array|null $request The POST parameters + * @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array|null $cookies The COOKIE parameters + * @param array|null $files The FILES parameters + * @param array|null $server The SERVER parameters * @static */ public static function duplicate($query = null, $request = null, $attributes = null, $cookies = null, $files = null, $server = null) @@ -17797,25 +17854,6 @@ /** * * - * @method static void createSubscription(array|string $channels, \Closure $callback, string $method = 'subscribe') - * @method static \Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder funnel(string $name) - * @method static \Illuminate\Redis\Limiters\DurationLimiterBuilder throttle(string $name) - * @method static mixed client() - * @method static void subscribe(array|string $channels, \Closure $callback) - * @method static void psubscribe(array|string $channels, \Closure $callback) - * @method static mixed command(string $method, array $parameters = []) - * @method static void listen(\Closure $callback) - * @method static string|null getName() - * @method static \Illuminate\Redis\Connections\Connection setName(string $name) - * @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher() - * @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events) - * @method static void unsetEventDispatcher() - * @method static void macro(string $name, object|callable $macro) - * @method static void mixin(object $mixin, bool $replace = true) - * @method static bool hasMacro(string $name) - * @method static void flushMacros() - * @method static mixed macroCall(string $method, array $parameters) - * @see \Illuminate\Redis\RedisManager */ class Redis { /** diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 71de890401..89e3b19404 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -87,7 +87,8 @@ class ActivityController extends BaseController { $default_activities = $request->has('rows') ? $request->input('rows') : 50; - $activities = Activity::orderBy('created_at', 'DESC') + $activities = Activity::with('user') + ->orderBy('created_at', 'DESC') ->company() ->take($default_activities); diff --git a/app/PaymentDrivers/Authorize/ChargePaymentProfile.php b/app/PaymentDrivers/Authorize/ChargePaymentProfile.php index 8f8c33200f..65fcb33590 100644 --- a/app/PaymentDrivers/Authorize/ChargePaymentProfile.php +++ b/app/PaymentDrivers/Authorize/ChargePaymentProfile.php @@ -30,7 +30,7 @@ class ChargePaymentProfile { use MakesHash; - public function __construct(AuthorizePaymentDriver $authorize) + public function __construct(public AuthorizePaymentDriver $authorize) { $this->authorize = $authorize; } @@ -49,6 +49,7 @@ class ChargePaymentProfile $profileToCharge->setPaymentProfile($paymentProfile); $invoice_numbers = ''; + $po_numbers = ''; $taxAmount = 0; $invoiceTotal = 0; $invoiceTaxes = 0; @@ -57,6 +58,8 @@ class ChargePaymentProfile $invoice_numbers = collect($this->authorize->payment_hash->data->invoices)->pluck('invoice_number')->implode(','); $invObj = Invoice::whereIn('id', $this->transformKeys(array_column($this->authorize->payment_hash->invoices(), 'invoice_id')))->withTrashed()->get(); + $po_numbers = $invObj->pluck('po_number')->implode(','); + $invoiceTotal = round($invObj->pluck('amount')->sum(), 2); $invoiceTaxes = round($invObj->pluck('total_taxes')->sum(), 2); @@ -73,6 +76,7 @@ class ChargePaymentProfile $order = new OrderType(); $order->setInvoiceNumber(substr($invoice_numbers, 0, 19)); $order->setDescription(substr($description, 0, 255)); + $order->setSupplierOrderReference(substr($po_numbers, 0, 19));// 04-03-2023 $tax = new ExtendedAmountType(); $tax->setName('tax'); @@ -99,14 +103,9 @@ class ChargePaymentProfile if ($tresponse != null && $tresponse->getMessages() != null) { nlog(' Transaction Response code : '.$tresponse->getResponseCode()); - nlog('Charge Customer Profile APPROVED :'); + nlog(' Charge Customer Profile APPROVED :'); nlog(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()); nlog(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()); - nlog(' Code : '.$tresponse->getMessages()[0]->getCode()); - nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()); - //nlog(" Charge Customer Profile TRANS STATUS : " . $tresponse->getTransactionStatus() ); - //nlog(" Charge Customer Profile Amount : " . $tresponse->getAuthAmount()); - nlog(' Code : '.$tresponse->getMessages()[0]->getCode()); nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()); nlog(print_r($tresponse->getMessages()[0], 1)); diff --git a/database/seeders/RandomDataSeeder.php b/database/seeders/RandomDataSeeder.php index 2c520b1810..d0bd89a9eb 100644 --- a/database/seeders/RandomDataSeeder.php +++ b/database/seeders/RandomDataSeeder.php @@ -151,8 +151,8 @@ class RandomDataSeeder extends Seeder 'email' => 'permissions@example.com', ]); - $user->first_name = 'per'; - $user->last_name = 'missions'; + $user->first_name = 'Permissions'; + $user->last_name = 'Test'; $user->password = Hash::make('password'); $user->account_id = $account->id; $user->email_verified_at = now(); From 58a22f7d87a14c8622d938d9fce29917764730d6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 4 Mar 2023 09:13:51 +1100 Subject: [PATCH 2/2] v5.5.82 --- config/ninja.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/ninja.php b/config/ninja.php index 2311eb140c..5b364807b4 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.81', - 'app_tag' => '5.5.81', + 'app_version' => '5.5.82', + 'app_tag' => '5.5.82', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), @@ -212,4 +212,5 @@ return [ 'dev_mode' => env("YODLEE_DEV_MODE", false), 'config_name' => env("YODLEE_CONFIG_NAME", false), ], + 'licenses' => env('LICENSES',false), ];