diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 1b43ec88..591e5a4a 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -102,12 +102,10 @@ $routes->post('/en/wrench/api/v1/familylist', 'WrenchApi::apigate'); //$routes->post('/en/wrench/api/v1/familywallet', 'WrenchApi::apigate'); -$routes->post('/en/wrench/api/v1/getwallets', 'WrenchApi::apigate'); // to be retired - - +$routes->post('/en/wrench/api/v1/getwallets', 'WrenchApi::apigate'); // to be retired +// WALLET FUNCTIONS $routes->post('/en/wrench/api/v1/wallets', 'WrenchWallet::getWallet'); $routes->post('/en/wrench/api/v1/kidwallets', 'WrenchWallet::getKidWallet'); - $routes->post('/en/wrench/api/v1/wallets/escrols', 'WrenchWallet::getEscrols'); $routes->post('/en/wrench/api/v1/familywallet/redeem', 'WrenchWallet::redeemOptions'); diff --git a/www-api/app/Controllers/WrenchWallet.php b/www-api/app/Controllers/WrenchWallet.php index e9244f34..ebe36d99 100644 --- a/www-api/app/Controllers/WrenchWallet.php +++ b/www-api/app/Controllers/WrenchWallet.php @@ -242,6 +242,22 @@ class WrenchWallet extends BaseController return $this->respond( $this->summaryReturnData($in,$out), 200); } public function getWallet(){ + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["action"] = 'getwallets'; + $out=[]; + $endpoint = "USERS_WALLETS-". $in["uid"]; + + $out = $this->getCache($endpoint); + if ( count($out)==0 ){ + $local_url = "http://".$this->micro_service_net1.":3037/getwallets"; + $out = $this->APIcall('GET', $local_url, $in); + $this->saveCache($endpoint,$out,1500); + } + log_message('critical', "***** ***** WrenchJobs::getWallet Ret "); + return $this->respond( $this->summaryReturnData($in,$out), 200); + } + public function getWalletOld(){ log_message('critical', "0001"); header('Access-Control-Allow-Origin: *'); log_message('critical', "WrenchWallet Path getWallet 001");