From 7bce678c020e21c0be8242ebdf4d44ac838d1ceb Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 1 Nov 2024 16:17:11 -0400 Subject: [PATCH] Fix abackend --- wrenchboard/src/shared_tool/account.cc | 3 ++- wrenchboard/src/shared_tool/email.cc | 10 +++++++++- www-api/app/Config/Constants.php | 1 + www-api/app/Controllers/WrenchWallet.php | 10 ---------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wrenchboard/src/shared_tool/account.cc b/wrenchboard/src/shared_tool/account.cc index 7eb83089..8998234e 100644 --- a/wrenchboard/src/shared_tool/account.cc +++ b/wrenchboard/src/shared_tool/account.cc @@ -560,6 +560,7 @@ long WrenchRequestVirtualCard(CVars in, CVars &out) { long sid = insert_db_record(DBS_VALID, "members_card_request", "members_card_request_id_seq", x); if ( sid > 0 ){ load_db_record(out, "SELECT id AS request_id, uid AS request_uid FROM members_card_request WHERE id = %lu ", sid); + account_email(WRENCHBOARD_VIRTUAL_CARDADD, out, out); ret = PHP_API_OK; } @@ -2511,7 +2512,7 @@ long WrenchTestWalletCapability(CVars in, CVars &out){ out["wallet_country_status"] = "USER_NEED_UPDATE_PROFILE_COUNTRY"; } else{ - ret = load_db_record(out, "SELECT id AS wallet_id, action_type FROM currency WHERE country ='%s'", in["country"].c_str()); + ret = load_db_record(out, "SELECT id AS wallet_id, action_type FROM currency WHERE country ='%s' LIMIT 1", in["country"].c_str()); if ( ret >= 0 && out["wallet_id"].Long() > 0 ){ out["wallet_available_status"] = "WALLET_AVAILABLE"; out["wallet_country_status"] = "USER_COUNTRY_WALLET_ENABLED"; diff --git a/wrenchboard/src/shared_tool/email.cc b/wrenchboard/src/shared_tool/email.cc index cce16116..353e5184 100644 --- a/wrenchboard/src/shared_tool/email.cc +++ b/wrenchboard/src/shared_tool/email.cc @@ -486,7 +486,7 @@ long family_email(long mailtype, CVars in, CVars &out) { long account_email(long mailtype, CVars in, CVars &out) { //REQ_LONG( in, "member_id", 1, -1 ); - CVars x; + CVars x, ml; C_CGI_Form form("", ""); CGIList * inv_list = new CGIList(&form, "inv_items"); @@ -634,6 +634,14 @@ long account_email(long mailtype, CVars in, CVars &out) { form.Email("ALERT/alert_contact.mailfile"); } break; + + case WRENCHBOARD_VIRTUAL_CARDADD: + ml["action"] = WRENCHBOARD_VIRTUAL_CARDADD; ml["action"].set_valid( true ); + ml["topic"] = "WRENCHBOARD_VIRTUAL_CARDADD"; ml["topic"].set_valid( true ); + ml["offer_id"] = in["offer_id"]; ml["offer_id"].set_valid( true ); + ml["interest_id"] = in["interest_id"]; ml["interest_id"].set_valid( true ); + submit_cron_email(ml); + break; } } catch (bad_parameter) { diff --git a/www-api/app/Config/Constants.php b/www-api/app/Config/Constants.php index 117776dd..4ee32717 100644 --- a/www-api/app/Config/Constants.php +++ b/www-api/app/Config/Constants.php @@ -97,6 +97,7 @@ const CARD_HOLDER_CREATED = 10; const CARD_OWNER_ACTIVE = 30; const CARD_ASSIGNED = 40; const CARD_ACTIVATE_CARD = 50; +const CARD_WALLET_ADD = 60; define('EVENT_PRIORITY_HIGH', 10); define('WRB_JOB_CRONJOB',770); diff --git a/www-api/app/Controllers/WrenchWallet.php b/www-api/app/Controllers/WrenchWallet.php index 0dc5631e..44e82eef 100644 --- a/www-api/app/Controllers/WrenchWallet.php +++ b/www-api/app/Controllers/WrenchWallet.php @@ -72,16 +72,6 @@ class WrenchWallet extends BaseController $ret = $this->wrenchboard->wrenchboard_api($in, $out); $out['internal_return'] = $ret; log_message('critical', "requestVirtualCard ********* ALL ".serialize($out) ); - - // concluded need to register user card - /* - if ( $out['request_id'] !='' && $out['request_uid'] !=''){ - $local_url = "http://".$this->micro_service_net1.":3038/create"; - $out = $this->APIcall('POST', $local_url, $out); - } - log_message('critical', "WrenchWallet::requestVirtualCard ********* ALL ".serialize($out) ); - */ - return $this->respond( $this->summaryReturnData($in,$out), 200); } public function redeemOptions(){