public void OnSaleResponse(SaleResponse response)
{
if (response.Success)
{
POSPayment payment = new POSPayment(response.Payment.id, response.Payment.order.id, response.Payment.employee.id, response.Payment.amount, response.Payment.tipAmount, response.Payment.cashbackAmount);
if (response.IsAuth) //Tip Adjustable
{
Store.CurrentOrder.Status = POSOrder.OrderStatus.AUTHORIZED;
payment.PaymentStatus = POSPayment.Status.AUTHORIZED;
}
else
{
Store.CurrentOrder.Status = POSOrder.OrderStatus.CLOSED;
payment.PaymentStatus = POSPayment.Status.PAID;
}
Store.CurrentOrder.AddPayment(payment);
uiThread.Send(delegate (object state)
{
if (payment.CashBackAmount > 0)
{
ShowCashBackForm(payment.CashBackAmount);
}
RegisterTabs.SelectedIndex = 0;
NewOrder();
}, null);
}
else if (response.Result.Equals(ResponseCode.FAIL))
{
uiThread.Send(delegate (object state)
{
AlertForm.Show(this, response.Reason, response.Message);
PaymentReset();
}, null);
}
else if (response.Result.Equals(ResponseCode.CANCEL))
{
uiThread.Send(delegate (object state)
{
AlertForm.Show(this, response.Reason, response.Message);
PaymentReset();
}, null);
}
}