From 57852a6ca4125b613685d66ba772846c40253c37 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 Sep 2021 10:07:29 +1000 Subject: [PATCH] Fixes for token billing - payfast --- app/PaymentDrivers/PayFast/Token.php | 7 +++++-- app/PaymentDrivers/PayFastPaymentDriver.php | 2 +- database/seeders/PaymentLibrariesSeeder.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/PaymentDrivers/PayFast/Token.php b/app/PaymentDrivers/PayFast/Token.php index fc1235a0d3cc..52a93b87d027 100644 --- a/app/PaymentDrivers/PayFast/Token.php +++ b/app/PaymentDrivers/PayFast/Token.php @@ -88,13 +88,16 @@ class Token $body = [ 'amount' => $amount, 'item_name' => 'purchase', - 'item_description' => ctrans('texts.invoices') . ': ' . collect($payment_hash->invoices())->pluck('invoice_number'), 'm_payment_id' => $payment_hash->hash, - 'passphrase' => $this->payfast->company_gateway->getConfigField('passphrase'), ]; $header['signature'] = $this->genSig(array_merge($header, $body)); + $body = array_merge($body,[ + 'item_description' => ctrans('texts.invoices') . ': ' . collect($payment_hash->invoices())->pluck('invoice_number'), + 'passphrase' => $this->payfast->company_gateway->getConfigField('passphrase'), + ]); + nlog($header['signature']); nlog($header['timestamp']); nlog($this->payfast->company_gateway->getConfigField('merchantId')); diff --git a/app/PaymentDrivers/PayFastPaymentDriver.php b/app/PaymentDrivers/PayFastPaymentDriver.php index 6f56aebe9d3f..864973ce3214 100644 --- a/app/PaymentDrivers/PayFastPaymentDriver.php +++ b/app/PaymentDrivers/PayFastPaymentDriver.php @@ -77,7 +77,7 @@ class PayFastPaymentDriver extends BaseDriver ] ); - } catch(Exception $e) { + } catch(\Exception $e) { echo '##PAYFAST## There was an exception: '.$e->getMessage(); diff --git a/database/seeders/PaymentLibrariesSeeder.php b/database/seeders/PaymentLibrariesSeeder.php index 17a9ac173588..818431f7de96 100644 --- a/database/seeders/PaymentLibrariesSeeder.php +++ b/database/seeders/PaymentLibrariesSeeder.php @@ -97,7 +97,7 @@ class PaymentLibrariesSeeder extends Seeder Gateway::query()->update(['visible' => 0]); - Gateway::whereIn('id', [1,7,15,20,39,46,55,50,57])->update(['visible' => 1]); + Gateway::whereIn('id', [1,7,11,15,20,39,46,55,50,57])->update(['visible' => 1]); if (Ninja::isHosted()) { Gateway::whereIn('id', [20])->update(['visible' => 0]);