Working on gocardless

This commit is contained in:
Hillel Coren 2017-09-06 20:51:15 +03:00
parent 95910ecaec
commit a7afa16c69
2 changed files with 24 additions and 1 deletions

View File

@ -299,7 +299,9 @@ class OnlinePaymentController extends BaseController
return response()->json(['message' => $result]);
} catch (Exception $exception) {
//Utils::logError($exception->getMessage(), 'PHP');
if (! Uitls::isNinjaProd()) {
Utils::logError($exception->getMessage(), 'HOOK');
}
return response()->json(['message' => $exception->getMessage()], 500);
}

View File

@ -69,5 +69,26 @@ class GoCardlessV2RedirectPaymentDriver extends BasePaymentDriver
return $paymentMethod;
}
protected function creatingPayment($payment, $paymentMethod)
{
\Log::info(json_encode($this->purchaseResponse));
//$payment->payment_status_id = $this->purchaseResponse['status'] == 'succeeded' ? PAYMENT_STATUS_COMPLETED : PAYMENT_STATUS_PENDING;
return $payment;
}
public function handleWebHook($input)
{
\Log::info('handleWebHook... ' . $_SERVER['HTTP_WEBHOOK_SIGNATURE']);
\Log::info(json_encode($input));
$event = $this->gateway()->parseNotification(
file_get_contents('php://input'),
$_SERVER['HTTP_WEBHOOK_SIGNATURE']
);
\Log::info('event:');
\Log::info(json_encode($event));
}
}