示例#1
0
        public async Task <GetOrdersResponse> DoRequest()
        {
            var auth = new AdminWS.Authentication()
            {
                Password = _builder.GetConfig().GetPassword(_builder.OrderType, _builder.GetCountryCode()),
                Username = _builder.GetConfig().GetUsername(_builder.OrderType, _builder.GetCountryCode())
            };

            var request = new AdminWS.GetOrdersRequest()
            {
                Authentication   = auth,
                OrdersToRetrieve = new[]
                {
                    new GetOrderInformation()
                    {
                        SveaOrderId = _builder.Id,
                        OrderType   = ConvertPaymentTypeToOrderType(_builder.OrderType),
                        ClientId    = _builder.GetConfig().GetClientNumber(_builder.OrderType, _builder.GetCountryCode())
                    }
                }
            };

            // make request to correct endpoint, return response object
            var endpoint = _builder.GetConfig().GetEndPoint(CONST.PaymentType.ADMIN_TYPE);
            var adminWS  = new AdminServiceClient(AdminServiceClient.EndpointConfiguration.WcfAdminSoapService, endpoint);
            var response = await adminWS.GetOrdersAsync(request);

            return(response);
        }
示例#2
0
        public Webpay.Integration.CSharp.AdminWS.GetOrdersResponse DoRequest()
        {
            var auth = new Webpay.Integration.CSharp.AdminWS.Authentication()
            {
                Password = _builder.GetConfig().GetPassword(_builder.OrderType, _builder.GetCountryCode()),
                Username = _builder.GetConfig().GetUsername(_builder.OrderType, _builder.GetCountryCode())
            };

            var request = new Webpay.Integration.CSharp.AdminWS.GetOrdersRequest()
            {
                Authentication   = auth,
                OrdersToRetrieve = new[]
                {
                    new GetOrderInformation()
                    {
                        SveaOrderId = _builder.Id,
                        OrderType   = ConvertPaymentTypeToOrderType(_builder.OrderType),
                        ClientId    = _builder.GetConfig().GetClientNumber(_builder.OrderType, _builder.GetCountryCode())
                    }
                }
            };

            // make request to correct endpoint, return response object
            var endpoint = _builder.GetConfig().GetEndPoint(PaymentType.ADMIN_TYPE);
            var adminWS  = new AdminServiceClient(new WSHttpBinding(SecurityMode.Transport), new EndpointAddress(endpoint));
            var response = adminWS.GetOrders(request);

            return(response);
        }
示例#3
0
        public QueryResponse DoRequest()
        {
            // should validate _builder.GetOrderId() existence here

            var hostedActionRequest = new HostedAdmin(_builder.GetConfig(), _builder.GetCountryCode())
                                      .Query(new QueryByTransactionId(
                                                 transactionId: _builder.Id));

            return(hostedActionRequest.DoRequest <QueryResponse>());
        }