mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-01 21:02:54 +09:00
Improve clarity when marking unpaid invoices without a set gateway (#2088)
* Improve clarity when marking unpaid invoices without a set gateway * Remove the quotes * Update AdminTest.php
This commit is contained in:
1 parent
52f582becf
commit
bc72de3103
2 files changed
+11
-1
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright 2022-2023 FOSSBilling
|
||||
* Copyright 2011-2021 BoxBilling, Inc.
|
||||
@@ -14,6 +15,8 @@
|
||||
|
||||
namespace Box\Mod\Invoice\Api;
|
||||
|
||||
use FOSSBilling\InformationException;
|
||||
|
||||
class Admin extends \Api_Abstract
|
||||
{
|
||||
/**
|
||||
@@ -65,6 +68,11 @@ class Admin extends \Api_Abstract
|
||||
}
|
||||
$invoice = $this->_getInvoice($data);
|
||||
$gateway_id = ['id' => $invoice->gateway_id];
|
||||
|
||||
if (!$gateway_id['id']) {
|
||||
throw new InformationException('You must set the payment gateway in the invoice manage tab before marking it as paid.');
|
||||
}
|
||||
|
||||
$payGateway = $this->gateway_get($gateway_id);
|
||||
$charge = false;
|
||||
|
||||
|
||||
@@ -91,9 +91,11 @@ class AdminTest extends \BBTestCase
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray');
|
||||
|
||||
$dbMock = $this->getMockBuilder('\Box_Database')->getMock();
|
||||
$model = new \Model_Invoice();
|
||||
$model->loadBean(new \DummyBean());
|
||||
$model->gateway_id = '1';
|
||||
|
||||
$dbMock = $this->getMockBuilder('\Box_Database')->getMock();
|
||||
$dbMock->expects($this->atLeastOnce())
|
||||
->method('getExistingModelById')
|
||||
->willReturn($model);
|
||||
|
||||
Reference in new issue
Block a user