fix query

This commit is contained in:
CHIEFSOFT\ameye
2023-07-28 15:56:06 -04:00
parent ff318a00d4
commit e125e85b91
+2 -2
View File
@@ -690,7 +690,7 @@ long WrenchBoardCompleteBalanceTopup(CVars in, CVars &out){
REQ_LONG(in, "flutterwave_payments_id", 1, -1);
//res = pgsql_query("SELECT id AS trx_id,member_id FROM flutterwave_payments WHERE tx_ref = '%s' AND status=0",in["tx_ref"].c_str());
res = pgsql_query("SELECT id AS trx_id,member_id,tx_ref; FROM flutterwave_payments WHERE id = %lu AND status=0",in["flutterwave_payments_id"].Long());
res = pgsql_query("SELECT id AS trx_id,member_id,tx_ref FROM flutterwave_payments WHERE id = %lu AND status=0",in["flutterwave_payments_id"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
CVars rec;
@@ -709,7 +709,7 @@ long WrenchBoardCompleteBalanceTopup(CVars in, CVars &out){
if ( in["status"].Long() == 5){
in["tx_ref"] = rec["tx_ref"]; in["tx_ref"].set_valid( true ); // note we change tx_ref here
in["tx_ref"] = rec["tx_ref"]; in["tx_ref"].set_valid( true ); // note we change tx_ref here
return WrenchMemberTopupPayment( in, out ); // This start the actual crediting
}
}