in["tx_ref"]

This commit is contained in:
CHIEFSOFT\ameye
2023-07-28 15:41:57 -04:00
parent 2c035e6288
commit ff318a00d4
+4 -2
View File
@@ -513,7 +513,7 @@ long WrenchFlutterCreditHook(CVars in, CVars &out) {
tx["tx_ref"] = xx["txRef"]; tx["tx_ref"].set_valid(true);
tx["transaction_id"] = xx["txRef"]; tx["transaction_id"].set_valid(true);
tx["flutterwave_payments_id"] = trx_id; tx["flutterwave_payments_id"].set_valid(true);
long credit_id = WrenchBoardCompleteBalanceTopup(tx, out);
}
@@ -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 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;
@@ -708,6 +708,8 @@ long WrenchBoardCompleteBalanceTopup(CVars in, CVars &out){
"tx_ref='%s' ",in["status"].Long(),in["return_status"].c_str(),rec["trx_id"].Long(), in["tx_ref"].c_str());
if ( in["status"].Long() == 5){
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
}
}