diff --git a/VERSION.txt b/VERSION.txt index eeb25c4a8c70..ba7fe367e31c 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.1.34 \ No newline at end of file +5.1.35 \ No newline at end of file diff --git a/app/Jobs/Mail/PaymentFailureMailer.php b/app/Jobs/Mail/PaymentFailureMailer.php index bce2f69c3656..7f40eda15cb5 100644 --- a/app/Jobs/Mail/PaymentFailureMailer.php +++ b/app/Jobs/Mail/PaymentFailureMailer.php @@ -38,7 +38,7 @@ class PaymentFailureMailer implements ShouldQueue public $company; - public $payment_hash; + public $amount; public $settings; @@ -50,7 +50,7 @@ class PaymentFailureMailer implements ShouldQueue * @param $company * @param $amount */ - public function __construct($client, $error, $company, $payment_hash) + public function __construct($client, $error, $company, $amount) { $this->company = $company; @@ -58,7 +58,7 @@ class PaymentFailureMailer implements ShouldQueue $this->client = $client; - $this->payment_hash = $payment_hash; + $this->amount = $amount; $this->company = $company; @@ -86,7 +86,7 @@ class PaymentFailureMailer implements ShouldQueue if (($key = array_search('mail', $methods)) !== false) { unset($methods[$key]); - $mail_obj = (new PaymentFailureObject($this->client, $this->error, $this->company, $this->payment_hash))->build(); + $mail_obj = (new PaymentFailureObject($this->client, $this->error, $this->company, $this->amount))->build(); $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer($mail_obj); diff --git a/app/Mail/Admin/PaymentFailureObject.php b/app/Mail/Admin/PaymentFailureObject.php index 3c199f8e491e..49ddfa4abe0c 100644 --- a/app/Mail/Admin/PaymentFailureObject.php +++ b/app/Mail/Admin/PaymentFailureObject.php @@ -26,9 +26,9 @@ class PaymentFailureObject public $company; - public $payment_hash; + public $amount; - private $invoices; + // private $invoices; /** * Create a new job instance. @@ -38,7 +38,7 @@ class PaymentFailureObject * @param $company * @param $amount */ - public function __construct($client, $error, $company, $payment_hash) + public function __construct($client, $error, $company, $amount) { $this->client = $client; @@ -46,7 +46,7 @@ class PaymentFailureObject $this->company = $company; - $this->payment_hash = $payment_hash; + $this->amount = $amount; $this->company = $company; @@ -55,7 +55,7 @@ class PaymentFailureObject public function build() { - $this->invoices = Invoice::whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->get(); + // $this->invoices = Invoice::whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->get(); $mail_obj = new stdClass; $mail_obj->amount = $this->getAmount(); @@ -70,7 +70,7 @@ class PaymentFailureObject private function getAmount() { - return array_sum(array_column($this->payment_hash->invoices(), 'amount')) + $this->payment_hash->fee_total; + return $this->amount; } diff --git a/config/ninja.php b/config/ninja.php index 9f868a7a5b1d..407fcb0b25de 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,7 +14,7 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', ''), - 'app_version' => '5.1.34', + 'app_version' => '5.1.35', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),