예제 #1
0
        public OrderPaymentStatusResponseDto GetOrderSmsPaymentStatus(int orderId)
        {
            var additionalInfo = _aPIOrderData.GetAdditionalInfo(orderId)
                                 ?? throw new Exception($"Не удалось получить информацию о заказе {orderId}");

            var response = new OrderPaymentStatusResponseDto()
            {
                AvailablePaymentTypes = additionalInfo.AvailablePaymentTypes,
                CanSendSms            = additionalInfo.CanSendSms,
                SmsPaymentStatus      = _smsPaymentConverter.convertToAPIPaymentStatus(
                    _aPISmsPaymentData.GetOrderPaymentStatus(orderId)
                    )
            };

            return(response);
        }
예제 #2
0
        public OrderSmsPaymentStatusResponseDto GetOrderSmsPaymentStatus(int orderId)
        {
            var tokenStr = Request.Headers[HeaderNames.Authorization];

            _logger.LogInformation($"(orderId: {orderId}) User token: {tokenStr}");

            var additionalInfo = _aPIOrderData.GetAdditionalInfo(orderId)
                                 ?? throw new Exception($"Не удалось получить информацию о заказе {orderId}");

            var response = new OrderSmsPaymentStatusResponseDto()
            {
                AvailablePaymentTypes = additionalInfo.AvailablePaymentTypes,
                CanSendSms            = additionalInfo.CanSendSms,
                SmsPaymentStatus      = _smsPaymentConverter.convertToAPIPaymentStatus(
                    _aPISmsPaymentData.GetOrderSmsPaymentStatus(orderId)
                    )
            };

            return(response);
        }