Syrve POS API SDK

More details about pay fail

The V8Preview7 API has made it even more convenient to analyze payment errors.

Methods PayOrder and PayOrderAndPayOutOnUser can generate an exception PaymentActionFailedException in case an error occurred during payment processing. At the same time, the plugin developers only had an error message at their disposal Exception.Message, which is inconvenient to work with and classify.

In the new version in PaymentActionFailedException property has been added Reason — classifiable error cause, which cannot be null if the exception was thrown from the PayOrder or PayOrderAndPayOutOnUser methods. Wherein Reason can take on the following values PaymentActionFailedExceptionReason:

/// <summary>
/// Reason for throwing <see cref="PaymentActionFailedException"/>.
/// </summary>
[PublicAPI]
public enum PaymentActionFailedExceptionReason
{
 OrderNotFound,
 CannotLockOrder,
 OrderStatusIsNotOpened,
 BanquetOrderNotSupported,

 DeliveryOrderStatusIsUnconfirmed,
 DeliveryOrderHasPurchases,
 DeliveryOrderPrepayAndCloseOnDifferentTerminalNotSupported,

 PayInTypeIsIncorrect,
 PayOutTypeIsIncorrect,
 PayOutOnUserFailed,

 CafeSessionNotFound,
 CashRegisterNotFound,
 OnlyVirtualCashRegisterForPurchasesSupported,

 UserNotFound,
 UserPersonalSessionNotOpened,
 NoUserPermissionsToPayAsWaiter,
 NoUserPermissionsToPayOthersOrder,
 NoUserPermissionsToApprovePointsAccural,
 UserCashDrawerNotFound,

 PaymentTypeNotSpecified,
 PaymentTypeNotConfigured,
 UncombinablePaymentTypes,
 UncombinablePaymentTypesFiscalNonFiscal,
 AutomaticPaymentTypeNotFound,
 NotProcessedNotSilentPaymentsNotSupported,
 PayOrderFailed,
 CannotPrintOrder,
 CannotEditStopList,
 OrderBillOperationFailed,
 PaymentsProcessingCanceled,
 PaymentsProcessingFailed,
 BeforeDoChequeOperationFailed,
 ChequeTaskProcessorFailed,
 CashRegisterOperationFailed,

 MoreThanOnePaymentsWithChange,
 ChangeSumEqualToPaymentsWithChangeSum,
 ChangeSumGreaterThanPaymentsWithChangeSum,

 PaymentSumNotEnough,
 PaymentSumNotIntegral,
 PaymentSumTooLarge,
 CashForChangeNotEnough,

 BillOrderBeforePayment,
 SplitOrderBeforePayment,

 CookingPlacesWithEmptyStores,
 TimePayProductsInOrder,

 ChequeSmsSendingNotSupported,
 ChequeEmailSendingNotSupported,
 ChequeSettlementPlaceNotSupported,
}

Of which only

have the specified new property PaymentActionFailedException.Details, which will contain an exception message generated by another plugin in