From 2a7701c4ff88fc6e772bb44943a687f39ae3e817 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 31 Oct 2024 06:49:12 -0400 Subject: [PATCH] Spend action --- www-api/app/Controllers/WrenchWallet.php | 6 ++++++ www-api/app/Models/WrenchWalletModel.php | 26 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/www-api/app/Controllers/WrenchWallet.php b/www-api/app/Controllers/WrenchWallet.php index 20379b6a..b9454b93 100644 --- a/www-api/app/Controllers/WrenchWallet.php +++ b/www-api/app/Controllers/WrenchWallet.php @@ -249,6 +249,12 @@ class WrenchWallet extends BaseController 'ADD_VIRTUAL_CARD' => $this->wrenchWalletModel->addVirtualCardWallet() ]; } + elseif ($item['code']=='NAIRA'){ + $out['result_list'][$index]['extra_actions'] = + [ + 'SPEND_FROM_BALANCE' => $this->wrenchWalletModel->spendFromBalanceWallet() + ]; + } else{ $out['result_list'][$index]['extra_actions'] = []; } diff --git a/www-api/app/Models/WrenchWalletModel.php b/www-api/app/Models/WrenchWalletModel.php index f8f1e073..8923462d 100644 --- a/www-api/app/Models/WrenchWalletModel.php +++ b/www-api/app/Models/WrenchWalletModel.php @@ -62,4 +62,30 @@ protected array $allSettings; ] ]; } + public function spendFromBalanceWallet():array{ + return [ + [ + "text" => 'Spend', + "wallet_country" => ['NG'], + "amount" => 0, + "id" => 1, + "code" => "NAIRA", + "description" => "Spend from balance", + "symbol" => "$", + "action_type" => "AC_AD_WR_FUND", + "lorder" => 0, + "country" => "", + "processor" => 9010, + "current_balance" => 0, + "transfer_limit" => 0, + "wallet_uid" => "", + "escrow" => 0, + "status" => 0, + "show_balance" => false, + "rt_action_text" => "Spend", + "banner" => 'https://www.wrenchboard.com/assets/images/apps/wallet/wallet-card.jpg', + "icon" => 'https://www.wrenchboard.com/assets/images/apps/wallet/icon/cards.png' + ] + ]; + } } \ No newline at end of file