Commit 3c39f42f authored by Trio Saputra's avatar Trio Saputra

new updated

parent 2dd2b703
...@@ -73,11 +73,16 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -73,11 +73,16 @@ public class PaymentActivity extends AppCompatActivity {
ViewUtil.showMessage(view, "Please choose type payment"); ViewUtil.showMessage(view, "Please choose type payment");
} else { } else {
int amountPaid = Integer.parseInt(binding.etAmountPaid.getText().toString()); int amountPaid = Integer.parseInt(binding.etAmountPaid.getText().toString());
if ( amountPaid < amount) {
ViewUtil.showMessage(view, "AmountPaid doesn't less than total price");
} else {
refund = amountPaid - amount; refund = amountPaid - amount;
startActivity(new Intent(PaymentActivity.this, StatusPayment.class).putExtra(REFUND, refund).putExtra(PAY_WITH, payment)); startActivity(new Intent(PaymentActivity.this, StatusPayment.class).putExtra(REFUND, refund).putExtra(PAY_WITH, payment));
cartViewModel.clear(); cartViewModel.clear();
finish(); finish();
} }
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment