The following required dependency versions have been updated:
- The minimum PHP version is now v7.2
- The minimum Laravel version is now v6.0
- was
$payment = $request->user()->pay($request->amount, [
'udf1' => $request->user()->name,
'udf2' => $request->user()->email,
'udf3' => $trading_account->number
]);
- now
try {
$payment = $request->user()->pay($request->amount, [
'udf1' => $payable->name,
'udf2' => $payable->email,
'udf3' => $trading_account->number
]);
} catch (\Asciisd\Knet\Exceptions\PaymentActionRequired $exception) {
// here you can get payment from exception and redirect user to the url, or redirect him on finally closure
// the reason for this exception is that you can differ between the methods that just initiated and the ones they are faield or captured
$payment = $exception->payment;
} finally {
return response()->json([
'url' => $payment->action_url()
]);
}
- was
$payment = $request->user()->pay($request->amount, [
'udf1' => $payable->name,
'udf2' => $payable->email,
'udf3' => $trading_account->number
]);
$payment->customer()->id;
- now
$payment = $request->user()->pay($request->amount, [
'udf1' => $payable->name,
'udf2' => $payable->email,
'udf3' => $trading_account->number
]);
$payment->owner()->id;
- was
Payment::CAPTURED;
Payment::NOT_CAPTURED;
Payment::PENDING;
Payment::CURRENCY;
- now
// strings
KPayResponseStatus::CAPTURED;
KPayResponseStatus::ABANDONED;
KPayResponseStatus::CANCELLED;
KPayResponseStatus::FAILED;
KPayResponseStatus::DECLINED;
KPayResponseStatus::RESTRICTED;
KPayResponseStatus::VOID;
KPayResponseStatus::TIMEDOUT;
KPayResponseStatus::UNKNOWN;
KPayResponseStatus::NOT_CAPTURED;
KPayResponseStatus::INITIATED;
// arrays
KPayResponseStatus::SUCCESS_RESPONSES;
KPayResponseStatus::FAILED_RESPONSES;
KPayResponseStatus::NEED_MORE_ACTION;
- from
isCaptured()
toisSucceeded()
- from
isFailed()
toisFailure()
- from
isPending()
torequiresAction()
- from
url()
toactionUrl()
if you ever used Knet::make()
, that's now changed to KPayManager::make()