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:
Belle Aerni authored and GitHub committed 2024-01-19 13:11:18 -08:00
1 parent 52f582becf
commit bc72de3103
2 files changed
+11 -1

No files matched your search

+8
View File
@@ -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);