public void CreateSubscriptionTest_zeroTrial()
        {
            var random  = new AnetRandom();
            var counter = random.Next(1, (int)(Math.Pow(2, 24)));
            var amount  = ComputeRandomAmount();
            var email   = string.Format("user.{0}@authorize.net", counter);

            const string responseString = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ARBCreateSubscriptionResponse xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><subscriptionId>2074569</subscriptionId></ARBCreateSubscriptionResponse>";

            LocalRequestObject.ResponseString = responseString;

            var target = new SubscriptionGateway(ApiLogin, TransactionKey);

            var billToAddress = new Address {
                First = "SomeOneCool", Last = "MoreCoolPerson"
            };
            ISubscriptionRequest subscription = SubscriptionRequest.CreateMonthly(email, "ARB Subscription Test", amount, 10);

            subscription.CardNumber          = "4111111111111111";
            subscription.CardExpirationMonth = 3;
            subscription.CardExpirationYear  = 16;
            subscription.BillingAddress      = billToAddress;

            //setting Trial amount/ Trial Ocurances to 0
            subscription.SetTrialPeriod(3, 0M);

            ISubscriptionRequest actual = null;

            actual = target.CreateSubscription(subscription);
            Assert.NotNull(actual);
        }
        private static decimal ComputeRandomAmount()
        {
            var       random  = new AnetRandom();
            var       counter = random.Next(1, (int)(Math.Pow(2, 24)));
            const int maxSubscriptionAmount = 1000; //214747;
            var       amount = new decimal(counter > maxSubscriptionAmount ? (counter % maxSubscriptionAmount) : counter);

            return(amount);
        }
Beispiel #3
0
        //Create Customer Profile and Customer Payment Profile, returning their IDs.
        private Boolean createProfile(out String customerProfileId, out String paymentProfileId)
        {
            ApiOperationBase <ANetApiRequest, ANetApiResponse> .MerchantAuthentication = CustomMerchantAuthenticationType;
            ApiOperationBase <ANetApiRequest, ANetApiResponse> .RunEnvironment         = TestEnvironment;

            var    rnd      = new AnetRandom(DateTime.Now.Millisecond);
            string custIndx = rnd.Next(99999).ToString();

            var creditCard = new creditCardType {
                cardNumber = "4111111111111111", expirationDate = "0622"
            };
            var paymentType = new paymentType {
                Item = creditCard
            };

            var paymentProfile = new customerPaymentProfileType {
                payment = paymentType
            };

            var createRequest = new createCustomerProfileRequest
            {
                profile = new customerProfileType {
                    merchantCustomerId = "TSTCSTER" + custIndx,
                    paymentProfiles    = new customerPaymentProfileType[] { paymentProfile }
                }
            };

            //create profiles and get response
            var createController = new createCustomerProfileController(createRequest);
            var createResponse   = createController.ExecuteWithApiResponse();

            //validate response
            if (messageTypeEnum.Ok != createResponse.messages.resultCode)
            {
                customerProfileId = "0";
                paymentProfileId  = "0";
                return(false);
            }
            else
            {
                Assert.NotNull(createResponse.customerProfileId);
                Assert.NotNull(createResponse.customerPaymentProfileIdList);
                Assert.AreNotEqual(0, createResponse.customerPaymentProfileIdList.Length);

                customerProfileId = createResponse.customerProfileId;
                paymentProfileId  = createResponse.customerPaymentProfileIdList[0];

                return(true);
            }
        }
        public void TestSubscription_serialization_error()
        {
            var rnd = new AnetRandom(DateTime.Now.Millisecond);

            ApiOperationBase <ANetApiRequest, ANetApiResponse> .MerchantAuthentication = CustomMerchantAuthenticationType;
            ApiOperationBase <ANetApiRequest, ANetApiResponse> .RunEnvironment         = TestEnvironment;

            //create a subscription
            var subscriptionDef = new ARBSubscriptionType
            {
                paymentSchedule = new paymentScheduleType
                {
                    interval = new paymentScheduleTypeInterval
                    {
                        length = 1,
                        unit   = ARBSubscriptionUnitEnum.months,
                    },
                    startDate        = DateTime.UtcNow,
                    totalOccurrences = 12,
                },


                amount = 9.99M,
                billTo = new customerAddressType {
                    firstName = "first", lastName = "last"
                },

                payment = PaymentOne,

                customer = CustomerOne,

                order = new orderType {
                    description = string.Format("member monthly {0}", rnd.Next(99999))
                },
            };

            var arbRequest = new ARBCreateSubscriptionRequest {
                subscription = subscriptionDef
            };
            var arbController = new ARBCreateSubscriptionController(arbRequest);

            arbController.Execute();

            if (arbController.GetResultCode() == messageTypeEnum.Error)
            {
                var errorResp = arbController.GetErrorResponse();
                Console.WriteLine("{0}: {1}", errorResp.messages.message[0].code, errorResp.messages.message[0].text);
            }
        }
        public void TestSubscription()
        {
            var rnd = new AnetRandom(DateTime.Now.Millisecond);

            ApiOperationBase <ANetApiRequest, ANetApiResponse> .MerchantAuthentication = CustomMerchantAuthenticationType;
            ApiOperationBase <ANetApiRequest, ANetApiResponse> .RunEnvironment         = TestEnvironment;

            //create a subscription
            var subscriptionDef = new ARBSubscriptionType
            {
                paymentSchedule = new paymentScheduleType
                {
                    interval = new paymentScheduleTypeInterval
                    {
                        length = 1,
                        unit   = ARBSubscriptionUnitEnum.months,
                    },
                    startDate        = DateTime.UtcNow,
                    totalOccurrences = 12,
                },


                amount = 9.99M,
                billTo = new nameAndAddressType {
                    firstName = "first", lastName = "last", address = "123 elm st ne", city = "Bellevue", state = "Wa", zip = "98007"
                },

                payment = PaymentOne,

                customer = CustomerOne,

                order = new orderType {
                    description = string.Format("member monthly {0}", rnd.Next(99999))
                },
            };

            var arbRequest = new ARBCreateSubscriptionRequest {
                subscription = subscriptionDef
            };
            var arbController = new ARBCreateSubscriptionController(arbRequest);

            arbController.Execute();

            var arbCreateResponse = arbController.GetApiResponse();

            Assert.AreEqual(messageTypeEnum.Ok, arbController.GetResultCode());
        }
        public void CreateSubscription()
        {
            var random  = new AnetRandom();
            var counter = random.Next(1, (int)(Math.Pow(2, 24)));
            var amount  = ComputeRandomAmount();
            var email   = string.Format("user.{0}@authorize.net", counter);

            //check ApiLoginid / TransactionKey
            var sError = CheckApiLoginTransactionKey();

            Assert.IsTrue(sError == "", sError);

            const string responseString = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ARBCreateSubscriptionResponse xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><subscriptionId>2010573</subscriptionId></ARBCreateSubscriptionResponse>";

            LocalRequestObject.ResponseString = responseString;

            var target = new SubscriptionGateway(ApiLogin, TransactionKey);

            var billToAddress = new Address {
                First = "SomeOneCool", Last = "MoreCoolPerson"
            };
            ISubscriptionRequest subscription = SubscriptionRequest.CreateMonthly(email, "ARB Subscription Test", amount, 1);

            subscription.CardNumber          = "4111111111111111";
            subscription.CardExpirationMonth = 3;
            subscription.CardExpirationYear  = 16;
            subscription.BillingAddress      = billToAddress;

            ISubscriptionRequest actual = target.CreateSubscription(subscription);

            Assert.NotNull(actual);
            Assert.AreEqual(subscription.Amount, actual.Amount);
            Assert.AreEqual(subscription.CardNumber, actual.CardNumber);
            Assert.AreEqual(subscription.SubscriptionName, actual.SubscriptionName);

            _sMonthlySubscriptionId = actual.SubscriptionID;
            Assert.IsTrue(0 < _sMonthlySubscriptionId.Trim().Length);
            Assert.IsTrue(0 < long.Parse(_sMonthlySubscriptionId));
        }
Beispiel #7
0
        public void SetUp()
        {
            MockContext = new MockFactory();

            //initialize counter
            Counter    = _random.Next(1, (int)(Math.Pow(2, 24)));
            CounterStr = GetRandomString("");

            _now       = DateTime.UtcNow;
            _nowString = _now.ToString(DateFormat);

            _pastDate   = _now.AddMonths(-1);
            _nowDate    = _now;
            _futureDate = _now.AddMonths(1);

            CustomMerchantAuthenticationType = new merchantAuthenticationType
            {
                name            = ApiLoginIdKey,
                ItemElementName = ItemChoiceType.transactionKey,
                Item            = TransactionKey,
            };

            //		merchantAuthenticationType.setSessionToken(GetRandomString("SessionToken"));
            //		merchantAuthenticationType.setPass_word(GetRandomString("Pass_word"));
            //	    merchantAuthenticationType.setMobileDeviceId(GetRandomString("MobileDevice"));

            //	    ImpersonationAuthenticationType impersonationAuthenticationType = new ImpersonationAuthenticationType();
            //	    impersonationAuthenticationType.setPartnerLoginId(CnpApiLoginIdKey);
            //	    impersonationAuthenticationType.setPartnerTransactionKey(CnpTransactionKey);
            //	    merchantAuthenticationType.setImpersonationAuthentication(impersonationAuthenticationType);

            CustomerProfileType = new customerProfileType
            {
                merchantCustomerId = GetRandomString("Customer"),
                description        = GetRandomString("CustomerDescription"),
                email = CounterStr + "*****@*****.**",
            };

            //make sure these elements are initialized by calling get as it uses lazy initialization
            var paymentProfiles = CustomerProfileType.paymentProfiles;
            var addresses       = CustomerProfileType.shipToList;

            CreditCardOne = new creditCardType
            {
                cardNumber     = "4111111111111111",
                expirationDate = "2038-12",
            };
            //		creditCardOne.setCardCode("");

            BankAccountOne = new bankAccountType
            {
                accountType   = bankAccountTypeEnum.savings,
                routingNumber = "125000000",
                accountNumber = GetRandomString("A/C#"),
                nameOnAccount = GetRandomString("A/CName"),
                echeckType    = echeckTypeEnum.WEB,
                bankName      = GetRandomString("Bank"),
                checkNumber   = CounterStr,
            };

            TrackDataOne = new creditCardTrackType
            {
                ItemElementName = ItemChoiceType1.track1,
                Item            = GetRandomString("Track1"),
                //trackDataOne.setTrack2(GetRandomString("Track2"));
            };

            EncryptedTrackDataOne = new encryptedTrackDataType
            {
                FormOfPayment = new KeyBlock(),
            };
            //keyBlock.setValue(value);

            PayPalOne = new payPalType
            {
                successUrl         = GetRandomString("https://success.anet.net"),
                cancelUrl          = GetRandomString("https://cancel.anet.net"),
                paypalLc           = GetRandomString("Lc"),
                paypalHdrImg       = GetRandomString("Hdr"),
                paypalPayflowcolor = GetRandomString("flowClr"),
                payerID            = GetRandomString("PayerId"),
            };

            PaymentOne = new paymentType
            {
                Item = CreditCardOne
            };
            //paymentOne.setBankAccount(bankAccountOne);
            //paymentOne.setTrackData(trackDataOne);
            //paymentOne.setEncryptedTrackData(encryptedTrackDataOne);
            //paymentOne.setPayPal( payPalOne);

            //		driversLicenseOne = new DriversLicenseType();
            //		driversLicenseOne.setNumber(GetRandomString("DLNumber"));
            //		driversLicenseOne.setState(GetRandomString("WA"));
            //		driversLicenseOne.setDateOfBirth(nowString);

            CustomerAddressOne = new customerAddressType
            {
                firstName   = GetRandomString("FName"),
                lastName    = GetRandomString("LName"),
                company     = GetRandomString("Company"),
                address     = GetRandomString("StreetAdd"),
                city        = "Bellevue",
                state       = "WA",
                zip         = "98000",
                country     = "USA",
                phoneNumber = FormatToPhone(Counter),
                faxNumber   = FormatToPhone(Counter + 1),
            };

            CustomerPaymentProfileOne = new customerPaymentProfileType
            {
                customerType = customerTypeEnum.individual,
                payment      = PaymentOne,
            };
            //	    customerPaymentProfileOne.setBillTo(customerAddressOne);
            //	    customerPaymentProfileOne.setDriversLicense(driversLicenseOne);
            //	    customerPaymentProfileOne.setTaxId(GetRandomString("XX"));


            CustomerOne = new customerType
            {
                type           = customerTypeEnum.individual,
                id             = GetRandomString("Id"),
                email          = CounterStr + "*****@*****.**",
                phoneNumber    = FormatToPhone(Counter),
                faxNumber      = FormatToPhone(Counter + 1),
                driversLicense = DriversLicenseOne,
                taxId          = "911011011",
            };

            CustomerTwo = new customerType();

            var interval = new paymentScheduleTypeInterval
            {
                length = 1,
                unit   = ARBSubscriptionUnitEnum.months,
            };

            OrderType = new orderType()
            {
                //TODO ADD VALIDATION ON INVOICE LENGTH
                invoiceNumber = GetRandomString("Inv:"),
                description   = GetRandomString("Description"),
            };

            NameAndAddressTypeOne = new nameAndAddressType
            {
                firstName = GetRandomString("FName"),
                lastName  = GetRandomString("LName"),
                company   = GetRandomString("Company"),
                address   = GetRandomString("Address"),
                city      = GetRandomString("City"),
                state     = GetRandomString("State"),
                zip       = "98004",
                country   = "USA",
            };

            NameAndAddressTypeTwo = new nameAndAddressType
            {
                firstName = GetRandomString("FName"),
                lastName  = GetRandomString("LName"),
                company   = GetRandomString("Company"),
                address   = GetRandomString("Address"),
                city      = GetRandomString("City"),
                state     = GetRandomString("State"),
                zip       = "98004",
                country   = "USA",
            };

            PaymentScheduleTypeOne = new paymentScheduleType
            {
                interval         = interval,
                startDate        = _nowDate,
                totalOccurrences = 5,
                trialOccurrences = 0,
            };

            ArbSubscriptionOne = new ARBSubscriptionType
            {
                amount          = SetValidSubscriptionAmount(Counter),
                billTo          = NameAndAddressTypeOne,
                customer        = CustomerOne,
                name            = GetRandomString("Name"),
                order           = OrderType,
                payment         = PaymentOne,
                paymentSchedule = PaymentScheduleTypeOne,
                shipTo          = NameAndAddressTypeOne,
                trialAmount     = SetValidSubscriptionAmount(0),
            };

            CustomerDataOne = new customerDataType
            {
                driversLicense = CustomerOne.driversLicense,
                email          = CustomerOne.email,
                id             = CustomerOne.id,
                taxId          = CustomerOne.taxId,
                type           = CustomerOne.type,
            };

            RefId = CounterStr;
        }
Beispiel #8
0
        protected decimal getValidAmount()
        {
            var rnd = new AnetRandom(DateTime.Now.Millisecond);

            return((decimal)rnd.Next(9999) / 100);
        }
Beispiel #9
0
        public void CreateCustomerProfileFromECheckTransaction()
        {
            var    rnd          = new AnetRandom(DateTime.Now.Millisecond);
            string customerIndx = rnd.Next(99999).ToString();

            ApiOperationBase <ANetApiRequest, ANetApiResponse> .MerchantAuthentication = CustomMerchantAuthenticationType;
            ApiOperationBase <ANetApiRequest, ANetApiResponse> .RunEnvironment         = TestEnvironment;

            //set up data based on transaction
            var transactionAmount = SetValidTransactionAmount(Counter);
            var echeck            = new bankAccountType {
                accountNumber = "123456", accountType = bankAccountTypeEnum.checking, checkNumber = "1234", bankName = "Bank of Seattle", routingNumber = "125000024", echeckType = echeckTypeEnum.WEB, nameOnAccount = "Joe Customer"
            };

            //Create and submit transaction with customer info to create profile from.
            var paymentType = new paymentType {
                Item = echeck
            };
            var transactionRequest = new transactionRequestType
            {
                transactionType = transactionTypeEnum.authOnlyTransaction.ToString(),
                payment         = paymentType,
                amount          = (decimal)transactionAmount,
                customer        = new customerDataType
                {
                    email = string.Format("Customer{0}@visa.com", customerIndx),
                    taxId = string.Format("{0}{1}{2}", rnd.Next(999).ToString("000"), rnd.Next(99).ToString("00"), rnd.Next(9999).ToString("0000"))
                },
                billTo = new customerAddressType
                {
                    firstName = "New",
                    lastName  = string.Format("Customer{0}", customerIndx),
                    company   = "New Company",
                    address   = "1234 Sample St NE",
                    city      = "Bellevue",
                    state     = "WA",
                    zip       = "98001"
                },

                shipTo = new customerAddressType
                {
                    firstName = "New",
                    lastName  = string.Format("Customer{0}", customerIndx),
                    company   = "New Company",
                    address   = "1234 Sample St NE",
                    city      = "Bellevue",
                    state     = "WA",
                    zip       = "98001"
                }
            };
            var request = new createTransactionRequest {
                transactionRequest = transactionRequest
            };
            var controller = new createTransactionController(request);

            controller.Execute();
            var response = controller.GetApiResponse();

            //Verify that transaction was accepted and save the transaction ID
            Assert.AreEqual(messageTypeEnum.Ok, response.messages.resultCode);
            string txnID = response.transactionResponse.transId;


            //Build and submit request to create Customer Profile based on the accepted transaction
            createCustomerProfileFromTransactionRequest profileFromTransReq = new createCustomerProfileFromTransactionRequest();

            profileFromTransReq.transId = txnID;

            createCustomerProfileFromTransactionController profileFromTrxnController = new createCustomerProfileFromTransactionController(profileFromTransReq);

            profileFromTrxnController.Execute();
            createCustomerProfileResponse createProfResp = profileFromTrxnController.GetApiResponse();

            Assert.AreEqual(messageTypeEnum.Ok, createProfResp.messages.resultCode);

            //Get customer profile and verify that profile data matches the data submitted with the transaction
            getCustomerProfileRequest profileReq = new getCustomerProfileRequest
            {
                customerProfileId = createProfResp.customerProfileId
            };

            getCustomerProfileController getCustContr = new getCustomerProfileController(profileReq);

            getCustContr.Execute();
            var getCustResp = getCustContr.GetApiResponse();

            //validate
            Assert.AreEqual("1", response.transactionResponse.messages[0].code);
        }
        public void GetSubscriptionSearchCardExpiringThisMonthFixTest()
        {
            var rnd = new AnetRandom(DateTime.Now.Millisecond);
            var createSubscription = new ARBSubscriptionType()
            {
                paymentSchedule = new paymentScheduleType
                {
                    interval = new paymentScheduleTypeInterval
                    {
                        length = 8,
                        unit   = ARBSubscriptionUnitEnum.months
                    },
                    startDate        = DateTime.UtcNow,
                    totalOccurrences = 3,
                },
                amount = 19.29M,

                billTo = new nameAndAddressType
                {
                    address   = "1234 Elm St NE",
                    city      = "Bellevue",
                    state     = "WA",
                    zip       = "98007",
                    firstName = "First",
                    lastName  = "Last"
                },

                payment = new paymentType
                {
                    Item = new creditCardType
                    {
                        cardCode   = "123",
                        cardNumber = "5105105105105100",
                        // cardNumber = "4111111111111111",
                        expirationDate = "102015",
                    }
                },

                customer = new customerType {
                    email = "*****@*****.**", id = "5",
                },

                order = new orderType {
                    description = string.Format("member monthly {0}", rnd.Next(99999))
                },
            };
            var arbCreateSubscriptionController = CreateSubscriptionRequestTest(createSubscription);
            var arbCreateSubscriptionResponse   = arbCreateSubscriptionController.ExecuteWithApiResponse();

            if (null == arbCreateSubscriptionResponse)
            {
                throw new ArgumentNullException("arbCreateSubscriptionResponse");
            }

            var getSubscriptionList = new ARBGetSubscriptionListRequest()
            {
                searchType = ARBGetSubscriptionListSearchTypeEnum.cardExpiringThisMonth,
            };

            var arbGetSubscriptionListController = new ARBGetSubscriptionListController(getSubscriptionList);
            var arbGetSubscriptionListResponse   = arbGetSubscriptionListController.ExecuteWithApiResponse();

            Assert.IsNotNull(arbGetSubscriptionListResponse);
        }
        public void TestSubscription_ExpiredCC()
        {
            var rnd = new AnetRandom(DateTime.Now.Millisecond);

            ApiOperationBase <ANetApiRequest, ANetApiResponse> .MerchantAuthentication = CustomMerchantAuthenticationType;
            ApiOperationBase <ANetApiRequest, ANetApiResponse> .RunEnvironment         = TestEnvironment;
            //create a subscription
            var subscriptionDef = new ARBSubscriptionType
            {
                paymentSchedule = new paymentScheduleType
                {
                    interval = new paymentScheduleTypeInterval
                    {
                        length = 7,
                        unit   = ARBSubscriptionUnitEnum.days
                    },
                    startDate        = DateTime.UtcNow,
                    totalOccurrences = 2,
                },


                amount = 9.99M,

                billTo = new nameAndAddressType
                {
                    address   = "1234 Elm St NE",
                    city      = "Bellevue",
                    state     = "WA",
                    zip       = "98007",
                    firstName = "First",
                    lastName  = "Last"
                },

                payment = new paymentType
                {
                    Item = new creditCardType
                    {
                        cardCode = "655",
                        //cardNumber = "4007000",
                        cardNumber     = "4111111111111111",
                        expirationDate = "122013",
                    }
                },

                customer = new customerType {
                    email = "*****@*****.**", id = "5",
                },

                order = new orderType {
                    description = string.Format("member monthly {0}", rnd.Next(99999))
                },
            };

            var arbRequest = new ARBCreateSubscriptionRequest {
                subscription = subscriptionDef
            };
            var arbController = new ARBCreateSubscriptionController(arbRequest);

            arbController.Execute();

            var arbCreateResponse = arbController.GetApiResponse();

            //If request responds with an error, walk the messages and get code and text for each message.
            if (arbController.GetResultCode() == messageTypeEnum.Error)
            {
                foreach (var msg in arbCreateResponse.messages.message)
                {
                    Console.WriteLine("Error Num = {0}, Message = {1}", msg.code, msg.text);
                }
            }
        }
Beispiel #12
0
        public void MockARBGetSubscriptionTest()
        {
            //define all mocked objects as final
            var mockController = GetMockController <ARBGetSubscriptionRequest, ARBGetSubscriptionResponse>();
            var mockRequest    = new ARBGetSubscriptionRequest
            {
                merchantAuthentication = new merchantAuthenticationType()
                {
                    name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey
                },
                subscriptionId = "1234"
            };

            var customerPaymentProfileMaskedType = new customerPaymentProfileMaskedType
            {
                customerPaymentProfileId = "1234",
            };

            var rnd = new AnetRandom(DateTime.Now.Millisecond);
            var SubscriptionMaskedType = new ARBSubscriptionMaskedType()
            {
                name            = "Test",
                paymentSchedule = new paymentScheduleType
                {
                    interval = new paymentScheduleTypeInterval
                    {
                        length = 1,
                        unit   = ARBSubscriptionUnitEnum.months,
                    },
                    startDate        = DateTime.UtcNow,
                    totalOccurrences = 12
                },
                amount               = 9.99M,
                amountSpecified      = true,
                trialAmount          = 100,
                trialAmountSpecified = true,
                status               = ARBSubscriptionStatusEnum.active,
                statusSpecified      = true,
                profile              = new subscriptionCustomerProfileType()
                {
                    paymentProfile = customerPaymentProfileMaskedType,
                },
                order = new orderType {
                    description = string.Format("member monthly {0}", rnd.Next(99999))
                }
            };

            var mockResponse = new ARBGetSubscriptionResponse
            {
                refId        = "1234",
                sessionToken = "sessiontoken",
                subscription = SubscriptionMaskedType
            };

            var errorResponse = new ANetApiResponse();
            var results       = new List <String>();
            const messageTypeEnum messageTypeOk = messageTypeEnum.Ok;

            SetMockControllerExpectations <ARBGetSubscriptionRequest, ARBGetSubscriptionResponse, ARBGetSubscriptionController>(
                mockController.MockObject, mockRequest, mockResponse, errorResponse, results, messageTypeOk);
            mockController.MockObject.Execute(AuthorizeNet.Environment.CUSTOM);
            //mockController.MockObject.Execute();
            // or var controllerResponse = mockController.MockObject.ExecuteWithApiResponse(AuthorizeNet.Environment.CUSTOM);
            var controllerResponse = mockController.MockObject.GetApiResponse();

            Assert.IsNotNull(controllerResponse);

            Assert.IsNotNull(controllerResponse.subscription);
            LogHelper.info(Logger, "ARBGetSubscription: Details:{0}", controllerResponse.subscription);
        }