Country banks

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-23 09:01:27 -04:00
parent 3e53281ac5
commit 8ee297715c
8 changed files with 50 additions and 6 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_ACCOUNT_ACCOUNT_TYPES 11177
#define WRENCHBOARD_ACCOUNT_COUNTRY_COMBO 11179
#define WRENCHBOARD_ACCOUNT_JOB_COUNTRY 11181
#define WRENCHBOARD_ACCOUNT_COUNTRY_BANKS 11183
#define WRENCHBOARD_USER_DELETEACC 11990
#define WRENCHBOARD_ACCOUNT_END 11999
+4
View File
@@ -418,6 +418,10 @@ long account_calls(CVars in, CVars &out) {
return getCountryJobCombo(in, out);
break;
case WRENCHBOARD_ACCOUNT_COUNTRY_BANKS:
return getBankCombo(in, out);
break;
}
logfmt(logINFO, "/account_calls()");
return ret;
+36 -3
View File
@@ -282,8 +282,6 @@ long getCountryJobCombo( CVars in, CVars &out ) {
logfmt( logINFO, "/getCountryJobCombo()" );
return ret;
return 0;
return 0;
}
long getBankCombo( CVars in, CVars &out ) {
@@ -307,5 +305,40 @@ long getBankCombo( CVars in, CVars &out ) {
$option_value = $this->optionValueObject($q->result(), "code", "name", $curVal);
*/
return 0;
char vname[30];
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "getBankCombo()" );
out["result"] = "Yes i go to this back end";
try {
REQ_STRING(in, "country", 2, 25, "(.*)");
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT code,name "
"FROM bank_entity_codes "
"WHERE country ='%s' ORDER BY name ASC",in['country'].c_str());
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "code_%05d", i);
out[vname] = rec["code"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long getBankCombo(CVars in, CVars &out)");
}
logfmt( logINFO, "/getBankCombo()" );
return ret;
}
+1
View File
@@ -204,6 +204,7 @@ define('WRENCHBOARD_ACCOUNT_USER_RECIPEINT', 11175);
define('WRENCHBOARD_ACCOUNT_ACCOUNT_TYPES', 11177);
define('WRENCHBOARD_ACCOUNT_COUNTRY_COMBO', 11179);
define('WRENCHBOARD_ACCOUNT_JOB_COUNTRY', 11181);
define('WRENCHBOARD_ACCOUNT_COUNTRY_BANKS', 11183);
define('WRENCHBOARD_USER_DELETEACC', 11990);
define('WRENCHBOARD_ACCOUNT_END', 11999);
+2 -2
View File
@@ -62,8 +62,8 @@ $routes->post('/en/wrench/api/v1/purchasehx', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/recipients', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/sendreferral', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/refferhx', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/refferhx', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/countrybanks', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/getjob', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/mybanklist', 'WrenchApi::apigate');
+3
View File
@@ -50,6 +50,7 @@ class WrenchApi extends BaseController
'purchasehx' => ['POST'],
'getjob' => ['POST'],
'mybanklist' => ['POST'],
'countrybanks' =>['POST'],
'sendmoney' => ['POST'],
'sendinterest' => ['POST'],
'sendmoneyfee' => ['POST'],
@@ -265,6 +266,8 @@ class WrenchApi extends BaseController
case WRENCHBOARD_ACCOUNT_JOB_COUNTRY: break ; // 11181);
case 'sendreferral': $in["action"] =WRENCHBOARD_ACCOUNT_SENDREFER; break;
case 'refferhx': $in["action"] =WRENCHBOARD_ACCOUNT_REFFERHX; break;
case 'countrybanks': $in["action"] =WRENCHBOARD_ACCOUNT_COUNTRY_BANKS; break;
}
$in["pid"] = 100;
return $in;
+1
View File
@@ -110,6 +110,7 @@ define('WRENCHBOARD_ACCOUNT_USER_RECIPEINT', 11175);
define('WRENCHBOARD_ACCOUNT_ACCOUNT_TYPES', 11177);
define('WRENCHBOARD_ACCOUNT_COUNTRY_COMBO', 11179);
define('WRENCHBOARD_ACCOUNT_JOB_COUNTRY', 11181);
define('WRENCHBOARD_ACCOUNT_COUNTRY_BANKS', 11183);
define('WRENCHBOARD_USER_DELETEACC', 11990);
define('WRENCHBOARD_ACCOUNT_END', 11999);
+2
View File
@@ -30,6 +30,7 @@ $endpoints = array(
'couponhx' => array('POST'),
'getjob' => array('POST'),
'mybanklist' => array('POST'),
'countrybanks' => array('POST'),
'sendmoney' => array('POST'),
'sendinterest' => array('POST'),
'sendmoneyfee' => array('POST'),
@@ -299,6 +300,7 @@ switch ($endpoint) {
case WRENCHBOARD_ACCOUNT_JOB_COUNTRY: break ; // 11181);
case 'sendreferral': $in["action"] =WRENCHBOARD_ACCOUNT_SENDREFER; break;
case 'refferhx': $in["action"] =WRENCHBOARD_ACCOUNT_REFFERHX; break;
case 'countrybanks': $in["action"] =WRENCHBOARD_ACCOUNT_COUNTRY_BANKS; break;
}