New wallet call

This commit is contained in:
CHIEFSOFT\ameye
2024-10-14 13:26:20 -04:00
parent 13b3a7461f
commit d10f0279fa
2 changed files with 18 additions and 4 deletions
+2 -4
View File
@@ -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');
+16
View File
@@ -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");