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

new updated

parent 2dd2b703
...@@ -73,10 +73,15 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -73,10 +73,15 @@ 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());
refund = amountPaid - amount; if ( amountPaid < amount) {
startActivity(new Intent(PaymentActivity.this, StatusPayment.class).putExtra(REFUND, refund).putExtra(PAY_WITH, payment)); ViewUtil.showMessage(view, "AmountPaid doesn't less than total price");
cartViewModel.clear(); } else {
finish(); refund = amountPaid - amount;
startActivity(new Intent(PaymentActivity.this, StatusPayment.class).putExtra(REFUND, refund).putExtra(PAY_WITH, payment));
cartViewModel.clear();
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