The ability to add and delete payments fiscalized on an external cash register has been introduced
Tags:
In V7Preview4, it became possible to work with payments fiscalized on an external cash register. They are relevant when prepayment is accepted on the website, and the fiscal receipt is printed on the website’s cloud printer. When such a payment is processed in SyrveFront, all transactions corresponding to the external fiscal payment will be created, but no fiscal receipt will be printed, as the receipt has already been printed earlier on the external cash register.
Added methods:
AddExternalFiscalizedPaymentItem— adds a payment fiscalized on an external cash register to the orderDeleteExternalFiscalizedPaymentItem— removes such a payment from the order
Example
var order = PluginContext.Operations.GetOrders().Last(o => (o.Status == OrderStatus.New));
var paymentType = PluginContext.Operations.GetPaymentTypes().Last(x => x.Kind == PaymentTypeKind.Card && x.Name.ToUpper() == "DINERS");
var additionalData = new CardPaymentItemAdditionalData { CardNumber = "123456" };
var credentials = PluginContext.Operations.GetCredentials();
var paymentItem = PluginContext.Operations.AddExternalFiscalizedPaymentItem(50, additionalData, paymentType, order, credentials);
// To convert such a payment into a prepayment with immediate creation of corresponding transactions on SyrveFront,
// you can call the IOperationService.ProcessPrepay method
order = PluginContext.Operations.GetOrderById(order.Id);
PluginContext.Operations.ProcessPrepay(credentials, order, paymentItem);