diff --git a/wrenchboard/src/shared_tool/payments.cc b/wrenchboard/src/shared_tool/payments.cc index e388bf3c..54765b0b 100644 --- a/wrenchboard/src/shared_tool/payments.cc +++ b/wrenchboard/src/shared_tool/payments.cc @@ -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 );