示例#1
0
        public void ChargeSync()
        {
            var transaction = new transactionRequestType
            {
                amount          = 123.45m,
                transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
                payment         = new paymentType
                {
                    Item = new creditCardType
                    {
                        cardNumber     = "4111111111111111",
                        expirationDate = "0349",
                        cardCode       = "123"
                    }
                },

                billTo = new customerAddressType
                {
                    firstName = "TestName",
                    lastName  = "McTesterson",
                    address   = "123 Here st.",
                    city      = "Springville",
                    state     = "WA",
                    zip       = "00000"
                }
            };

            var fullRequest = new createTransactionRequest
            {
                merchantAuthentication = MerchantAuthentication,
                transactionRequest     = transaction,
            };

            // Send the request.
            var controller = new createTransactionController(fullRequest);
            var response   = controller.ExecuteWithApiResponse(AuthorizeNet.Environment.SANDBOX);

            Assert.IsNotNull(response);
        }