1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

return 200 HTTP code on webhook response from payfast.

This commit is contained in:
David Bomba 2021-07-20 07:58:40 +10:00
parent 44c88496af
commit 46852794aa
2 changed files with 13 additions and 6 deletions

View File

@ -248,7 +248,7 @@ class CreditCard
$payment = $this->payfast->createPayment($payment_record, Payment::STATUS_COMPLETED);
return redirect()->route('client.payments.show', ['payment' => $this->payfast->encodePrimaryKey($payment->id)]);
//return redirect()->route('client.payments.show', ['payment' => $this->payfast->encodePrimaryKey($payment->id)]);
}
private function processUnsuccessfulPayment($server_response)

View File

@ -169,6 +169,7 @@ class PayFastPaymentDriver extends BaseDriver
{
$data = $request->all();
nlog("payfast");
nlog($data);
if(array_key_exists('m_payment_id', $data))
@ -179,17 +180,23 @@ class PayFastPaymentDriver extends BaseDriver
switch ($hash)
{
case 'cc_auth':
return $this->setPaymentMethod(GatewayType::CREDIT_CARD)
->authorizeResponse($request);
$this->setPaymentMethod(GatewayType::CREDIT_CARD)
->authorizeResponse($request);
return response()->json([], 200);
break;
default:
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$data['m_payment_id']])->first();
return $this->setPaymentMethod(GatewayType::CREDIT_CARD)
->setPaymentHash($payment_hash)
->processPaymentResponse($request);
$this->setPaymentMethod(GatewayType::CREDIT_CARD)
->setPaymentHash($payment_hash)
->processPaymentResponse($request);
return response()->json([], 200);
break;
}