How can I increment numbers to Other User that is not current user ?
I want to build an App like Paypal, But i'm having problem when i want to Increment values to other User
final ParseQuery<User> SendQuery = User.getUserQuery();
SendQuery.getInBackground("ObjectID", new GetCallback<User>() {
@Override
public void done(User user, ParseException e) {
if (user != null){
mCurrentUser = (User)User.getCurrentUser();
transactions = new TransactionsClass();
transactions.setColSender((User) ParseUser.getCurrentUser());
transactions.setColReceiver(user);
// Get Money from Current Account (- 100.00)
mCurrentUser.increment("balance", -10.00);
// Determinate Money to send ( 100.00)
transactions.setColAmountSend(10.00);
// Determinate who paid Who paid fees
transactions.setColWhoPaidFees(user);
// Get fees from current sender
transactions.setColFeeExpress(1.00);
transactions.setColFeeBaxpay(1.00);
// Determinate amount received to other user
transactions.setColAmountReceived(8.00);
// Send Money to Destination account (ObjectID account) +10.00
THE PROBLEM IS HERE, WHEN IF I COMMENT THIS LINE EVERYTHING WORKS FINE. How can I increment numbers to Other User that is not current user ?
user.increment(User.COL_BALANCE, 10.00);
transactions.setColTransStatus("sent");
// transactions.setColDescription(mNote.getText().toString());
transactions.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
// Money Send with success
/*ParseQuery<User> FeesQuery = User.getUserQuery();
FeesQuery.getInBackground("hfjkjdjk", new GetCallback<User>() {
@Override
public void done(User BaxPay, ParseException e) {
if (BaxPay != null){
// Fees Send with success
BaxPay.increment("balance", 100.00);
} else {
// Fees not sent with especial error.
}
}
});*/
} else {
// Money not send with especial error.
}
}
});
} else {
// Money not send with especial error.
}
}
});