public static void Run(String ApiLoginID, String ApiTransactionKey) { Console.WriteLine("DeleteCustomerShippingAddress Sample"); ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX; ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType() { name = ApiLoginID, ItemElementName = ItemChoiceType.transactionKey, Item = ApiTransactionKey, }; var request = new deleteCustomerShippingAddressRequest { customerProfileId = "36537239" }; //Prepare Request var controller = new deleteCustomerShippingAddressController(request); controller.Execute(); //Send Request to EndPoint deleteCustomerShippingAddressResponse response = controller.GetApiResponse(); if (response != null && response.messages.resultCode == messageTypeEnum.Ok) { if (response != null && response.messages.message != null) { Console.WriteLine("Success, ResultCode : " + response.messages.resultCode.ToString()); } } else { Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text); } }
public void MockdeleteCustomerShippingAddressTest() { //define all mocked objects as final var mockController = GetMockController<deleteCustomerShippingAddressRequest, deleteCustomerShippingAddressResponse>(); var mockRequest = new deleteCustomerShippingAddressRequest { merchantAuthentication = new merchantAuthenticationType {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, }; var mockResponse = new deleteCustomerShippingAddressResponse { refId = "1234", sessionToken = "sessiontoken", }; var errorResponse = new ANetApiResponse(); var results = new List<String>(); const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; SetMockControllerExpectations<deleteCustomerShippingAddressRequest, deleteCustomerShippingAddressResponse, deleteCustomerShippingAddressController>( 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); }
public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, string customerProfileId, string customerAddressId) { Console.WriteLine("DeleteCustomerShippingAddress Sample"); ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX; ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType() { name = ApiLoginID, ItemElementName = ItemChoiceType.transactionKey, Item = ApiTransactionKey, }; //please update the subscriptionId according to your sandbox credentials var request = new deleteCustomerShippingAddressRequest { customerProfileId = customerProfileId, customerAddressId = customerAddressId }; //Prepare Request var controller = new deleteCustomerShippingAddressController(request); controller.Execute(); //Send Request to EndPoint deleteCustomerShippingAddressResponse response = controller.GetApiResponse(); if (response != null && response.messages.resultCode == messageTypeEnum.Ok) { if (response != null && response.messages.message != null) { Console.WriteLine("Success, ResultCode : " + response.messages.resultCode.ToString()); } } else if(response != null) { Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text); } return response; }
public static void deleteCustomerShippingAddressRequest(deleteCustomerShippingAddressRequest argument) { if (null != argument) { } }
public static void deleteCustomerShippingAddressRequest ( deleteCustomerShippingAddressRequest request) { }