previous card chrage

This commit is contained in:
CHIEFSOFT\ameye
2023-07-13 16:50:21 -04:00
parent c9c90322eb
commit 07768ce846
+22 -5
View File
@@ -422,12 +422,29 @@ return payment_return;
long WrenchCardRechargePayment( CVars in, CVars &out )
{
logfmt(FLOG_MAX, "long WrenchCardRechargePayment(CVars in, CVars &out)" );
long member_id = REQ_LONG( in, "member_id", 1, -1 );
long amount = REQ_LONG( in, "amount", 1, -1 );
long card_id = REQ_LONG( in, "card_id", 1, -1 );
in["WHAT_CHARGE_TYPE"] = "USE_CARD_ID"; in["WHAT_CHARGE_TYPE"].set_valid( true ); //
return WrenchNewCardPayment( in, out );
long ret = PHP_API_BAD_PARAM;
try {
long member_id = REQ_LONG( in, "member_id", 1, -1 );
long amount = REQ_LONG( in, "amount", 1, -1 );
REQ_STRING(in, "card_uid", 15, 45, "(.*)");
REQ_STRING(in, "uid", 15, 45, "(.*)");
REQ_STRING(in, "credit_reference", 15, 45, "(.*)");
if (load_db_record(out, "SELECT c.id as card_id FROM creditcard c LEFT JOIN members m ON m.id =c.member_id "
" WHERE c.uid = '%s' AND m.uid = '%s'", in["card_uid"].c_str(), in["uid"].c_str()) > 0)
{
// long card_id = REQ_LONG( in, "card_id", 1, -1 );
in["card_id"] = out["card_id"]; in["card_id"].set_valid( true );
in["WHAT_CHARGE_TYPE"] = "USE_CARD_ID"; in["WHAT_CHARGE_TYPE"].set_valid( true ); //
ret = WrenchNewCardPayment( in, out );
}
} catch (bad_parameter) {
out["status"] = "Invalid Parameters";
}
logfmt(FLOG_MAX, "/long WrenchCardRechargePayment(CVars in, CVars &out)" );
return ret;
}
long WrenchCanceContractPayment( CVars in, CVars &out )