Add mode of payment to payment in rider api #424
This commit is contained in:
parent
fe363e1df6
commit
4ec5ddd993
2 changed files with 15 additions and 5 deletions
|
|
@ -4,13 +4,15 @@ namespace App\Ramcar;
|
||||||
|
|
||||||
class CMBModeOfPayment extends NameValue
|
class CMBModeOfPayment extends NameValue
|
||||||
{
|
{
|
||||||
const CASH = 'cash';
|
const SHOPEE = 'shopee';
|
||||||
|
const LAZADA = 'lazada';
|
||||||
const CREDIT_CARD = 'credit_card';
|
const CREDIT_CARD = 'credit_card';
|
||||||
const BANK_TRANSFER = 'bank_transfer';
|
const ONLINE_TRANSFER = 'online_transfer';
|
||||||
|
|
||||||
const COLLECTION = [
|
const COLLECTION = [
|
||||||
'cash' => 'Cash',
|
'shopee' => 'Shopee',
|
||||||
|
'lazada' => 'Lazada',
|
||||||
'credit_card' => 'Credit Card',
|
'credit_card' => 'Credit Card',
|
||||||
'bank_transfer' => 'Bank Transfer',
|
'online_transfer' => 'Online Transfer',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1007,7 +1007,10 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
|
|
||||||
public function payment(Request $req)
|
public function payment(Request $req)
|
||||||
{
|
{
|
||||||
$required_params = ['jo_id'];
|
$required_params = [
|
||||||
|
'jo_id',
|
||||||
|
'mode_of_payment',
|
||||||
|
];
|
||||||
$data = $this->checkActiveJO($req, $required_params, $jo);
|
$data = $this->checkActiveJO($req, $required_params, $jo);
|
||||||
if (isset($data['error']))
|
if (isset($data['error']))
|
||||||
{
|
{
|
||||||
|
|
@ -1015,6 +1018,11 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add mode of payment
|
||||||
|
$mode = $req->request->get('mode_of_payment');
|
||||||
|
$jo->setModeOfPayment($mode);
|
||||||
|
|
||||||
|
|
||||||
// set invoice to paid
|
// set invoice to paid
|
||||||
$jo->getInvoice()->setStatus(InvoiceStatus::PAID);
|
$jo->getInvoice()->setStatus(InvoiceStatus::PAID);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue