mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 11:14:37 -04:00
Simplify Logic
This commit is contained in:
parent
56e327a238
commit
eba06f2dfd
@ -124,22 +124,13 @@ class BlockonomicsPaymentDriver extends BaseDriver
|
|||||||
throw new PaymentFailed('Secret does not match');
|
throw new PaymentFailed('Secret does not match');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only accept confirmed transactions
|
// Only accept confirmed transactions
|
||||||
if ($status != 2) {
|
if ($status != 2) {
|
||||||
throw new PaymentFailed('Transaction not confirmed');
|
throw new PaymentFailed('Transaction not confirmed');
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($status) {
|
$statusId = Payment::STATUS_COMPLETED;
|
||||||
case 0:
|
|
||||||
$statusId = Payment::STATUS_PENDING;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$statusId = Payment::STATUS_PENDING;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$statusId = Payment::STATUS_COMPLETED;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save the updated payment status
|
// Save the updated payment status
|
||||||
if ($payment->status_id != $statusId) {
|
if ($payment->status_id != $statusId) {
|
||||||
@ -148,7 +139,7 @@ class BlockonomicsPaymentDriver extends BaseDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
header('HTTP/1.1 200 OK');
|
header('HTTP/1.1 200 OK');
|
||||||
echo 'SUCCESS';
|
echo "Success";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user