I am integrating cash and card payment in my application. I am using payment connector to make sale request for paying by either Credit or Debit card. I am using following code for the cash payment to open cash drawer and to list the payment in clover cash log:
Bundle extras = new Bundle();
extras.putParcelable(ARG_ACCOUNT, account);
CashEvent cashEvent = new CashEvent();
cashEvent.setType(Type.TRANSACTION);
cashEvent.setAmountChange(getAmountToPay());
cashEvent.setNote(“Application note”);
extras.putParcelable(ARG_CASH_EVENT, cashEvent);
Bundle response = getContentResolver().call(CashContract.CashEvent.CONTENT_URI, METHOD_ADD_ENTRY, null, extras);
if (response != null && response.getBoolean(ARG_SUCCESS, false)) {
CashDrawer.open2(context, account);
}
But I am unable to get the transaction id for the cash payment. Please suggest.
Also please suggest a way to print the discount along with the amount of discount on the receipt in case of cash payment. Please suggest.
Thanks.