/// <summary>
        /// prepareRequest
        /// </summary>
        /// <exception cref="SveaWebPayValidationException"></exception>
        /// <returns>SveaRequest</returns>
        public CloseOrderEuRequest PrepareRequest()
        {
            string errors = ValidateRequest();
            if (errors != "")
            {
                throw new SveaWebPayValidationException(errors);
            }

            var orderInfo = new CloseOrderInformation {SveaOrderId = _order.GetOrderId()};

            var sveaCloseOrder = new CloseOrderEuRequest
                {
                    CloseOrderInformation = orderInfo,
                    Auth = GetStoreAuthorization()
                };

            return sveaCloseOrder;
        }
Exemple #2
0
        /// <summary>
        /// doRequest
        /// </summary>
        /// <exception cref="Exception"></exception>
        /// <returns>CloseOrderResponse</returns>
        public async Task <CloseOrderEuResponse> DoRequest()
        {
            CloseOrderEuRequest request = PrepareRequest();

            Soapsc = new ServiceSoapClient(new BasicHttpBinding
            {
                Name = "ServiceSoap",
                //Security = new BasicHttpSecurity
                //    {
                //        Mode = BasicHttpSecurityMode.Transport
                //    }
            },
                                           new EndpointAddress(
                                               _order.GetConfig()
                                               .GetEndPoint(_order.GetOrderType() == "Invoice"
                                                                      ? PaymentType.INVOICE
                                                                      : PaymentType.PAYMENTPLAN)));


            return(await Soapsc.CloseOrderEuAsync(request));
        }
Exemple #3
0
        /// <summary>
        /// prepareRequest
        /// </summary>
        /// <exception cref="SveaWebPayValidationException"></exception>
        /// <returns>SveaRequest</returns>
        public CloseOrderEuRequest PrepareRequest()
        {
            string errors = ValidateRequest();

            if (errors != "")
            {
                throw new SveaWebPayValidationException(errors);
            }

            var orderInfo = new CloseOrderInformation {
                SveaOrderId = _order.GetOrderId()
            };

            var sveaCloseOrder = new CloseOrderEuRequest
            {
                CloseOrderInformation = orderInfo,
                Auth = GetStoreAuthorization()
            };

            return(sveaCloseOrder);
        }