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