diff --git a/wrenchboard/src/shared_tool/bko.cc b/wrenchboard/src/shared_tool/bko.cc index f1b62338..08913715 100644 --- a/wrenchboard/src/shared_tool/bko.cc +++ b/wrenchboard/src/shared_tool/bko.cc @@ -12,6 +12,7 @@ #include #include "pgsql.h" #include "pgsql_wrapper.h" +#include "payments.h" #include "php.h" #include @@ -86,11 +87,17 @@ long BkoRefreshWallet(CVars in, CVars &out) REQ_STRING (in, "uid", 5, 149, "(.*)"); CVars x; - //if ( load_db_record( x, "SELECT * FROM marketing_list WHERE uid='%s'", in["uid"].c_str() )){ - // market_email(WRENCHBOARD_BKO_MARKETING_MSG, x, out); - //} - + long member_id = REQ_LONG( in, "member_id", 0, -1); + REQ_STRING (in, "member_uid", 9, 49, "(.*)"); + if ( load_db_record( x, "SELECT * FROM members WHERE uid='%s' AND id =%lu", in["member_uid"].c_str(),in["member_id"].Long() )){ + CVars vw; + load_db_record(vw, "SELECT code AS currency FROM currency WHERE country='%s'",x["country"].c_str()); + if ( vw["currency"] !=""){ + vw["currency"].set_valid( true ); + out["wallet_id"] = CheckWallet(out["member_id"].Long(),vw); + } + } logfmt( logINFO, "/BkoResendMarketing()" ); return 0; }