예제 #1
0
        public void ProfileOrder()
        {
            var profile       = ProfileTests.SetProfileDefaults(ProfileType.CreateProfile(_credentials.Username, _credentials.Password, _credentials.MerchantId));
            var profileResult = _client.Profile(profile);

            Assert.NotNull(profileResult?.Response?.Item);
            var profileItem = (profileRespType)profileResult.Response.Item;

            Assert.Equal("0", profileItem.ProfileProcStatus);
            Assert.False(string.IsNullOrEmpty(profileItem.CustomerRefNum));
            var customerRefNum = profileItem.CustomerRefNum;
            var order          = new NewOrderType(_credentials.Username, _credentials.Password, _credentials.MerchantId)
            {
                CustomerRefNum = customerRefNum,
                OrderID        = "100001",
                Amount         = PaymentechHelpers.ConvertAmount(10.00m),
            };
            var orderResult = _client.NewOrder(order);

            Assert.NotNull(orderResult?.Response?.Item);
            var orderItem = (newOrderRespType)orderResult.Response.Item;

            Assert.Equal("0", orderItem.ProcStatus);
        }
예제 #2
0
 public ClientResponse NewOrder(NewOrderType newOrder, string traceNumber = null)
 {
     return(_client.NewOrder(newOrder, traceNumber));
 }