From b7421c0a20888c7dfc2b2fe97978af8e95a231fb Mon Sep 17 00:00:00 2001 From: Aaron Wright Date: Tue, 21 Mar 2017 09:58:19 -0600 Subject: [PATCH 01/30] fix formatting of README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2da36a79..07017a9e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Authorize.Net .Net SDK -[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-dotnet/master.svg)] -(https://travis-ci.org/AuthorizeNet/sdk-dotnet) +[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-dotnet/master.svg)](https://travis-ci.org/AuthorizeNet/sdk-dotnet) [![Code Climate](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet/badges/gpa.svg)](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet) [![NuGet](https://badge.fury.io/nu/authorizenet.svg)](https://www.nuget.org/packages/authorizenet) @@ -27,7 +26,7 @@ Apart from this README, you can find details and examples of using the SDK in th - [Developer Center Reference](http://developer.authorize.net/api/reference/index.html) ### Charging a Credit Card -````csharp +```csharp ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.SANDBOX; ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType() @@ -70,7 +69,7 @@ Apart from this README, you can find details and examples of using the SDK in th { Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text); } -```` +``` ### Setting the Production Environment Set the appropriate environment constant using the ApiOperationBase RunEnvironment. For example, in the method above, to switch to production environment use: From b6223eccfbf21c62685e675bcc3753c51d794e67 Mon Sep 17 00:00:00 2001 From: bselvara Date: Thu, 13 Apr 2017 17:00:57 +0530 Subject: [PATCH 02/30] SDK updates --- .../Contracts/V1/AnetApiSchema.generated.cs | 99 +++++++++++++------ .../V1/RequestFactoryWithSpecified.cs | 13 ++- .../RequestFactoryWithSpecified.generated.org | 23 +++-- ...getTransactionListForCustomerController.cs | 30 ++++++ Authorize.NET/AuthorizeNET.csproj | 1 + .../Utility/AnetApiSchema.generated.cs | 81 +++++++++++---- ...ransactionListForCustomerControllerTest.cs | 71 +++++++++++++ AuthorizeNETtest/CardPresentGatewayTest.cs | 4 +- 8 files changed, 266 insertions(+), 56 deletions(-) create mode 100644 Authorize.NET/Api/Controllers/getTransactionListForCustomerController.cs create mode 100644 AuthorizeNETtest/Api/Controllers/MockTest/getTransactionListForCustomerControllerTest.cs diff --git a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs index 944b50d2..3657dc3e 100644 --- a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs +++ b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.8662 +// Runtime Version:2.0.50727.8689 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -237,33 +237,6 @@ protected void RaisePropertyChanged(string propertyName) { } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public partial class customerProfileIdType : object, System.ComponentModel.INotifyPropertyChanged { - - /// - public string customerProfileId; - - /// - public string customerPaymentProfileId; - - /// - public string customerAddressId; - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected void RaisePropertyChanged(string propertyName) { - System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; - if ((propertyChanged != null)) { - propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - } - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -1018,6 +991,9 @@ public partial class transactionResponse : object, System.ComponentModel.INotify /// public string transHashSha2; + /// + public customerProfileIdType profile; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -1251,6 +1227,33 @@ protected void RaisePropertyChanged(string propertyName) { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class customerProfileIdType : object, System.ComponentModel.INotifyPropertyChanged { + + /// + public string customerProfileId; + + /// + public string customerPaymentProfileId; + + /// + public string customerAddressId; + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -1438,6 +1441,9 @@ public partial class transactionDetailsType : object, System.ComponentModel.INot [System.Xml.Serialization.XmlArrayItemAttribute("tag", IsNullable=false)] public transactionDetailsTypeTag[] emvDetails; + /// + public customerProfileIdType profile; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -3510,6 +3516,9 @@ public partial class transactionSummaryType : object, System.ComponentModel.INot /// public fraudInformationType fraudInformation; + /// + public customerProfileIdType profile; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -4273,6 +4282,12 @@ public partial class getCustomerProfileRequest : ANetApiRequest { /// public string customerProfileId; + /// + public string merchantCustomerId; + + /// + public string email; + /// public bool unmaskExpirationDate; @@ -4701,6 +4716,12 @@ public partial class getTransactionDetailsResponse : ANetApiResponse { /// public transactionDetailsType transaction; + + /// + public string clientId; + + /// + public string transrefId; } /// @@ -5588,6 +5609,28 @@ public partial class ARBGetSubscriptionResponse : ANetApiResponse { public ARBSubscriptionMaskedType subscription; } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + [System.Xml.Serialization.XmlRootAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable=false)] + public partial class getTransactionListForCustomerRequest : ANetApiRequest { + + /// + public string customerProfileId; + + /// + public string customerPaymentProfileId; + + /// + public TransactionListSorting sorting; + + /// + public Paging paging; + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index 3c3f3cb6..d80c402c 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -175,6 +175,7 @@ public static void transactionSummaryType(transactionSummaryType argument) subscriptionPaymentType(argument.subscription); if (argument.hasReturnedItems) { argument.hasReturnedItemsSpecified = true; } fraudInformationType(argument.fraudInformation); + customerProfileIdType(argument.profile); } } public static void subscriptionPaymentType(subscriptionPaymentType argument) @@ -517,7 +518,8 @@ public static void transactionDetailsType(transactionDetailsType argument) solutionType(argument.solution); if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} } - + + customerProfileIdType(argument.profile); } } public static void paymentMaskedType(paymentMaskedType argument) @@ -574,6 +576,7 @@ public static void transactionResponse(transactionResponse argument) nameAndAddressType(argument.shipTo); transactionResponseSecureAcceptance(argument.secureAcceptance); transactionResponseEmvResponse(argument.emvResponse); + customerProfileIdType(argument.profile); } } @@ -1505,6 +1508,14 @@ public static void getMerchantDetailsResponse(getMerchantDetailsResponse argumen } } + public static void getTransactionListForCustomerRequest(getTransactionListForCustomerRequest argument) + { + if(null != argument) + { + TransactionListSorting(argument.sorting); + Paging(argument.paging); + } + } } diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org index a750f1da..6d958c45 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org @@ -83,12 +83,6 @@ namespace AuthorizeNet.Api.Contracts.V1 long(argument.profileCount); } } - public static void customerProfileIdType(customerProfileIdType argument) - { - if(null != argument) - { - } - } public static void customerPaymentProfileListItemType(customerPaymentProfileListItemType argument) { if(null != argument) @@ -219,6 +213,7 @@ namespace AuthorizeNet.Api.Contracts.V1 nameAndAddressType(argument.shipTo); transactionResponseSecureAcceptance(argument.secureAcceptance); transactionResponseEmvResponse(argument.emvResponse); + customerProfileIdType(argument.profile); } } public static void transactionResponsePrePaidCard(transactionResponsePrePaidCard argument) @@ -270,6 +265,12 @@ namespace AuthorizeNet.Api.Contracts.V1 { } } + public static void customerProfileIdType(customerProfileIdType argument) + { + if(null != argument) + { + } + } public static void returnedItemType(returnedItemType argument) { if(null != argument) @@ -299,6 +300,7 @@ namespace AuthorizeNet.Api.Contracts.V1 if(null != argument.returnedItems){ foreach( var value in argument.returnedItems) { returnedItemType(value);} } solutionType(argument.solution); if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} } + customerProfileIdType(argument.profile); } } public static void subscriptionPaymentType(subscriptionPaymentType argument) @@ -812,6 +814,7 @@ transRetailInfoType() { subscriptionPaymentType(argument.subscription); if(argument.hasReturnedItems) { argument.hasReturnedItemsSpecified=true;} fraudInformationType(argument.fraudInformation); + customerProfileIdType(argument.profile); } } public static void ARBSubscriptionType(ARBSubscriptionType argument) @@ -1439,6 +1442,14 @@ transRetailInfoType() { ARBSubscriptionMaskedType(argument.subscription); } } + public static void getTransactionListForCustomerRequest(getTransactionListForCustomerRequest argument) + { + if(null != argument) + { + TransactionListSorting(argument.sorting); + Paging(argument.paging); + } + } public static void getAUJobSummaryRequest(getAUJobSummaryRequest argument) { if(null != argument) diff --git a/Authorize.NET/Api/Controllers/getTransactionListForCustomerController.cs b/Authorize.NET/Api/Controllers/getTransactionListForCustomerController.cs new file mode 100644 index 00000000..63b64407 --- /dev/null +++ b/Authorize.NET/Api/Controllers/getTransactionListForCustomerController.cs @@ -0,0 +1,30 @@ +namespace AuthorizeNet.Api.Controllers +{ + using System; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers.Bases; + +#pragma warning disable 1591 + public class getTransactionListForCustomerController : ApiOperationBase { + + public getTransactionListForCustomerController(getTransactionListForCustomerRequest apiRequest) : base(apiRequest) { + } + + override protected void ValidateRequest() { + var request = GetApiRequest(); + + //validate required fields + //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); + //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); + + //validate not-required fields + } + + protected override void BeforeExecute() + { + var request = GetApiRequest(); + RequestFactoryWithSpecified.getTransactionListForCustomerRequest(request); + } + } +#pragma warning restore 1591 +} \ No newline at end of file diff --git a/Authorize.NET/AuthorizeNET.csproj b/Authorize.NET/AuthorizeNET.csproj index 19dd13bf..e2967fb3 100644 --- a/Authorize.NET/AuthorizeNET.csproj +++ b/Authorize.NET/AuthorizeNET.csproj @@ -85,6 +85,7 @@ + diff --git a/Authorize.NET/Utility/AnetApiSchema.generated.cs b/Authorize.NET/Utility/AnetApiSchema.generated.cs index ebc459a5..43e93dc3 100644 --- a/Authorize.NET/Utility/AnetApiSchema.generated.cs +++ b/Authorize.NET/Utility/AnetApiSchema.generated.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.8662 +// Runtime Version:2.0.50727.8689 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -183,24 +183,6 @@ public partial class auResponseType { public string reasonDescription; } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public partial class customerProfileIdType { - - /// - public string customerProfileId; - - /// - public string customerPaymentProfileId; - - /// - public string customerAddressId; - } - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -819,6 +801,9 @@ public partial class transactionResponse { /// public string transHashSha2; + + /// + public customerProfileIdType profile; } /// @@ -972,6 +957,24 @@ public partial class emvTag { public string formatted; } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class customerProfileIdType { + + /// + public string customerProfileId; + + /// + public string customerPaymentProfileId; + + /// + public string customerAddressId; + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -1149,6 +1152,9 @@ public partial class transactionDetailsType { /// [System.Xml.Serialization.XmlArrayItemAttribute("tag", IsNullable=false)] public transactionDetailsTypeTag[] emvDetails; + + /// + public customerProfileIdType profile; } /// @@ -2780,6 +2786,9 @@ public partial class transactionSummaryType { /// public fraudInformationType fraudInformation; + + /// + public customerProfileIdType profile; } /// @@ -3445,6 +3454,12 @@ public partial class getCustomerProfileRequest : ANetApiRequest { /// public string customerProfileId; + /// + public string merchantCustomerId; + + /// + public string email; + /// public bool unmaskExpirationDate; @@ -3873,6 +3888,12 @@ public partial class getTransactionDetailsResponse : ANetApiResponse { /// public transactionDetailsType transaction; + + /// + public string clientId; + + /// + public string transrefId; } /// @@ -4751,6 +4772,28 @@ public partial class ARBGetSubscriptionResponse : ANetApiResponse { public ARBSubscriptionMaskedType subscription; } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + [System.Xml.Serialization.XmlRootAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable=false)] + public partial class getTransactionListForCustomerRequest : ANetApiRequest { + + /// + public string customerProfileId; + + /// + public string customerPaymentProfileId; + + /// + public TransactionListSorting sorting; + + /// + public Paging paging; + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/getTransactionListForCustomerControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/getTransactionListForCustomerControllerTest.cs new file mode 100644 index 00000000..97fe3378 --- /dev/null +++ b/AuthorizeNETtest/Api/Controllers/MockTest/getTransactionListForCustomerControllerTest.cs @@ -0,0 +1,71 @@ +namespace AuthorizeNet.Api.Controllers.MockTest +{ + using System; + using System.Collections.Generic; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers; + using AuthorizeNet.Api.Controllers.Test; + using AuthorizeNet.Util; + using NUnit.Framework; + + [TestFixture] + public class getTransactionListForCustomerTest : ApiCoreTestBase + { + + [TestFixtureSetUp] + public new static void SetUpBeforeClass() + { + ApiCoreTestBase.SetUpBeforeClass(); + } + + [TestFixtureTearDown] + public new static void TearDownAfterClass() + { + ApiCoreTestBase.TearDownAfterClass(); + } + + [SetUp] + public new void SetUp() + { + base.SetUp(); + } + + [TearDown] + public new void TearDown() + { + base.TearDown(); + } + + [Test] + public void MockgetTransactionListForCustomerTest() + { + //define all mocked objects as final + var mockController = GetMockController(); + var mockRequest = new getTransactionListForCustomerRequest + { + merchantAuthentication = new merchantAuthenticationType() {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, + }; + var mockResponse = new getTransactionListForCustomerResponse + { + refId = "1234", + sessionToken = "sessiontoken", + Yyyyy = Yyyy, + }; + + var errorResponse = new ANetApiResponse(); + var results = new List(); + const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; + + SetMockControllerExpectations( + 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.Yyyyy); + LogHelper.info(Logger, "getTransactionListForCustomer: Details:{0}", controllerResponse.Yyyyy); + } + } +} diff --git a/AuthorizeNETtest/CardPresentGatewayTest.cs b/AuthorizeNETtest/CardPresentGatewayTest.cs index c41443f1..ef3bf606 100644 --- a/AuthorizeNETtest/CardPresentGatewayTest.cs +++ b/AuthorizeNETtest/CardPresentGatewayTest.cs @@ -27,7 +27,7 @@ public void SendTest_Auth_Approved() CardPresentGateway target = new CardPresentGateway(ApiLogin, TransactionKey, true); - IGatewayRequest request = new CardPresentAuthorizationRequest((decimal)30.11, "4111111111111111", "02", "16"); + IGatewayRequest request = new CardPresentAuthorizationRequest((decimal)30.11, "4111111111111111", "02", "20"); string description = "CP Auth transaction approved testing"; IGatewayResponse actual = target.Send(request, description); @@ -162,7 +162,7 @@ private string SendAuthOnly(decimal amount, bool returnTransID) CardPresentGateway target = new CardPresentGateway(ApiLogin, TransactionKey, true); - IGatewayRequest request = new CardPresentAuthorizationRequest(amount, "4111111111111111", "02", "16"); + IGatewayRequest request = new CardPresentAuthorizationRequest(amount, "4111111111111111", "02", "20"); string description = "CP Auth transaction approved testing"; IGatewayResponse response = target.Send(request, description); From 7c7937628b2d08022de6000e81f4c64cf43289f9 Mon Sep 17 00:00:00 2001 From: Sunny Raj Rathod Date: Tue, 25 Apr 2017 11:57:45 +0530 Subject: [PATCH 03/30] Update sdk version to 1.9.2. --- AuthorizeNet.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AuthorizeNet.nuspec b/AuthorizeNet.nuspec index 7113fd90..46958dca 100644 --- a/AuthorizeNet.nuspec +++ b/AuthorizeNet.nuspec @@ -2,7 +2,7 @@ AuthorizeNet - 1.9.1 + 1.9.2 AuthorizeNet Authorize.Net AuthorizeNet From de42bc7b661feba79dca464ae6d44a31136db7fb Mon Sep 17 00:00:00 2001 From: Sunny Raj Rathod Date: Tue, 25 Apr 2017 11:58:20 +0530 Subject: [PATCH 04/30] Update SDKVersion to 1.9.2 --- Authorize.NET/Util/Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Authorize.NET/Util/Constants.cs b/Authorize.NET/Util/Constants.cs index 49a5f092..48a86602 100644 --- a/Authorize.NET/Util/Constants.cs +++ b/Authorize.NET/Util/Constants.cs @@ -26,7 +26,7 @@ public static class Constants { public const int HttpConnectionDefaultTimeout = 30000; public const int HttpReadWriteDefaultTimeout = 30000; - public const string SDKVersion = "1.9.1"; + public const string SDKVersion = "1.9.2"; } #pragma warning restore 1591 From 8e0d50cd40d7d821d6d537ce0b886df5e8dce5b8 Mon Sep 17 00:00:00 2001 From: rahulrnitc Date: Thu, 18 May 2017 16:30:00 +0530 Subject: [PATCH 05/30] Updated to use OAuth merchant authentication type from latest xsd. --- Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs | 4 ++++ Authorize.NET/Utility/AnetApiSchema.generated.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs index 3657dc3e..0fc44463 100644 --- a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs +++ b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs @@ -3775,6 +3775,7 @@ public partial class merchantAuthenticationType : object, System.ComponentModel. public string name; /// + [System.Xml.Serialization.XmlElementAttribute("accessToken", typeof(string))] [System.Xml.Serialization.XmlElementAttribute("clientKey", typeof(string))] [System.Xml.Serialization.XmlElementAttribute("fingerPrint", typeof(fingerPrintType))] [System.Xml.Serialization.XmlElementAttribute("impersonationAuthentication", typeof(impersonationAuthenticationType))] @@ -3807,6 +3808,9 @@ protected void RaisePropertyChanged(string propertyName) { [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IncludeInSchema=false)] public enum ItemChoiceType { + /// + accessToken, + /// clientKey, diff --git a/Authorize.NET/Utility/AnetApiSchema.generated.cs b/Authorize.NET/Utility/AnetApiSchema.generated.cs index 43e93dc3..a590b326 100644 --- a/Authorize.NET/Utility/AnetApiSchema.generated.cs +++ b/Authorize.NET/Utility/AnetApiSchema.generated.cs @@ -2983,6 +2983,7 @@ public partial class merchantAuthenticationType { public string name; /// + [System.Xml.Serialization.XmlElementAttribute("accessToken", typeof(string))] [System.Xml.Serialization.XmlElementAttribute("clientKey", typeof(string))] [System.Xml.Serialization.XmlElementAttribute("fingerPrint", typeof(fingerPrintType))] [System.Xml.Serialization.XmlElementAttribute("impersonationAuthentication", typeof(impersonationAuthenticationType))] @@ -3006,6 +3007,9 @@ public partial class merchantAuthenticationType { [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IncludeInSchema=false)] public enum ItemChoiceType { + /// + accessToken, + /// clientKey, From 576733e27b858c624d604b24fa74fbc28b632ab2 Mon Sep 17 00:00:00 2001 From: rahulrnitc Date: Thu, 18 May 2017 17:49:54 +0530 Subject: [PATCH 06/30] Updating SDK version to 1.9.3 for new release --- Authorize.NET/Util/Constants.cs | 2 +- AuthorizeNet.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Authorize.NET/Util/Constants.cs b/Authorize.NET/Util/Constants.cs index 48a86602..6286bea8 100644 --- a/Authorize.NET/Util/Constants.cs +++ b/Authorize.NET/Util/Constants.cs @@ -26,7 +26,7 @@ public static class Constants { public const int HttpConnectionDefaultTimeout = 30000; public const int HttpReadWriteDefaultTimeout = 30000; - public const string SDKVersion = "1.9.2"; + public const string SDKVersion = "1.9.3"; } #pragma warning restore 1591 diff --git a/AuthorizeNet.nuspec b/AuthorizeNet.nuspec index 46958dca..4d6b0f80 100644 --- a/AuthorizeNet.nuspec +++ b/AuthorizeNet.nuspec @@ -2,7 +2,7 @@ AuthorizeNet - 1.9.2 + 1.9.3 AuthorizeNet Authorize.Net AuthorizeNet From 160ad830aa08663bfc1a1cccd4ddd20baff1c668 Mon Sep 17 00:00:00 2001 From: Aaron Wright Date: Fri, 30 Jun 2017 00:17:53 -0600 Subject: [PATCH 07/30] Update HttpUtility.cs specify TLS 1.2 --- Authorize.NET/Util/HttpUtility.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Authorize.NET/Util/HttpUtility.cs b/Authorize.NET/Util/HttpUtility.cs index 6003dc9e..31c8d464 100644 --- a/Authorize.NET/Util/HttpUtility.cs +++ b/Authorize.NET/Util/HttpUtility.cs @@ -66,6 +66,7 @@ public static ANetApiResponse PostData(AuthorizeNet.Environment env, TQ // Get the response String responseAsString = null; Logger.debug(string.Format("Retreiving Response from Url: '{0}'", postUrl)); + ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; using (var webResponse = webRequest.GetResponse()) { Logger.debug(string.Format("Received Response: '{0}'", webResponse)); From e114d4496d456917437bf33adb96fcd4c1510a42 Mon Sep 17 00:00:00 2001 From: adavidw Date: Mon, 3 Jul 2017 15:15:33 -0600 Subject: [PATCH 08/30] standardize name of license file --- license.txt => LICENSE.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename license.txt => LICENSE.txt (100%) diff --git a/license.txt b/LICENSE.txt similarity index 100% rename from license.txt rename to LICENSE.txt From 9c3a32d960fe5f75cb260339400e11b3eba7d695 Mon Sep 17 00:00:00 2001 From: adavidw Date: Mon, 3 Jul 2017 15:27:26 -0600 Subject: [PATCH 09/30] standardize name of license file --- AuthorizeNet.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AuthorizeNet.nuspec b/AuthorizeNet.nuspec index 4d6b0f80..df632ee8 100644 --- a/AuthorizeNet.nuspec +++ b/AuthorizeNet.nuspec @@ -6,7 +6,7 @@ AuthorizeNet Authorize.Net AuthorizeNet - https://github.com/AuthorizeNet/sdk-dotnet/blob/master/license.txt + https://github.com/AuthorizeNet/sdk-dotnet/blob/master/LICENSE.txt https://github.com/AuthorizeNet/sdk-dotnet http://developer.authorize.net/resources/images/favicon.ico false From 39f59b988e3199349a668e0df24a1d0144fb7ee1 Mon Sep 17 00:00:00 2001 From: adavidw Date: Wed, 5 Jul 2017 12:49:47 -0600 Subject: [PATCH 10/30] standardize readme format and info across repos --- README.md | 112 ++++++++++++++++++++++----------------------- sample-code-csharp | 2 +- 2 files changed, 56 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 07017a9e..af8bd844 100644 --- a/README.md +++ b/README.md @@ -4,78 +4,73 @@ [![Code Climate](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet/badges/gpa.svg)](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet) [![NuGet](https://badge.fury.io/nu/authorizenet.svg)](https://www.nuget.org/packages/authorizenet) -`PM> Install-Package AuthorizeNet` - +## Requirements -## Prerequisites +* .NET 3.5 or later +* Microsoft® Visual Studio 2008 or 2010 +* Nunit 2.6.3; +* An Authorize.Net account (see _Registration & Configuration_ section below) -Requires .NET 3.5 or later and Microsoft® Visual Studio 2008 or 2010; Nunit 2.6.3; +### TLS 1.2 +The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. It's important to make sure you have new enough versions of all required components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in your system or any libraries it uses. ## Installation -To install AuthorizeNet, run the following command in the Package Manager Console: +To install the AuthorizeNet .NET SDK, run the following command in the Package Manager Console: `PM> Install-Package AuthorizeNet` -## Usage -Apart from this README, you can find details and examples of using the SDK in the following places: +## Registration & Configuration -- [Github Sample Code Repository](https://github.com/AuthorizeNet/sample-code-csharp) -- [Developer Center Reference](http://developer.authorize.net/api/reference/index.html) +Use of this SDK and the Authorize.Net APIs requires having an account on our system. You can find these details in the Settings section. +If you don't currently have a production Authorize.Net account and need a sandbox account for testing, you can easily sign up for one [here](https://developer.authorize.net/sandbox/). + + +### Authentication + +To authenticate with the Authorize.Net API you will need to use your account's API Login ID and Transaction Key. If you don't have these values, you can obtain them from our Merchant Interface site. Access the Merchant Interface for production accounts at (https://account.authorize.net/) or sandbox accounts at (https://sandbox.authorize.net). + +Once you have your keys simply load them into the appropriate variables in your code, as per the below sample code dealing with the authentication part of the API request. -### Charging a Credit Card -```csharp - ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.SANDBOX; - - ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType() - { - name = ApiLoginID, - ItemElementName = ItemChoiceType.transactionKey, - Item = ApiTransactionKey, - }; - - var creditCard = new creditCardType - { - cardNumber = "4111111111111111", - expirationDate = "0718" - }; - - var paymentType = new paymentType { Item = creditCard }; - - var transactionRequest = new transactionRequestType - { - transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), - amount = 133.45m, - payment = paymentType - }; - - var request = new createTransactionRequest { transactionRequest = transactionRequest }; - - var controller = new createTransactionController(request); - controller.Execute(); - - var response = controller.GetApiResponse(); - - if (response.messages.resultCode == messageTypeEnum.Ok) - { - if (response.transactionResponse != null) - { - Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode); - } - } - else - { - Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text); - } -``` -### Setting the Production Environment -Set the appropriate environment constant using the ApiOperationBase RunEnvironment. For example, in the method above, to switch to production environment use: +#### To set your API credentials for an API request: + + +You should never include your Login ID and Transaction Key directly in a PHP file that's in a publically accessible portion of your website. A better practice would be to define these in a constants file, and then reference those constants in the appropriate place in your code. + + +### Switching between the sandbox environment and the production environment + +Authorize.Net maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the appropriate environment constant using ApiOperationBase `RunEnvironment` method. For example: ```csharp +// For PRODUCTION use ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.PRODUCTION; -``` +``` + +API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments. + + +## SDK Usage Examples and Sample Code +To get started using this SDK, it's highly recommended to download our sample code repository: +* [Authorize.Net C# Sample Code Repository (on GitHub)](https://github.com/AuthorizeNet/sample-code-csharp) + +In that respository, we have comprehensive sample code for all common uses of our API: + +Additionally, you can find details and examples of how our API is structured in our API Reference Guide: +* [Developer Center API Reference](http://developer.authorize.net/api/reference/index.html) + +The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK. + + + + + + + + + ## Running the SDK Tests @@ -105,3 +100,6 @@ the CCV code. | Visa (Card Present Track 1) | %B4111111111111111^DOE/JOHN^1803101000000000020000831000000? | +## License + +This repository is destributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file. diff --git a/sample-code-csharp b/sample-code-csharp index 40526f6e..138f5e7b 160000 --- a/sample-code-csharp +++ b/sample-code-csharp @@ -1 +1 @@ -Subproject commit 40526f6e763825447ff934ac03eff464bd5dad8a +Subproject commit 138f5e7b86d9324a88e2cef7ce1fea9313072c33 From fb969c29e317dd40307e5c3043ebe2347d83c0a1 Mon Sep 17 00:00:00 2001 From: adavidw Date: Wed, 5 Jul 2017 16:53:52 -0600 Subject: [PATCH 11/30] standardize readme format and info across repos --- README.md | 51 ++++++++++++++------------------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index af8bd844..64c3beb7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ ## Requirements - * .NET 3.5 or later * Microsoft® Visual Studio 2008 or 2010 * Nunit 2.6.3; @@ -23,26 +22,27 @@ To install the AuthorizeNet .NET SDK, run the following command in the Package M ## Registration & Configuration - Use of this SDK and the Authorize.Net APIs requires having an account on our system. You can find these details in the Settings section. If you don't currently have a production Authorize.Net account and need a sandbox account for testing, you can easily sign up for one [here](https://developer.authorize.net/sandbox/). - ### Authentication - To authenticate with the Authorize.Net API you will need to use your account's API Login ID and Transaction Key. If you don't have these values, you can obtain them from our Merchant Interface site. Access the Merchant Interface for production accounts at (https://account.authorize.net/) or sandbox accounts at (https://sandbox.authorize.net). Once you have your keys simply load them into the appropriate variables in your code, as per the below sample code dealing with the authentication part of the API request. - #### To set your API credentials for an API request: +```csharp +ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType() +{ + name = "YOUR_API_LOGIN_ID", + ItemElementName = ItemChoiceType.transactionKey, + Item = "YOUR_TRANSACTION_KEY", +}; +``` - -You should never include your Login ID and Transaction Key directly in a PHP file that's in a publically accessible portion of your website. A better practice would be to define these in a constants file, and then reference those constants in the appropriate place in your code. - +You should never include your Login ID and Transaction Key directly in a file that's in a publically accessible portion of your website. A better practice would be to define these in a constants file, and then reference those constants in the appropriate place in your code. ### Switching between the sandbox environment and the production environment - Authorize.Net maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the appropriate environment constant using ApiOperationBase `RunEnvironment` method. For example: ```csharp // For PRODUCTION use @@ -64,17 +64,9 @@ Additionally, you can find details and examples of how our API is structured in The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK. +## Building & Testing the SDK - - - - - - - - -## Running the SDK Tests - +### Running the SDK Tests All the tests can be run against a stub backend using the USELOCAL run configuration. Get a sandbox account at https://developer.authorize.net/sandbox/ @@ -82,24 +74,9 @@ Update app.config in the AuthorizeNetTest folder to run all the tests against yo For reporting tests, go to https://sandbox.authorize.net/ under Account tab->Transaction Details API and enable it. - -## Credit Card Test Numbers - -For your reference, you can use the following test credit card numbers. -The expiration date must be set to the present date or later. Use 123 for -the CCV code. - -| Card | Test Numbers | -| :-------------------------- | :----------------------------------------------------------- | -| American Express | 370000000000002 | -| Discover | 6011000000000012 | -| Visa | 4007000000027 | -| MasterCard | 5555555555554444 | -| JCB | 3088000000000017 | -| Diners Club/ Carte Blanche | 38000000000006 | -| Visa (Card Present Track 1) | %B4111111111111111^DOE/JOHN^1803101000000000020000831000000? | +### Testing Guide +For additional help in testing your own code, Authorize.Net maintains a [comprehensive testing guide](http://developer.authorize.net/hello_world/testing_guide/) that includes test credit card numbers to use and special triggers to generate certain responses from the sandbox environment. ## License - -This repository is destributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file. +This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file. \ No newline at end of file From a3f59e066d08058b473b9635ef8a919af7793405 Mon Sep 17 00:00:00 2001 From: adavidw Date: Wed, 5 Jul 2017 17:00:43 -0600 Subject: [PATCH 12/30] Revert "Update HttpUtility.cs" This reverts commit 160ad830aa08663bfc1a1cccd4ddd20baff1c668. --- Authorize.NET/Util/HttpUtility.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Authorize.NET/Util/HttpUtility.cs b/Authorize.NET/Util/HttpUtility.cs index 31c8d464..6003dc9e 100644 --- a/Authorize.NET/Util/HttpUtility.cs +++ b/Authorize.NET/Util/HttpUtility.cs @@ -66,7 +66,6 @@ public static ANetApiResponse PostData(AuthorizeNet.Environment env, TQ // Get the response String responseAsString = null; Logger.debug(string.Format("Retreiving Response from Url: '{0}'", postUrl)); - ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; using (var webResponse = webRequest.GetResponse()) { Logger.debug(string.Format("Received Response: '{0}'", webResponse)); From daf023491e7d333365629a227d913b31acdd3be2 Mon Sep 17 00:00:00 2001 From: adavidw Date: Thu, 6 Jul 2017 00:41:14 -0600 Subject: [PATCH 13/30] Revert "standardize readme format and info across repos" This reverts commit 39f59b988e3199349a668e0df24a1d0144fb7ee1. --- sample-code-csharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-code-csharp b/sample-code-csharp index 138f5e7b..40526f6e 160000 --- a/sample-code-csharp +++ b/sample-code-csharp @@ -1 +1 @@ -Subproject commit 138f5e7b86d9324a88e2cef7ce1fea9313072c33 +Subproject commit 40526f6e763825447ff934ac03eff464bd5dad8a From 4386c2b9576b18180db4ad95ed88223d698f0141 Mon Sep 17 00:00:00 2001 From: adavidw Date: Wed, 16 Aug 2017 11:41:07 -0600 Subject: [PATCH 14/30] reorder and add methods to match ICustomerGateway.cs --- Authorize.NET/CIM/ICustomerGateway.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Authorize.NET/CIM/ICustomerGateway.cs b/Authorize.NET/CIM/ICustomerGateway.cs index d396bf3f..60530ef1 100644 --- a/Authorize.NET/CIM/ICustomerGateway.cs +++ b/Authorize.NET/CIM/ICustomerGateway.cs @@ -11,25 +11,30 @@ public interface ICustomerGateway { string AddShippingAddress(string profileID, AuthorizeNet.Address address); string AddShippingAddress(string profileID, string first, string last, string street, string city, string state, string zip, string country, string phone); - IGatewayResponse AuthorizeAndCapture(string profileID, string paymentProfileID, decimal amount, decimal tax, decimal shipping); IGatewayResponse AuthorizeAndCapture(string profileID, string paymentProfileID, decimal amount); + IGatewayResponse AuthorizeAndCapture(string profileID, string paymentProfileID, decimal amount, decimal tax, decimal shipping); IGatewayResponse AuthorizeAndCapture(AuthorizeNet.Order order); - IGatewayResponse Authorize(string profileID, string paymentProfileID, decimal amount, decimal tax, decimal shipping); IGatewayResponse Authorize(string profileID, string paymentProfileID, decimal amount); + IGatewayResponse Authorize(string profileID, string paymentProfileID, decimal amount, decimal tax, decimal shipping); IGatewayResponse Authorize(AuthorizeNet.Order order); + IGatewayResponse Capture(string profileID, string paymentProfileId, string cardCode, decimal amount, string approvalCode); + IGatewayResponse PriorAuthCapture(string profileID, string paymentProfileId, string shippingProfileId, string transId, decimal amount); + IGatewayResponse PriorAuthCapture(string profileID, string paymentProfileId, string transId, decimal amount); + IGatewayResponse PriorAuthCapture(string transId, decimal amount); + [Obsolete("This method has been deprecated, instead use the overloaded method without the appoval code")] - IGatewayResponse Refund(string profileID, string paymentProfileId, string approvalCode,string transactionId, decimal amount); + IGatewayResponse Refund(string profileID, string paymentProfileId, string transactionId, string approvalCode, decimal amount); [Obsolete("This method has been deprecated, instead use the overloaded method without the appoval code")] IGatewayResponse Void(string profileID, string paymentProfileId, string approvalCode, string transactionId); - IGatewayResponse Refund(string profileID, string paymentProfileId, string transactionId, decimal amount); IGatewayResponse Void(string profileID, string paymentProfileId, string transactionId); + AuthorizeNet.Customer CreateCustomer(string email, string description); bool DeleteCustomer(string profileID); bool DeletePaymentProfile(string profileID, string paymentProfileID); From 4632cbb5a635a381d42bc4356ad5554e5d1edcfa Mon Sep 17 00:00:00 2001 From: rahulrnitc Date: Wed, 23 Aug 2017 15:24:38 +0530 Subject: [PATCH 15/30] Update .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index c8626010..5ce50d31 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "sample-code-csharp"] path = sample-code-csharp - url = https://github.com/Authorizenet/sample-code-csharp.git + url = https://github.com/rahulrnitc/sample-code-csharp.git From 572206bd1e9e47fb7173313642ea9dc5e07c5c50 Mon Sep 17 00:00:00 2001 From: rahulrnitc Date: Wed, 23 Aug 2017 15:44:09 +0530 Subject: [PATCH 16/30] Update .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 5ce50d31..c8626010 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "sample-code-csharp"] path = sample-code-csharp - url = https://github.com/rahulrnitc/sample-code-csharp.git + url = https://github.com/Authorizenet/sample-code-csharp.git From 3eaf0885c45e8aa7115df42d0cd7a2293f07be6d Mon Sep 17 00:00:00 2001 From: rahulrnitc Date: Wed, 23 Aug 2017 17:25:52 +0530 Subject: [PATCH 17/30] .Net version upgraded to 4.5 TLS1.2 support added --- Authorize.NET/AuthorizeNET.csproj | 4 +- Authorize.NET/Util/HttpUtility.cs | 4 + AuthorizeNET.sln | 24 ++-- AuthorizeNETtest/App.config | 5 +- AuthorizeNETtest/AuthorizeNETtest.csproj | 11 +- .../Test References/AuthorizeNet.accessor | 2 - CoffeeShopWebApp/CoffeeShopWebApp.csproj | 29 +++-- CoffeeShopWebApp/Web.config | 112 ++++-------------- 8 files changed, 71 insertions(+), 120 deletions(-) delete mode 100644 AuthorizeNETtest/Test References/AuthorizeNet.accessor diff --git a/Authorize.NET/AuthorizeNET.csproj b/Authorize.NET/AuthorizeNET.csproj index e2967fb3..5455adf4 100644 --- a/Authorize.NET/AuthorizeNET.csproj +++ b/Authorize.NET/AuthorizeNET.csproj @@ -10,7 +10,7 @@ Properties AuthorizeNet AuthorizeNet - v3.5 + v4.5 512 @@ -30,6 +30,7 @@ 4 bin/Debug/AuthorizeNet.XML 0219,1591,1635 + false AnyCPU @@ -40,6 +41,7 @@ prompt 4 bin/Release/AuthorizeNet.XML + false diff --git a/Authorize.NET/Util/HttpUtility.cs b/Authorize.NET/Util/HttpUtility.cs index 6003dc9e..a3673de5 100644 --- a/Authorize.NET/Util/HttpUtility.cs +++ b/Authorize.NET/Util/HttpUtility.cs @@ -66,6 +66,10 @@ public static ANetApiResponse PostData(AuthorizeNet.Environment env, TQ // Get the response String responseAsString = null; Logger.debug(string.Format("Retreiving Response from Url: '{0}'", postUrl)); + + // Set Tls to Tls1.2 + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; + using (var webResponse = webRequest.GetResponse()) { Logger.debug(string.Format("Received Response: '{0}'", webResponse)); diff --git a/AuthorizeNET.sln b/AuthorizeNET.sln index a1c1a7b8..d23eb032 100644 --- a/AuthorizeNET.sln +++ b/AuthorizeNET.sln @@ -1,6 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNET", "Authorize.NET\AuthorizeNET.csproj", "{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNETtest", "AuthorizeNETtest\AuthorizeNETtest.csproj", "{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}" @@ -16,9 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Global - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = AuthorizeNET.vsmdi - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -29,22 +28,25 @@ Global {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.Build.0 = Release|Any CPU - {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU - {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU + {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.ActiveCfg = Release|Any CPU + {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.Build.0 = Release|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.Build.0 = Debug|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.ActiveCfg = Release|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.Build.0 = Release|Any CPU - {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU - {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU + {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.ActiveCfg = Release|Any CPU + {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.Build.0 = Release|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.Build.0 = Release|Any CPU - {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU - {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU + {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.ActiveCfg = Release|Any CPU + {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = AuthorizeNET.vsmdi + EndGlobalSection EndGlobal diff --git a/AuthorizeNETtest/App.config b/AuthorizeNETtest/App.config index ffbdeb5b..27eeb418 100644 --- a/AuthorizeNETtest/App.config +++ b/AuthorizeNETtest/App.config @@ -1,9 +1,12 @@ - + + + + diff --git a/AuthorizeNETtest/AuthorizeNETtest.csproj b/AuthorizeNETtest/AuthorizeNETtest.csproj index 23034dc1..0ca94f95 100644 --- a/AuthorizeNETtest/AuthorizeNETtest.csproj +++ b/AuthorizeNETtest/AuthorizeNETtest.csproj @@ -10,13 +10,14 @@ Properties AuthorizeNETtest AuthorizeNETtest - v4.0 + v4.5 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 3.5 + AnyCPU @@ -28,6 +29,7 @@ prompt 4 0219,1591,1635 + false AnyCPU @@ -37,6 +39,7 @@ TRACE prompt 4 + false @@ -132,9 +135,6 @@ AuthorizeNET - - - @@ -144,6 +144,9 @@ + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file From 5d6fb1a3bce214418d5e0a43908f0bb4bb09d2c8 Mon Sep 17 00:00:00 2001 From: rahulrnitc Date: Tue, 29 Aug 2017 11:15:31 +0530 Subject: [PATCH 18/30] Added AU controllers. --- Authorize.NET/Api/Controllers/getAUJobDetailsController.cs | 1 - Authorize.NET/Api/Controllers/getAUJobSummaryController.cs | 1 - Authorize.NET/AuthorizeNET.csproj | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Authorize.NET/Api/Controllers/getAUJobDetailsController.cs b/Authorize.NET/Api/Controllers/getAUJobDetailsController.cs index 69f67c73..19703b54 100644 --- a/Authorize.NET/Api/Controllers/getAUJobDetailsController.cs +++ b/Authorize.NET/Api/Controllers/getAUJobDetailsController.cs @@ -23,7 +23,6 @@ override protected void ValidateRequest() { protected override void BeforeExecute() { var request = GetApiRequest(); - RequestFactoryWithSpecified.getAUJobDetailsType(request); } } #pragma warning restore 1591 diff --git a/Authorize.NET/Api/Controllers/getAUJobSummaryController.cs b/Authorize.NET/Api/Controllers/getAUJobSummaryController.cs index a131c4a3..e1302c02 100644 --- a/Authorize.NET/Api/Controllers/getAUJobSummaryController.cs +++ b/Authorize.NET/Api/Controllers/getAUJobSummaryController.cs @@ -23,7 +23,6 @@ override protected void ValidateRequest() { protected override void BeforeExecute() { var request = GetApiRequest(); - RequestFactoryWithSpecified.getAUJobSummaryType(request); } } #pragma warning restore 1591 diff --git a/Authorize.NET/AuthorizeNET.csproj b/Authorize.NET/AuthorizeNET.csproj index 5455adf4..2b99145d 100644 --- a/Authorize.NET/AuthorizeNET.csproj +++ b/Authorize.NET/AuthorizeNET.csproj @@ -75,6 +75,8 @@ + + From 6b1eae07b34ca86ce5c614c7965ba36b7389f426 Mon Sep 17 00:00:00 2001 From: Sneha Date: Mon, 30 Oct 2017 10:00:00 +0530 Subject: [PATCH 19/30] Added field to getcustomerprofile and getcustomerpaymentprofile Field has been added in requestfactorywithspecified.cs --- .../Contracts/V1/AnetApiSchema.generated.cs | 108 ++++++++++++++++++ .../V1/RequestFactoryWithSpecified.cs | 4 + .../RequestFactoryWithSpecified.generated.org | 15 +++ .../Utility/AnetApiSchema.generated.cs | 99 ++++++++++++++++ 4 files changed, 226 insertions(+) diff --git a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs index 0fc44463..fc597b16 100644 --- a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs +++ b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs @@ -69,6 +69,13 @@ public partial class processorType : object, System.ComponentModel.INotifyProper /// public string name; + /// + public int id; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("cardType")] + public string[] cardTypes; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -152,6 +159,9 @@ public partial class creditCardMaskedType : object, System.ComponentModel.INotif /// public cardArt cardArt; + /// + public string issuerNumber; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -1444,6 +1454,15 @@ public partial class transactionDetailsType : object, System.ComponentModel.INot /// public customerProfileIdType profile; + /// + public extendedAmountType surcharge; + + /// + public string employeeId; + + /// + public extendedAmountType tip; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -2301,6 +2320,18 @@ public partial class transactionRequestType : object, System.ComponentModel.INot [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] public userField[] userFields; + /// + public extendedAmountType surcharge; + + /// + public string merchantDescriptor; + + /// + public subMerchantType subMerchant; + + /// + public extendedAmountType tip; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -2804,6 +2835,9 @@ public partial class transRetailInfoType : object, System.ComponentModel.INotify /// public string customerSignature; + /// + public string terminalNumber; + public transRetailInfoType() { this.marketType = "2"; } @@ -2842,6 +2876,57 @@ protected void RaisePropertyChanged(string propertyName) { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class subMerchantType : object, System.ComponentModel.INotifyPropertyChanged { + + /// + public string identifier; + + /// + public string doingBusinessAs; + + /// + public string paymentServiceProviderName; + + /// + public string paymentServiceFacilitator; + + /// + public string streetAddress; + + /// + public string phone; + + /// + public string email; + + /// + public string postalCode; + + /// + public string city; + + /// + public string regionCode; + + /// + public string countryCode; + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -4298,6 +4383,13 @@ public partial class getCustomerProfileRequest : ANetApiRequest { /// [System.Xml.Serialization.XmlIgnoreAttribute()] public bool unmaskExpirationDateSpecified; + + /// + public bool includeIssuerInfo; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool includeIssuerInfoSpecified; } /// @@ -4338,6 +4430,13 @@ public partial class getCustomerPaymentProfileRequest : ANetApiRequest { /// [System.Xml.Serialization.XmlIgnoreAttribute()] public bool unmaskExpirationDateSpecified; + + /// + public bool includeIssuerInfo; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool includeIssuerInfoSpecified; } /// @@ -5407,6 +5506,12 @@ public enum settingNameEnum { /// hostedPaymentStyleOptions, + + /// + typeEmailReceipt, + + /// + hostedProfilePaymentOptions, } /// @@ -5774,6 +5879,9 @@ public partial class getMerchantDetailsResponse : ANetApiResponse { /// [System.Xml.Serialization.XmlArrayItemAttribute("currency")] public string[] currencies; + + /// + public string publicClientKey; } /// diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index d80c402c..5140658a 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -1017,6 +1017,8 @@ public static void getCustomerProfileRequest(getCustomerProfileRequest argument) if (null != argument) { if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;} + if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;} + } } public static void getCustomerProfileResponse(getCustomerProfileResponse argument) @@ -1030,6 +1032,8 @@ public static void getCustomerPaymentProfileRequest(getCustomerPaymentProfileReq { if (null != argument) { + if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;} + } } public static void getCustomerPaymentProfileResponse(getCustomerPaymentProfileResponse argument) diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org index 6d958c45..cc471311 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org @@ -36,6 +36,7 @@ namespace AuthorizeNet.Api.Contracts.V1 { if(null != argument) { + [System.Xml.Serialization.XmlArrayItemAttribute("cardType")] } } public static void auDetailsType(auDetailsType argument) @@ -301,6 +302,8 @@ namespace AuthorizeNet.Api.Contracts.V1 solutionType(argument.solution); if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} } customerProfileIdType(argument.profile); + extendedAmountType(argument.surcharge); + extendedAmountType(argument.tip); } } public static void subscriptionPaymentType(subscriptionPaymentType argument) @@ -504,6 +507,9 @@ namespace AuthorizeNet.Api.Contracts.V1 transRetailInfoType(argument.retail); if(null != argument.transactionSettings){ foreach( var value in argument.transactionSettings) { settingType(value);} } if(null != argument.userFields){ foreach( var value in argument.userFields) { userField(value);} } + extendedAmountType(argument.surcharge); + subMerchantType(argument.subMerchant); + extendedAmountType(argument.tip); } } public static void paymentType(paymentType argument) @@ -637,6 +643,12 @@ transRetailInfoType() { { } } + public static void subMerchantType(subMerchantType argument) + { + if(null != argument) + { + } + } public static void mobileDeviceType(mobileDeviceType argument) { if(null != argument) @@ -1042,6 +1054,7 @@ transRetailInfoType() { if(null != argument) { if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;} + if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;} } } public static void getCustomerProfileResponse(getCustomerProfileResponse argument) @@ -1056,6 +1069,7 @@ transRetailInfoType() { if(null != argument) { if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;} + if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;} } } public static void getCustomerPaymentProfileResponse(getCustomerPaymentProfileResponse argument) @@ -1412,6 +1426,7 @@ transRetailInfoType() { { customerProfileSummaryType(argument.customerProfileSummaryType); paymentSimpleType(argument.paymentSimpleType); + typeEmailReceipt, } } public static void getCustomerPaymentProfileListRequest(getCustomerPaymentProfileListRequest argument) diff --git a/Authorize.NET/Utility/AnetApiSchema.generated.cs b/Authorize.NET/Utility/AnetApiSchema.generated.cs index a590b326..cb54a432 100644 --- a/Authorize.NET/Utility/AnetApiSchema.generated.cs +++ b/Authorize.NET/Utility/AnetApiSchema.generated.cs @@ -59,6 +59,13 @@ public partial class processorType { /// public string name; + + /// + public int id; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("cardType")] + public string[] cardTypes; } /// @@ -124,6 +131,9 @@ public partial class creditCardMaskedType { /// public cardArt cardArt; + + /// + public string issuerNumber; } /// @@ -1155,6 +1165,15 @@ public partial class transactionDetailsType { /// public customerProfileIdType profile; + + /// + public extendedAmountType surcharge; + + /// + public string employeeId; + + /// + public extendedAmountType tip; } /// @@ -1859,6 +1878,18 @@ public partial class transactionRequestType { /// [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] public userField[] userFields; + + /// + public extendedAmountType surcharge; + + /// + public string merchantDescriptor; + + /// + public subMerchantType subMerchant; + + /// + public extendedAmountType tip; } /// @@ -2219,6 +2250,9 @@ public partial class transRetailInfoType { /// public string customerSignature; + /// + public string terminalNumber; + public transRetailInfoType() { this.marketType = "2"; } @@ -2239,6 +2273,48 @@ public partial class settingType { public string settingValue; } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class subMerchantType { + + /// + public string identifier; + + /// + public string doingBusinessAs; + + /// + public string paymentServiceProviderName; + + /// + public string paymentServiceFacilitator; + + /// + public string streetAddress; + + /// + public string phone; + + /// + public string email; + + /// + public string postalCode; + + /// + public string city; + + /// + public string regionCode; + + /// + public string countryCode; + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -3470,6 +3546,13 @@ public partial class getCustomerProfileRequest : ANetApiRequest { /// [System.Xml.Serialization.XmlIgnoreAttribute()] public bool unmaskExpirationDateSpecified; + + /// + public bool includeIssuerInfo; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool includeIssuerInfoSpecified; } /// @@ -3510,6 +3593,13 @@ public partial class getCustomerPaymentProfileRequest : ANetApiRequest { /// [System.Xml.Serialization.XmlIgnoreAttribute()] public bool unmaskExpirationDateSpecified; + + /// + public bool includeIssuerInfo; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool includeIssuerInfoSpecified; } /// @@ -4570,6 +4660,12 @@ public enum settingNameEnum { /// hostedPaymentStyleOptions, + + /// + typeEmailReceipt, + + /// + hostedProfilePaymentOptions, } /// @@ -4937,6 +5033,9 @@ public partial class getMerchantDetailsResponse : ANetApiResponse { /// [System.Xml.Serialization.XmlArrayItemAttribute("currency")] public string[] currencies; + + /// + public string publicClientKey; } /// From b2378ab977b1591673bb873b2ff12d4d304d2917 Mon Sep 17 00:00:00 2001 From: Aaron Wright Date: Wed, 8 Nov 2017 09:37:43 -0700 Subject: [PATCH 20/30] Readme fixes (#193) * minor text fixes * fix travis link * change VS reference to 2008 or later --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 64c3beb7..13b7c462 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Authorize.Net .Net SDK +# Authorize.Net .NET SDK -[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-dotnet/master.svg)](https://travis-ci.org/AuthorizeNet/sdk-dotnet) +[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-dotnet.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-dotnet) [![Code Climate](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet/badges/gpa.svg)](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet) [![NuGet](https://badge.fury.io/nu/authorizenet.svg)](https://www.nuget.org/packages/authorizenet) ## Requirements * .NET 3.5 or later -* Microsoft® Visual Studio 2008 or 2010 +* Microsoft® Visual Studio 2008 or later * Nunit 2.6.3; * An Authorize.Net account (see _Registration & Configuration_ section below) @@ -79,4 +79,4 @@ For additional help in testing your own code, Authorize.Net maintains a [compreh ## License -This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file. \ No newline at end of file +This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file. \ No newline at end of file From f04291ee33741a0d59ec2c7995d2f639a2a54ad0 Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 10 Nov 2017 12:10:02 +0530 Subject: [PATCH 21/30] added 2 new controllers and modified requestfactorywithspecified.cs --- .../V1/RequestFactoryWithSpecified.cs | 13 ++++ .../securePaymentContainerController.cs | 30 ++++++++ .../transactionResponseEmvController.cs | 30 ++++++++ .../securePaymentContainerControllerTest.cs | 71 +++++++++++++++++++ .../transactionResponseEmvControllerTest.cs | 71 +++++++++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 Authorize.NET/Api/Controllers/securePaymentContainerController.cs create mode 100644 Authorize.NET/Api/Controllers/transactionResponseEmvController.cs create mode 100644 AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs create mode 100644 AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index 5140658a..f3cc98a8 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -35,6 +35,7 @@ public static void processorType(processorType argument) { if(null != argument) { + [System.Xml.Serialization.XmlArrayItemAttribute("cardType")] } } @@ -216,6 +217,12 @@ public static void settingType(settingType argument) if (null != argument) { } + } + public static void subMerchantType(subMerchantType argument) + { + if(null != argument) + { + } } public static void emailSettingsType(emailSettingsType argument) { @@ -280,6 +287,9 @@ public static void transactionRequestType(transactionRequestType argument) transRetailInfoType(argument.retail); if (null != argument.transactionSettings) { foreach (var value in argument.transactionSettings) { settingType(value); } } if (null != argument.userFields) { foreach (var value in argument.userFields) { userField(value); } } + extendedAmountType(argument.surcharge); + subMerchantType(argument.subMerchant); + extendedAmountType(argument.tip); } } public static void paymentType(paymentType argument) @@ -520,6 +530,8 @@ public static void transactionDetailsType(transactionDetailsType argument) if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} } customerProfileIdType(argument.profile); + extendedAmountType(argument.surcharge); + extendedAmountType(argument.tip); } } public static void paymentMaskedType(paymentMaskedType argument) @@ -1424,6 +1436,7 @@ public static void EnumCollection(EnumCollection argument) { customerProfileSummaryType(argument.customerProfileSummaryType); paymentSimpleType(argument.paymentSimpleType); + typeEmailReceipt, } } diff --git a/Authorize.NET/Api/Controllers/securePaymentContainerController.cs b/Authorize.NET/Api/Controllers/securePaymentContainerController.cs new file mode 100644 index 00000000..cb65f151 --- /dev/null +++ b/Authorize.NET/Api/Controllers/securePaymentContainerController.cs @@ -0,0 +1,30 @@ +namespace AuthorizeNet.Api.Controllers +{ + using System; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers.Bases; + +#pragma warning disable 1591 + public class securePaymentContainerController : ApiOperationBase { + + public securePaymentContainerController(securePaymentContainerRequest apiRequest) : base(apiRequest) { + } + + override protected void ValidateRequest() { + var request = GetApiRequest(); + + //validate required fields + //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); + //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); + + //validate not-required fields + } + + protected override void BeforeExecute() + { + var request = GetApiRequest(); + RequestFactoryWithSpecified.securePaymentContainerType(request); + } + } +#pragma warning restore 1591 +} \ No newline at end of file diff --git a/Authorize.NET/Api/Controllers/transactionResponseEmvController.cs b/Authorize.NET/Api/Controllers/transactionResponseEmvController.cs new file mode 100644 index 00000000..eced293f --- /dev/null +++ b/Authorize.NET/Api/Controllers/transactionResponseEmvController.cs @@ -0,0 +1,30 @@ +namespace AuthorizeNet.Api.Controllers +{ + using System; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers.Bases; + +#pragma warning disable 1591 + public class transactionResponseEmvController : ApiOperationBase { + + public transactionResponseEmvController(transactionResponseEmvRequest apiRequest) : base(apiRequest) { + } + + override protected void ValidateRequest() { + var request = GetApiRequest(); + + //validate required fields + //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); + //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); + + //validate not-required fields + } + + protected override void BeforeExecute() + { + var request = GetApiRequest(); + RequestFactoryWithSpecified.transactionResponseEmvType(request); + } + } +#pragma warning restore 1591 +} \ No newline at end of file diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs new file mode 100644 index 00000000..da7cbb46 --- /dev/null +++ b/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs @@ -0,0 +1,71 @@ +namespace AuthorizeNet.Api.Controllers.MockTest +{ + using System; + using System.Collections.Generic; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers; + using AuthorizeNet.Api.Controllers.Test; + using AuthorizeNet.Util; + using NUnit.Framework; + + [TestFixture] + public class securePaymentContainerTest : ApiCoreTestBase + { + + [TestFixtureSetUp] + public new static void SetUpBeforeClass() + { + ApiCoreTestBase.SetUpBeforeClass(); + } + + [TestFixtureTearDown] + public new static void TearDownAfterClass() + { + ApiCoreTestBase.TearDownAfterClass(); + } + + [SetUp] + public new void SetUp() + { + base.SetUp(); + } + + [TearDown] + public new void TearDown() + { + base.TearDown(); + } + + [Test] + public void MocksecurePaymentContainerTest() + { + //define all mocked objects as final + var mockController = GetMockController(); + var mockRequest = new securePaymentContainerRequest + { + merchantAuthentication = new merchantAuthenticationType() {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, + }; + var mockResponse = new securePaymentContainerResponse + { + refId = "1234", + sessionToken = "sessiontoken", + Yyyyy = Yyyy, + }; + + var errorResponse = new ANetApiResponse(); + var results = new List(); + const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; + + SetMockControllerExpectations( + 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.Yyyyy); + LogHelper.info(Logger, "securePaymentContainer: Details:{0}", controllerResponse.Yyyyy); + } + } +} diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs new file mode 100644 index 00000000..c9693641 --- /dev/null +++ b/AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs @@ -0,0 +1,71 @@ +namespace AuthorizeNet.Api.Controllers.MockTest +{ + using System; + using System.Collections.Generic; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers; + using AuthorizeNet.Api.Controllers.Test; + using AuthorizeNet.Util; + using NUnit.Framework; + + [TestFixture] + public class transactionResponseEmvTest : ApiCoreTestBase + { + + [TestFixtureSetUp] + public new static void SetUpBeforeClass() + { + ApiCoreTestBase.SetUpBeforeClass(); + } + + [TestFixtureTearDown] + public new static void TearDownAfterClass() + { + ApiCoreTestBase.TearDownAfterClass(); + } + + [SetUp] + public new void SetUp() + { + base.SetUp(); + } + + [TearDown] + public new void TearDown() + { + base.TearDown(); + } + + [Test] + public void MocktransactionResponseEmvTest() + { + //define all mocked objects as final + var mockController = GetMockController(); + var mockRequest = new transactionResponseEmvRequest + { + merchantAuthentication = new merchantAuthenticationType() {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, + }; + var mockResponse = new transactionResponseEmvResponse + { + refId = "1234", + sessionToken = "sessiontoken", + Yyyyy = Yyyy, + }; + + var errorResponse = new ANetApiResponse(); + var results = new List(); + const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; + + SetMockControllerExpectations( + 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.Yyyyy); + LogHelper.info(Logger, "transactionResponseEmv: Details:{0}", controllerResponse.Yyyyy); + } + } +} From e0af0cc69a9c80929fb4e982c65a061a951572f7 Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 10 Nov 2017 13:02:35 +0530 Subject: [PATCH 22/30] typeEmailReceipt, removed --- Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index f3cc98a8..19f7ed75 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -1436,8 +1436,7 @@ public static void EnumCollection(EnumCollection argument) { customerProfileSummaryType(argument.customerProfileSummaryType); paymentSimpleType(argument.paymentSimpleType); - typeEmailReceipt, - } + } } public static void auDetailsType(auDetailsType argument) From 78bfc33e5d6ca602c2ce90305766629b5ebfd232 Mon Sep 17 00:00:00 2001 From: sunnyrajrathod Date: Mon, 13 Nov 2017 12:18:47 +0530 Subject: [PATCH 23/30] - Fixing build error. --- .../V1/RequestFactoryWithSpecified.cs | 1 - AuthorizeNET.sln | 24 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index 19f7ed75..8ebe65cb 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -35,7 +35,6 @@ public static void processorType(processorType argument) { if(null != argument) { - [System.Xml.Serialization.XmlArrayItemAttribute("cardType")] } } diff --git a/AuthorizeNET.sln b/AuthorizeNET.sln index a1c1a7b8..d23eb032 100644 --- a/AuthorizeNET.sln +++ b/AuthorizeNET.sln @@ -1,6 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNET", "Authorize.NET\AuthorizeNET.csproj", "{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNETtest", "AuthorizeNETtest\AuthorizeNETtest.csproj", "{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}" @@ -16,9 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Global - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = AuthorizeNET.vsmdi - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -29,22 +28,25 @@ Global {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.Build.0 = Release|Any CPU - {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU - {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU + {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.ActiveCfg = Release|Any CPU + {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.Build.0 = Release|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.Build.0 = Debug|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.ActiveCfg = Release|Any CPU {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.Build.0 = Release|Any CPU - {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU - {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU + {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.ActiveCfg = Release|Any CPU + {CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.Build.0 = Release|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.Build.0 = Release|Any CPU - {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU - {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU + {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.ActiveCfg = Release|Any CPU + {79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = AuthorizeNET.vsmdi + EndGlobalSection EndGlobal From 6dd5a979973aa771aa2d047f60edefb267f4b954 Mon Sep 17 00:00:00 2001 From: Sneha Date: Tue, 14 Nov 2017 12:16:19 +0530 Subject: [PATCH 24/30] added securePaymentContainerController.cs and all related methods to requestFactorywithspecified and allgeneratedenumtest.cs --- .../V1/RequestFactoryWithSpecified.cs | 34 +++++++++++++++++++ .../securePaymentContainerController.cs | 2 +- Authorize.NET/AuthorizeNET.csproj | 1 + .../Controllers/Test/AllGeneratedEnumTest.cs | 10 +++++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index 8ebe65cb..59e6e772 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -774,6 +774,12 @@ public static void customerProfileType(customerProfileType argument) if (null != argument.paymentProfiles) { foreach (var value in argument.paymentProfiles) { customerPaymentProfileType(value); } } if (null != argument.shipToList) { foreach (var value in argument.shipToList) { customerAddressType(value); } } } + } + public static void securePaymentContainerErrorType(securePaymentContainerErrorType argument) + { + if(null != argument) + { + } } public static void customerType(customerType argument) { @@ -850,6 +856,7 @@ public static void impersonationAuthenticationType(impersonationAuthenticationTy { } } + public static void merchantAuthenticationType(merchantAuthenticationType argument) { if (null != argument) @@ -884,6 +891,33 @@ public static void ANetApiResponse(ANetApiResponse argument) { messagesType(argument.messages); } + } + public static void securePaymentContainerRequest(securePaymentContainerRequest argument) + { + if(null != argument) + { + webCheckOutDataType(argument.data); + } + } + public static void securePaymentContainerResponse(securePaymentContainerResponse argument) + { + if(null != argument) + { + opaqueDataType(argument.opaqueData); + } + } + public static void webCheckOutDataType(webCheckOutDataType argument) + { + if (null != argument) + { + webCheckOutDataTypeToken(argument.token); + } + } + public static void webCheckOutDataTypeToken(webCheckOutDataTypeToken argument) + { + if (null != argument) + { + } } public static void isAliveRequest(isAliveRequest argument) { diff --git a/Authorize.NET/Api/Controllers/securePaymentContainerController.cs b/Authorize.NET/Api/Controllers/securePaymentContainerController.cs index cb65f151..72e1c66a 100644 --- a/Authorize.NET/Api/Controllers/securePaymentContainerController.cs +++ b/Authorize.NET/Api/Controllers/securePaymentContainerController.cs @@ -23,7 +23,7 @@ override protected void ValidateRequest() { protected override void BeforeExecute() { var request = GetApiRequest(); - RequestFactoryWithSpecified.securePaymentContainerType(request); + RequestFactoryWithSpecified.securePaymentContainerRequest(request); } } #pragma warning restore 1591 diff --git a/Authorize.NET/AuthorizeNET.csproj b/Authorize.NET/AuthorizeNET.csproj index e2967fb3..c3f99444 100644 --- a/Authorize.NET/AuthorizeNET.csproj +++ b/Authorize.NET/AuthorizeNET.csproj @@ -91,6 +91,7 @@ + diff --git a/AuthorizeNETtest/Api/Controllers/Test/AllGeneratedEnumTest.cs b/AuthorizeNETtest/Api/Controllers/Test/AllGeneratedEnumTest.cs index 47eeede2..196102a2 100644 --- a/AuthorizeNETtest/Api/Controllers/Test/AllGeneratedEnumTest.cs +++ b/AuthorizeNETtest/Api/Controllers/Test/AllGeneratedEnumTest.cs @@ -165,6 +165,13 @@ public void AllEnumTest() Assert.AreEqual(anEnum, enumFromValue); } + foreach (var anEnum in Enum.GetValues(typeof(webCheckOutTypeEnum))) + { + var aValue = anEnum.ToString(); + webCheckOutTypeEnum enumFromValue; + Assert.IsTrue(Enum.TryParse(aValue, out enumFromValue)); + Assert.AreEqual(anEnum, enumFromValue); + } foreach (var anEnum in Enum.GetValues(typeof(ItemChoiceType))) { var aValue = anEnum.ToString(); @@ -306,4 +313,5 @@ public void AllEnumTest() } */ } -} +} + From e8fee29560075490289ef33e150d6260c9947ec3 Mon Sep 17 00:00:00 2001 From: sunnyrajrathod Date: Tue, 14 Nov 2017 13:56:07 +0530 Subject: [PATCH 25/30] - Adding mocktest to test proj. --- .../MockTest/securePaymentContainerControllerTest.cs | 4 ---- AuthorizeNETtest/AuthorizeNETtest.csproj | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs index da7cbb46..591c594a 100644 --- a/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs +++ b/AuthorizeNETtest/Api/Controllers/MockTest/securePaymentContainerControllerTest.cs @@ -49,7 +49,6 @@ public void MocksecurePaymentContainerTest() { refId = "1234", sessionToken = "sessiontoken", - Yyyyy = Yyyy, }; var errorResponse = new ANetApiResponse(); @@ -63,9 +62,6 @@ public void MocksecurePaymentContainerTest() // or var controllerResponse = mockController.MockObject.ExecuteWithApiResponse(AuthorizeNet.Environment.CUSTOM); var controllerResponse = mockController.MockObject.GetApiResponse(); Assert.IsNotNull(controllerResponse); - - Assert.IsNotNull(controllerResponse.Yyyyy); - LogHelper.info(Logger, "securePaymentContainer: Details:{0}", controllerResponse.Yyyyy); } } } diff --git a/AuthorizeNETtest/AuthorizeNETtest.csproj b/AuthorizeNETtest/AuthorizeNETtest.csproj index 23034dc1..23478163 100644 --- a/AuthorizeNETtest/AuthorizeNETtest.csproj +++ b/AuthorizeNETtest/AuthorizeNETtest.csproj @@ -78,6 +78,7 @@ + From 4ba1f25c2e2f0c7495a1ce953d230a99fd9de720 Mon Sep 17 00:00:00 2001 From: Sneha Date: Wed, 15 Nov 2017 12:26:09 +0530 Subject: [PATCH 26/30] added merchant details controller and all relavant files --- .../Contracts/V1/AnetApiSchema.generated.cs | 137 ++++++++++++++---- .../V1/RequestFactoryWithSpecified.cs | 14 +- .../RequestFactoryWithSpecified.generated.org | 30 +++- .../updateMerchantDetailsController.cs | 30 ++++ Authorize.NET/AuthorizeNET.csproj | 1 + .../Utility/AnetApiSchema.generated.cs | 116 ++++++++++++--- .../updateMerchantDetailsControllerTest.cs | 71 +++++++++ 7 files changed, 349 insertions(+), 50 deletions(-) create mode 100644 Authorize.NET/Api/Controllers/updateMerchantDetailsController.cs create mode 100644 AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs diff --git a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs index fc597b16..88286df6 100644 --- a/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs +++ b/Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs @@ -3243,6 +3243,10 @@ public partial class ARBSubscriptionMaskedType : object, System.ComponentModel.I /// public orderType order; + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] + public arbTransaction[] arbTransactions; + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { @@ -3333,6 +3337,51 @@ public enum ARBSubscriptionUnitEnum { months, } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class arbTransaction : object, System.ComponentModel.INotifyPropertyChanged { + + /// + public string transId; + + /// + public string response; + + /// + public System.DateTime submitTimeUTC; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool submitTimeUTCSpecified; + + /// + public int payNum; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool payNumSpecified; + + /// + public int attemptNum; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool attemptNumSpecified; + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -3676,16 +3725,22 @@ protected void RaisePropertyChanged(string propertyName) { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public partial class webCheckOutDataType : object, System.ComponentModel.INotifyPropertyChanged { + public partial class webCheckOutDataTypeToken : object, System.ComponentModel.INotifyPropertyChanged { /// - public webCheckOutTypeEnum type; + public string cardNumber; /// - public string id; + public string expirationDate; /// - public webCheckOutDataTypeToken token; + public string cardCode; + + /// + public string zip; + + /// + public string fullName; public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; @@ -3697,41 +3752,25 @@ protected void RaisePropertyChanged(string propertyName) { } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public enum webCheckOutTypeEnum { - - /// - PAN, - - /// - TOKEN, - } - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public partial class webCheckOutDataTypeToken : object, System.ComponentModel.INotifyPropertyChanged { - - /// - public string cardNumber; + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class webCheckOutDataType : object, System.ComponentModel.INotifyPropertyChanged { /// - public string expirationDate; + public webCheckOutTypeEnum type; /// - public string cardCode; + public string id; /// - public string zip; + public webCheckOutDataTypeToken token; /// - public string fullName; + public bankAccountType bankToken; public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; @@ -3743,6 +3782,19 @@ protected void RaisePropertyChanged(string propertyName) { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public enum webCheckOutTypeEnum { + + /// + PAN, + + /// + TOKEN, + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -5512,6 +5564,9 @@ public enum settingNameEnum { /// hostedProfilePaymentOptions, + + /// + hostedProfileSaveButtonText, } /// @@ -5703,6 +5758,13 @@ public partial class ARBGetSubscriptionRequest : ANetApiRequest { /// public string subscriptionId; + + /// + public bool includeTransactions; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool includeTransactionsSpecified; } /// @@ -5926,4 +5988,27 @@ public enum paymentMethodsTypeEnum { /// AndroidPay, } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + [System.Xml.Serialization.XmlRootAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable=false)] + public partial class updateMerchantDetailsRequest : ANetApiRequest { + + /// + public bool isTestMode; + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + [System.Xml.Serialization.XmlRootAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable=false)] + public partial class updateMerchantDetailsResponse : ANetApiResponse { + } } diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs index 59e6e772..30e4b704 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs @@ -1565,7 +1565,19 @@ public static void getTransactionListForCustomerRequest(getTransactionListForCus Paging(argument.paging); } } - } + public static void updateMerchantDetailsRequest(updateMerchantDetailsRequest argument) + { + if (null != argument) + { + } + } + public static void updateMerchantDetailsResponse(updateMerchantDetailsResponse argument) + { + if (null != argument) + { + } + } + } // ReSharper restore InconsistentNaming diff --git a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org index cc471311..a1ad4c41 100644 --- a/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org +++ b/Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org @@ -747,6 +747,7 @@ transRetailInfoType() { if(argument.status) { argument.statusSpecified=true;} subscriptionCustomerProfileType(argument.profile); orderType(argument.order); + if(null != argument.arbTransactions){ foreach( var value in argument.arbTransactions) { arbTransaction(value);} } } } public static void paymentScheduleType(paymentScheduleType argument) @@ -765,6 +766,15 @@ transRetailInfoType() { { } } + public static void arbTransaction(arbTransaction argument) + { + if(null != argument) + { + if(argument.submitTimeUTC) { argument.submitTimeUTCSpecified=true;} + if(argument.payNum) { argument.payNumSpecified=true;} + if(argument.attemptNum) { argument.attemptNumSpecified=true;} + } + } public static void securePaymentContainerErrorType(securePaymentContainerErrorType argument) { if(null != argument) @@ -844,17 +854,18 @@ transRetailInfoType() { customerProfileIdType(argument.profile); } } - public static void webCheckOutDataType(webCheckOutDataType argument) + public static void webCheckOutDataTypeToken(webCheckOutDataTypeToken argument) { if(null != argument) { - webCheckOutDataTypeToken(argument.token); } } - public static void webCheckOutDataTypeToken(webCheckOutDataTypeToken argument) + public static void webCheckOutDataType(webCheckOutDataType argument) { if(null != argument) { + webCheckOutDataTypeToken(argument.token); + bankAccountType(argument.bankToken); } } public static void paymentDetails(paymentDetails argument) @@ -1448,6 +1459,7 @@ transRetailInfoType() { { if(null != argument) { + if(argument.includeTransactions) { argument.includeTransactionsSpecified=true;} } } public static void ARBGetSubscriptionResponse(ARBGetSubscriptionResponse argument) @@ -1512,6 +1524,18 @@ transRetailInfoType() { System.Nullable< } } + public static void updateMerchantDetailsRequest(updateMerchantDetailsRequest argument) + { + if(null != argument) + { + } + } + public static void updateMerchantDetailsResponse(updateMerchantDetailsResponse argument) + { + if(null != argument) + { + } + } } // ReSharper restore InconsistentNaming #pragma warning restore 1591 diff --git a/Authorize.NET/Api/Controllers/updateMerchantDetailsController.cs b/Authorize.NET/Api/Controllers/updateMerchantDetailsController.cs new file mode 100644 index 00000000..364919e0 --- /dev/null +++ b/Authorize.NET/Api/Controllers/updateMerchantDetailsController.cs @@ -0,0 +1,30 @@ +namespace AuthorizeNet.Api.Controllers +{ + using System; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers.Bases; + +#pragma warning disable 1591 + public class updateMerchantDetailsController : ApiOperationBase { + + public updateMerchantDetailsController(updateMerchantDetailsRequest apiRequest) : base(apiRequest) { + } + + override protected void ValidateRequest() { + var request = GetApiRequest(); + + //validate required fields + //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); + //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); + + //validate not-required fields + } + + protected override void BeforeExecute() + { + var request = GetApiRequest(); + RequestFactoryWithSpecified.updateMerchantDetailsRequest(request); + } + } +#pragma warning restore 1591 +} \ No newline at end of file diff --git a/Authorize.NET/AuthorizeNET.csproj b/Authorize.NET/AuthorizeNET.csproj index c3f99444..c1b05d61 100644 --- a/Authorize.NET/AuthorizeNET.csproj +++ b/Authorize.NET/AuthorizeNET.csproj @@ -98,6 +98,7 @@ + diff --git a/Authorize.NET/Utility/AnetApiSchema.generated.cs b/Authorize.NET/Utility/AnetApiSchema.generated.cs index cb54a432..b761ed23 100644 --- a/Authorize.NET/Utility/AnetApiSchema.generated.cs +++ b/Authorize.NET/Utility/AnetApiSchema.generated.cs @@ -2594,6 +2594,10 @@ public partial class ARBSubscriptionMaskedType { /// public orderType order; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] + public arbTransaction[] arbTransactions; } /// @@ -2658,6 +2662,42 @@ public enum ARBSubscriptionUnitEnum { months, } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class arbTransaction { + + /// + public string transId; + + /// + public string response; + + /// + public System.DateTime submitTimeUTC; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool submitTimeUTCSpecified; + + /// + public int payNum; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool payNumSpecified; + + /// + public int attemptNum; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool attemptNumSpecified; + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] @@ -2920,29 +2960,22 @@ public partial class ARBSubscriptionType { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public partial class webCheckOutDataType { + public partial class webCheckOutDataTypeToken { /// - public webCheckOutTypeEnum type; + public string cardNumber; /// - public string id; + public string expirationDate; /// - public webCheckOutDataTypeToken token; - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] - [System.SerializableAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public enum webCheckOutTypeEnum { + public string cardCode; /// - PAN, + public string zip; /// - TOKEN, + public string fullName; } /// @@ -2950,23 +2983,33 @@ public enum webCheckOutTypeEnum { [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] - public partial class webCheckOutDataTypeToken { + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public partial class webCheckOutDataType { /// - public string cardNumber; + public webCheckOutTypeEnum type; /// - public string expirationDate; + public string id; /// - public string cardCode; + public webCheckOutDataTypeToken token; /// - public string zip; + public bankAccountType bankToken; + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + public enum webCheckOutTypeEnum { /// - public string fullName; + PAN, + + /// + TOKEN, } /// @@ -4666,6 +4709,9 @@ public enum settingNameEnum { /// hostedProfilePaymentOptions, + + /// + hostedProfileSaveButtonText, } /// @@ -4857,6 +4903,13 @@ public partial class ARBGetSubscriptionRequest : ANetApiRequest { /// public string subscriptionId; + + /// + public bool includeTransactions; + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool includeTransactionsSpecified; } /// @@ -5080,4 +5133,27 @@ public enum paymentMethodsTypeEnum { /// AndroidPay, } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + [System.Xml.Serialization.XmlRootAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable=false)] + public partial class updateMerchantDetailsRequest : ANetApiRequest { + + /// + public bool isTestMode; + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd")] + [System.Xml.Serialization.XmlRootAttribute(Namespace="AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable=false)] + public partial class updateMerchantDetailsResponse : ANetApiResponse { + } } diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs new file mode 100644 index 00000000..6818baa2 --- /dev/null +++ b/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs @@ -0,0 +1,71 @@ +namespace AuthorizeNet.Api.Controllers.MockTest +{ + using System; + using System.Collections.Generic; + using AuthorizeNet.Api.Contracts.V1; + using AuthorizeNet.Api.Controllers; + using AuthorizeNet.Api.Controllers.Test; + using AuthorizeNet.Util; + using NUnit.Framework; + + [TestFixture] + public class updateMerchantDetailsTest : ApiCoreTestBase + { + + [TestFixtureSetUp] + public new static void SetUpBeforeClass() + { + ApiCoreTestBase.SetUpBeforeClass(); + } + + [TestFixtureTearDown] + public new static void TearDownAfterClass() + { + ApiCoreTestBase.TearDownAfterClass(); + } + + [SetUp] + public new void SetUp() + { + base.SetUp(); + } + + [TearDown] + public new void TearDown() + { + base.TearDown(); + } + + [Test] + public void MockupdateMerchantDetailsTest() + { + //define all mocked objects as final + var mockController = GetMockController(); + var mockRequest = new updateMerchantDetailsRequest + { + merchantAuthentication = new merchantAuthenticationType() {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, + }; + var mockResponse = new updateMerchantDetailsResponse + { + refId = "1234", + sessionToken = "sessiontoken", + Yyyyy = Yyyy, + }; + + var errorResponse = new ANetApiResponse(); + var results = new List(); + const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; + + SetMockControllerExpectations( + 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.Yyyyy); + LogHelper.info(Logger, "updateMerchantDetails: Details:{0}", controllerResponse.Yyyyy); + } + } +} From ebd6b5f23871b571c30b68089c07cd190a4b94cd Mon Sep 17 00:00:00 2001 From: Sneha Date: Wed, 15 Nov 2017 14:52:01 +0530 Subject: [PATCH 27/30] added update merchantdetails container to test csproj --- .../MockTest/updateMerchantDetailsControllerTest.cs | 4 +--- AuthorizeNETtest/AuthorizeNETtest.csproj | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs index 6818baa2..7a87ce67 100644 --- a/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs +++ b/AuthorizeNETtest/Api/Controllers/MockTest/updateMerchantDetailsControllerTest.cs @@ -49,7 +49,6 @@ public void MockupdateMerchantDetailsTest() { refId = "1234", sessionToken = "sessiontoken", - Yyyyy = Yyyy, }; var errorResponse = new ANetApiResponse(); @@ -64,8 +63,7 @@ public void MockupdateMerchantDetailsTest() var controllerResponse = mockController.MockObject.GetApiResponse(); Assert.IsNotNull(controllerResponse); - Assert.IsNotNull(controllerResponse.Yyyyy); - LogHelper.info(Logger, "updateMerchantDetails: Details:{0}", controllerResponse.Yyyyy); + } } } diff --git a/AuthorizeNETtest/AuthorizeNETtest.csproj b/AuthorizeNETtest/AuthorizeNETtest.csproj index 23478163..df96d135 100644 --- a/AuthorizeNETtest/AuthorizeNETtest.csproj +++ b/AuthorizeNETtest/AuthorizeNETtest.csproj @@ -80,6 +80,7 @@ + From ff3852d3b808452ffa9ec68e11ea4b88710ab091 Mon Sep 17 00:00:00 2001 From: Sneha Date: Wed, 15 Nov 2017 14:59:52 +0530 Subject: [PATCH 28/30] deleted the controllers transactionresponseemv and its test --- .../transactionResponseEmvController.cs | 30 -------- .../transactionResponseEmvControllerTest.cs | 71 ------------------- 2 files changed, 101 deletions(-) delete mode 100644 Authorize.NET/Api/Controllers/transactionResponseEmvController.cs delete mode 100644 AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs diff --git a/Authorize.NET/Api/Controllers/transactionResponseEmvController.cs b/Authorize.NET/Api/Controllers/transactionResponseEmvController.cs deleted file mode 100644 index eced293f..00000000 --- a/Authorize.NET/Api/Controllers/transactionResponseEmvController.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace AuthorizeNet.Api.Controllers -{ - using System; - using AuthorizeNet.Api.Contracts.V1; - using AuthorizeNet.Api.Controllers.Bases; - -#pragma warning disable 1591 - public class transactionResponseEmvController : ApiOperationBase { - - public transactionResponseEmvController(transactionResponseEmvRequest apiRequest) : base(apiRequest) { - } - - override protected void ValidateRequest() { - var request = GetApiRequest(); - - //validate required fields - //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); - //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); - - //validate not-required fields - } - - protected override void BeforeExecute() - { - var request = GetApiRequest(); - RequestFactoryWithSpecified.transactionResponseEmvType(request); - } - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs b/AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs deleted file mode 100644 index c9693641..00000000 --- a/AuthorizeNETtest/Api/Controllers/MockTest/transactionResponseEmvControllerTest.cs +++ /dev/null @@ -1,71 +0,0 @@ -namespace AuthorizeNet.Api.Controllers.MockTest -{ - using System; - using System.Collections.Generic; - using AuthorizeNet.Api.Contracts.V1; - using AuthorizeNet.Api.Controllers; - using AuthorizeNet.Api.Controllers.Test; - using AuthorizeNet.Util; - using NUnit.Framework; - - [TestFixture] - public class transactionResponseEmvTest : ApiCoreTestBase - { - - [TestFixtureSetUp] - public new static void SetUpBeforeClass() - { - ApiCoreTestBase.SetUpBeforeClass(); - } - - [TestFixtureTearDown] - public new static void TearDownAfterClass() - { - ApiCoreTestBase.TearDownAfterClass(); - } - - [SetUp] - public new void SetUp() - { - base.SetUp(); - } - - [TearDown] - public new void TearDown() - { - base.TearDown(); - } - - [Test] - public void MocktransactionResponseEmvTest() - { - //define all mocked objects as final - var mockController = GetMockController(); - var mockRequest = new transactionResponseEmvRequest - { - merchantAuthentication = new merchantAuthenticationType() {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, - }; - var mockResponse = new transactionResponseEmvResponse - { - refId = "1234", - sessionToken = "sessiontoken", - Yyyyy = Yyyy, - }; - - var errorResponse = new ANetApiResponse(); - var results = new List(); - const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; - - SetMockControllerExpectations( - 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.Yyyyy); - LogHelper.info(Logger, "transactionResponseEmv: Details:{0}", controllerResponse.Yyyyy); - } - } -} From d93f94365ec900baabe43b39eafed1f080914d3c Mon Sep 17 00:00:00 2001 From: Sunny Raj Rathod Date: Fri, 17 Nov 2017 10:52:02 +0530 Subject: [PATCH 29/30] Update AuthorizeNet.nuspec --- AuthorizeNet.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AuthorizeNet.nuspec b/AuthorizeNet.nuspec index df632ee8..227f7f01 100644 --- a/AuthorizeNet.nuspec +++ b/AuthorizeNet.nuspec @@ -2,7 +2,7 @@ AuthorizeNet - 1.9.3 + 1.9.4 AuthorizeNet Authorize.Net AuthorizeNet From e67f9b5cef7a0a39580a0b39e0926f6580918591 Mon Sep 17 00:00:00 2001 From: Sunny Raj Rathod Date: Fri, 17 Nov 2017 10:52:21 +0530 Subject: [PATCH 30/30] Update Constants.cs --- Authorize.NET/Util/Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Authorize.NET/Util/Constants.cs b/Authorize.NET/Util/Constants.cs index 6286bea8..0daf447e 100644 --- a/Authorize.NET/Util/Constants.cs +++ b/Authorize.NET/Util/Constants.cs @@ -26,7 +26,7 @@ public static class Constants { public const int HttpConnectionDefaultTimeout = 30000; public const int HttpReadWriteDefaultTimeout = 30000; - public const string SDKVersion = "1.9.3"; + public const string SDKVersion = "1.9.4"; } #pragma warning restore 1591