fix wallet load
This commit is contained in:
@@ -1105,11 +1105,20 @@ long CreateWrenchBoardAccount(CVars in, CVars &out) {
|
|||||||
x["pending_id"].set_valid(true);
|
x["pending_id"].set_valid(true);
|
||||||
|
|
||||||
CVars u;
|
CVars u;
|
||||||
load_db_record(u,"SELECT code AS currency FROM currency WHERE country = '%s'", x["country"].c_str() );
|
out["wallet_status"] = "-1";
|
||||||
|
load_db_record(u,"SELECT code AS currency FROM currency WHERE country = TRIM('%s')", x["country"].c_str() );
|
||||||
logfmt(logINFO, " The Currency code = %s", u["currency"].c_str());
|
logfmt(logINFO, " The Currency code = %s", u["currency"].c_str());
|
||||||
out["wallet_id"] = CheckWallet( x["member_id"].Long() , u);
|
out["wallet_id"] = CheckWallet( x["member_id"].Long() , u);
|
||||||
logfmt(logINFO, " The wallet_id = %lu", out["wallet_id"].Long());
|
logfmt(logINFO, " The wallet_id = %lu", out["wallet_id"].Long());
|
||||||
|
|
||||||
|
if ( u["currency"] !="" && out["wallet_id"].Long() > 0 ){
|
||||||
|
load_db_record( out, "SELECT amount AS balance,amount AS default_wallet_balance "
|
||||||
|
" FROM members_wallet WHERE member_id = %lu AND currency='%s' ", out["member_id"].Long(), u["currency"].c_str()); // retired
|
||||||
|
out["wallet_status"] = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CVars vw;
|
CVars vw;
|
||||||
// vw["currency"] = "NAIRA"; // this will become a variable based on the country
|
// vw["currency"] = "NAIRA"; // this will become a variable based on the country
|
||||||
// vw["currency"].set_valid( true );
|
// vw["currency"].set_valid( true );
|
||||||
@@ -1118,8 +1127,12 @@ long CreateWrenchBoardAccount(CVars in, CVars &out) {
|
|||||||
// - password already set pgsql_query("UPDATE members SET password = md5('%s') WHERE id = %lu",in["pass1"].c_str(),ret);
|
// - password already set pgsql_query("UPDATE members SET password = md5('%s') WHERE id = %lu",in["pass1"].c_str(),ret);
|
||||||
pgsql_query("UPDATE members_pending SET status = 5 WHERE id = %lu", out["pending_id"].Long());
|
pgsql_query("UPDATE members_pending SET status = 5 WHERE id = %lu", out["pending_id"].Long());
|
||||||
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str());
|
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str());
|
||||||
|
|
||||||
|
|
||||||
WelcomeAccountMail(x);
|
WelcomeAccountMail(x);
|
||||||
SignupCompletedAlertMailfile(x);
|
SignupCompletedAlertMailfile(x);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -995,7 +995,7 @@ long WrenchRefundoffer( CVars in, CVars &out )
|
|||||||
//pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() );
|
//pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() );
|
||||||
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
|
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
|
||||||
} else {
|
} else {
|
||||||
out["status"] = "Unable to create payment";
|
out["status"] = "Unable to Refund Payment";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user