payment id

This commit is contained in:
CHIEFSOFT\ameye
2023-10-28 15:24:05 -04:00
parent 43dd2bd37f
commit 16fd0ab32f
+20 -2
View File
@@ -113,6 +113,7 @@ long WrenchMemberTopupPayment( CVars in, CVars &out )
return 0;
}
long WrenchFamilyTransferCredit( CVars in, CVars &out );
long WrenchFamilyPayment( CVars in, CVars &out )
{
logfmt(FLOG_MAX, "long WrenchFamilyPayment(CVars in, CVars &out)" );
@@ -179,7 +180,7 @@ long WrenchFamilyPayment( CVars in, CVars &out )
x["fee"] = "0"; x["fee"].set_valid( true );
x["what_family_transfer"] = transfer_id; x["what_family_transfer"].set_valid( true );
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
payment_id = 0; // insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
if (payment_id) {
ret = PHP_CREATED_OK;
@@ -192,7 +193,9 @@ long WrenchFamilyPayment( CVars in, CVars &out )
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
pgsql_exec("UPDATE family_transfer SET pay_confirm = now() WHERE id = %lu ",confirmation, transfer_id );
load_db_record( out, "SELECT * FROM family_transfer WHERE id = %lu ", payment_id );
CVars xrx;
load_db_record( xrx, "SELECT * FROM family_transfer WHERE id = %lu ", payment_id );
return WrenchFamilyTransferCredit( xrx, out )
} else {
out["status"] = "Unable to create payment";
}
@@ -207,6 +210,21 @@ long WrenchFamilyPayment( CVars in, CVars &out )
return ret;
}
long WrenchFamilyTransferCredit( CVars in, CVars &out ){
logfmt(FLOG_MAX, "long WrenchFamilyTransferCredit(CVars in, CVars &out)" );
long ret = PHP_API_BAD_PARAM;
ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
logfmt(FLOG_MAX, "OUT *** long WrenchFamilyTransferCredit(CVars in, CVars &out)" );
return ret;
}
long WrenchMemberCouponPayment( CVars in, CVars &out )
{
logfmt(FLOG_MAX, "long WrenchMemberCouponPayment(CVars in, CVars &out)" );