From d2735df1c37e71a313e5a6559fea0f510ba80903 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 Sep 2021 13:19:06 +1000 Subject: [PATCH] Turning on token billing for PayFast --- app/PaymentDrivers/PayFast/Token.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/PaymentDrivers/PayFast/Token.php b/app/PaymentDrivers/PayFast/Token.php index 3dd2be832b12..6e2dfe8dc536 100644 --- a/app/PaymentDrivers/PayFast/Token.php +++ b/app/PaymentDrivers/PayFast/Token.php @@ -86,12 +86,16 @@ class Token $body = [ 'merchant_id' => $this->payfast->company_gateway->getConfigField('merchantId'), 'merchant_key' => $this->payfast->company_gateway->getConfigField('merchantKey'), - 'passphrase' => $this->payfast->company_gateway->getConfigField('passPhrase'), + 'return_url' => route('client.payment_methods.index'), + 'cancel_url' => route('client.payment_methods.index'), + 'notify_url' => $this->payfast->genericWebhookUrl(), + 'm_payment_id' => $payment_hash->hash, 'amount' => $amount, 'item_name' => 'purchase', - 'm_payment_id' => $payment_hash->hash, - // 'item_description' => ctrans('texts.invoices') . ': ' . collect($payment_hash->invoices())->pluck('invoice_number'), - // 'passphrase' => $this->payfast->company_gateway->getConfigField('passphrase'), + 'item_description' => 'Purchase', + 'subscription_type' => 1, + 'passphrase' => $this->payfast->company_gateway->getConfigField('passphrase'), + ]; $header['signature'] = $this->payfast->generateSignature($body);