mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:04:41 -04:00
Fixes for base driver
This commit is contained in:
parent
bc46ab86a2
commit
1ca4eaba7b
@ -82,7 +82,7 @@ class CreditCard
|
|||||||
|
|
||||||
public function authorizeView($data)
|
public function authorizeView($data)
|
||||||
{
|
{
|
||||||
$hash = Cache::put(Str::random(32), 'cc_auth', 300);
|
// $hash = Cache::put(Str::random(32), 'cc_auth', 300);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'merchant_id' => $this->payfast->company_gateway->getConfigField('merchantId'),
|
'merchant_id' => $this->payfast->company_gateway->getConfigField('merchantId'),
|
||||||
@ -92,6 +92,7 @@ class CreditCard
|
|||||||
'notify_url' => $this->payfast->genericWebhookUrl(),
|
'notify_url' => $this->payfast->genericWebhookUrl(),
|
||||||
'amount' => 5,
|
'amount' => 5,
|
||||||
'item_name' => 'pre-auth',
|
'item_name' => 'pre-auth',
|
||||||
|
'item_description' => 'Pre authorization',
|
||||||
'subscription_type' => 2,
|
'subscription_type' => 2,
|
||||||
'passphrase' => $this->payfast->company_gateway->getConfigField('passphrase'),
|
'passphrase' => $this->payfast->company_gateway->getConfigField('passphrase'),
|
||||||
];
|
];
|
||||||
|
@ -20,7 +20,6 @@ use App\PaymentDrivers\PayFast\CreditCard;
|
|||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use \PayFastPayment;
|
use \PayFastPayment;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
|
|
||||||
class PayFastPaymentDriver extends BaseDriver
|
class PayFastPaymentDriver extends BaseDriver
|
||||||
{
|
{
|
||||||
@ -147,17 +146,10 @@ class PayFastPaymentDriver extends BaseDriver
|
|||||||
nlog($request->all());
|
nlog($request->all());
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
|
|
||||||
if(array_key_exists('m_payment_id', $data))
|
if(array_key_exists('m_payment_id', $data) && $data['m_payment_id'] == 'pre-auth')
|
||||||
{
|
{
|
||||||
|
return $this->setPaymentMethod(GatewayType::CREDIT_CARD)
|
||||||
$hash = Cache::get($data['m_payment_id']);
|
->authorizeResponse($request);
|
||||||
|
|
||||||
if($hash == 'cc_auth')
|
|
||||||
{
|
|
||||||
return $this->setPaymentMethod(GatewayType::CREDIT_CARD)
|
|
||||||
->authorizeResponse($request);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json([], 200);
|
return response()->json([], 200);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user