send money id

This commit is contained in:
CHIEFSOFT\ameye
2023-07-27 08:43:54 -04:00
parent 647ee19b16
commit 1404234554
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -954,7 +954,7 @@ Foreign-key constraints:
*/
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchSendMoneyPayment()" );
logfmt( logINFO, "WrenchSendMoneyPayment()************************************ ****" );
ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
+4 -6
View File
@@ -368,13 +368,11 @@ long do_transferPayment(CVars in) {
x["current_balance"].set_valid(true);
payment_id = 0;
out["payment_id"] = insert_db_record(DBS_VALID, "sendmoney_payment", "sendmoney_payment_id_seq", x);
out["sendmoney_payment_id"] = insert_db_record(DBS_VALID, "sendmoney_payment", "sendmoney_payment_id_seq", x);
char confirmation[20] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation));
// payment_id = out["payment_id"].Long();
// Confirmation(payment_id, confirmation, sizeof (confirmation));
ret = PHP_API_BAD_PARAM; // it is still a failure if we get here and did not take the money out of the balance
CVars y;
@@ -395,7 +393,7 @@ long do_transferPayment(CVars in) {
if (ret == PHP_CREATED_OK) {
load_db_record(out, "SELECT amount AS new_balance FROM members_wallet WHERE id = %lu", wallet_id);
pgsql_exec("UPDATE sendmoney_payment SET new_balance=%lu WHERE id=%lu", out["new_balance"].Long(), out["payment_id"].Long());
pgsql_exec("UPDATE sendmoney_payment SET new_balance=%lu WHERE id=%lu", out["new_balance"].Long(), out["sendmoney_payment_id"].Long());
ret = PHP_API_OK;
}
}