From 818a8fff3091b8de21498a623457860c543e3cdf Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Fri, 26 Jun 2020 05:22:46 +0000 Subject: [PATCH] Add cash to mode of payments. #424 --- src/Ramcar/CMBModeOfPayment.php | 2 ++ src/Service/RiderAPIHandler/CMBRiderAPIHandler.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ramcar/CMBModeOfPayment.php b/src/Ramcar/CMBModeOfPayment.php index a6a8db4e..7d0a4ec2 100644 --- a/src/Ramcar/CMBModeOfPayment.php +++ b/src/Ramcar/CMBModeOfPayment.php @@ -4,12 +4,14 @@ namespace App\Ramcar; class CMBModeOfPayment extends NameValue { + const CASH = 'cash'; const SHOPEE = 'shopee'; const LAZADA = 'lazada'; const CREDIT_CARD = 'credit_card'; const ONLINE_TRANSFER = 'online_transfer'; const COLLECTION = [ + 'cash' => 'Cash', 'shopee' => 'Shopee', 'lazada' => 'Lazada', 'credit_card' => 'Credit Card', diff --git a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php index d2d1f5e0..d0bbcdb5 100644 --- a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php +++ b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php @@ -1256,7 +1256,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface // TODO: defaulting to credit_card for now if mode of payment is invalid $mode = $req->request->get('mode_of_payment'); if (!CMBModeOfPayment::validate($mode)) - $mode = CMBModeOfPayment::CREDIT_CARD; + $mode = CMBModeOfPayment::CASH; $jo->setModeOfPayment($mode); // generate new invoice