From 5bbeaaba602e51de4fe92162f6d6c59caed14779 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 Sep 2021 17:56:56 +1000 Subject: [PATCH] PayFast API token billing --- app/PaymentDrivers/PayFast/Token.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/PayFast/Token.php b/app/PaymentDrivers/PayFast/Token.php index f263d6885098..dc9cb5592260 100644 --- a/app/PaymentDrivers/PayFast/Token.php +++ b/app/PaymentDrivers/PayFast/Token.php @@ -93,10 +93,15 @@ class Token // $header['signature'] = md5( $this->generate_parameter_string(array_merge($header, $body), false) ); // $result = $this->send($header, $body, $cgt->token); + $api = new \PayFast\PayFastPayment( + [ + 'merchantId' => $this->company_gateway->getConfigField('merchantId'), + 'passPhrase' => $this->company_gateway->getConfigField('passPhrase'), + 'testMode' => $this->company_gateway->getConfigField('testMode') + ] + ); - - $adhocArray = $this->payfast - ->init() + $adhocArray = $api ->payfast ->subscriptions ->adhoc($cgt->token, ['amount' => $amount, 'item_name' => 'purchase']);