Add mode_of_payment field to change service call in rider API #159
This commit is contained in:
parent
2925ec3df3
commit
9ae9a550d0
1 changed files with 8 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ use App\Ramcar\APIRiderStatus;
|
||||||
use App\Ramcar\TransactionOrigin;
|
use App\Ramcar\TransactionOrigin;
|
||||||
use App\Ramcar\TradeInType;
|
use App\Ramcar\TradeInType;
|
||||||
use App\Ramcar\InvoiceStatus;
|
use App\Ramcar\InvoiceStatus;
|
||||||
|
use App\Ramcar\ModeOfPayment;
|
||||||
|
|
||||||
use App\Service\InvoiceCreator;
|
use App\Service\InvoiceCreator;
|
||||||
use App\Service\MQTTClient;
|
use App\Service\MQTTClient;
|
||||||
|
|
@ -732,6 +733,13 @@ class RAPIController extends Controller
|
||||||
if (!TradeInType::validate($trade_in))
|
if (!TradeInType::validate($trade_in))
|
||||||
$trade_in = null;
|
$trade_in = null;
|
||||||
|
|
||||||
|
// check mode of payment
|
||||||
|
$mode = $req->request->get('mode_of_payment');
|
||||||
|
if (!ModeOfPayment::validate($mode))
|
||||||
|
$mode = ModeOfPayment::CASH;
|
||||||
|
$jo->setModeOfPayment($mode);
|
||||||
|
|
||||||
|
|
||||||
// generate new invoice
|
// generate new invoice
|
||||||
$crit = new InvoiceCriteria();
|
$crit = new InvoiceCriteria();
|
||||||
$crit->setServiceType($stype_id);
|
$crit->setServiceType($stype_id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue