This commit is contained in:
2022-10-08 18:40:22 -04:00
parent cee7c38383
commit 0a4f3c3245
+5 -4
View File
@@ -755,11 +755,12 @@ long WrenchContractPayment( CVars in, CVars &out )
return PHP_API_BAD_PARAM;
}
CVars vw;
CVars vw;
vw["currency"] = "NAIRA"; // this might become a variable based on the country
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
//
long client_wallet_id = CheckWallet(client_id,vw);
// TEST FOR DUPLICATE
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", client_id);
@@ -813,8 +814,8 @@ long WrenchContractPayment( CVars in, CVars &out )
//pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
char confirmation[15] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
UpdateMemberWallet( x["member_id"].Long(), wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
logfmt( logINFO, "paying for job completed, make sure you paythe correct person()" );
UpdateMemberWallet( x["member_id"].Long(), client_wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );