@@ -919,58 +919,6 @@ enum CollectOrderPaymentUseCaseNotValidAmountError: Error, LocalizedError, Equat
919919 }
920920}
921921
922- enum CollectOrderPaymentUseCaseError : LocalizedError {
923- case flowCanceledByUser
924- case paymentGatewayNotFound
925- case orderTotalChanged
926- case couldNotRefreshOrder( Error )
927- case orderAlreadyPaid
928-
929- var errorDescription : String ? {
930- switch self {
931- case . flowCanceledByUser:
932- return Localization . paymentCancelledLocalizedDescription
933- case . paymentGatewayNotFound:
934- return Localization . paymentGatewayNotFoundLocalizedDescription
935- case . orderTotalChanged:
936- return Localization . orderTotalChangedLocalizedDescription
937- case . couldNotRefreshOrder( let error as LocalizedError ) :
938- return error. errorDescription
939- case . couldNotRefreshOrder( let error) :
940- return String . localizedStringWithFormat ( Localization . couldNotRefreshOrderLocalizedDescription, error. localizedDescription)
941- case . orderAlreadyPaid:
942- return Localization . orderAlreadyPaidLocalizedDescription
943- }
944- }
945-
946- private enum Localization {
947- static let couldNotRefreshOrderLocalizedDescription = NSLocalizedString (
948- " Unable to process payment. We could not fetch the latest order details. Please check your network " +
949- " connection and try again. Underlying error: %1$@ " ,
950- comment: " Error message when collecting an In-Person Payment and unable to update the order. %!$@ will " +
951- " be replaced with further error details. " )
952-
953- static let orderTotalChangedLocalizedDescription = NSLocalizedString (
954- " collectOrderPaymentUseCase.error.message.orderTotalChanged " ,
955- value: " Order total has changed since the beginning of payment. Please go back and check the order is " +
956- " correct, then try the payment again. " ,
957- comment: " Error message when collecting an In-Person Payment and the order total has changed remotely. " )
958-
959- static let orderAlreadyPaidLocalizedDescription = NSLocalizedString (
960- " Unable to process payment. This order is already paid, taking a further payment would result in the " +
961- " customer being charged twice for their order. " ,
962- comment: " Error message shown during In-Person Payments when the order is found to be paid after it's refreshed. " )
963-
964- static let paymentGatewayNotFoundLocalizedDescription = NSLocalizedString (
965- " Unable to process payment. We could not connect to the payment system. Please contact support if this " +
966- " error continues. " ,
967- comment: " Error message shown during In-Person Payments when the payment gateway is not available. " )
968-
969- static let paymentCancelledLocalizedDescription = NSLocalizedString (
970- " The payment was cancelled. " , comment: " Message shown if a payment cancellation is shown as an error. " )
971- }
972- }
973-
974922enum CardPaymentRetryApproach {
975923 case reuseIntent
976924 case restart
0 commit comments