├── .gitattributes ├── .gitignore ├── .travis.yml ├── AuthorizeNET ├── AuthorizeNET │ ├── Api │ │ ├── Contracts │ │ │ └── V1 │ │ │ │ ├── AnetApiSchema.generated.cs │ │ │ │ ├── RequestFactoryWithSpecified.cs │ │ │ │ └── RequestFactoryWithSpecified.generated.org │ │ ├── ControllerTemplate.cst │ │ └── Controllers │ │ │ ├── ARBCancelSubscriptionController.cs │ │ │ ├── ARBCreateSubscriptionController.cs │ │ │ ├── ARBGetSubscriptionController.cs │ │ │ ├── ARBGetSubscriptionListController.cs │ │ │ ├── ARBGetSubscriptionStatusController.cs │ │ │ ├── ARBUpdateSubscriptionController.cs │ │ │ ├── Bases │ │ │ ├── ApiOperationBase.cs │ │ │ ├── ErrorResponse.cs │ │ │ └── IApiOperation.cs │ │ │ ├── authenticateTestController.cs │ │ │ ├── createCustomerPaymentProfileController.cs │ │ │ ├── createCustomerProfileController.cs │ │ │ ├── createCustomerProfileFromTransactionController.cs │ │ │ ├── createCustomerProfileTransactionController.cs │ │ │ ├── createCustomerShippingAddressController.cs │ │ │ ├── createFingerPrintController.cs │ │ │ ├── createProfileController.cs │ │ │ ├── createTransactionController.cs │ │ │ ├── decryptPaymentDataController.cs │ │ │ ├── deleteCustomerPaymentProfileController.cs │ │ │ ├── deleteCustomerProfileController.cs │ │ │ ├── deleteCustomerShippingAddressController.cs │ │ │ ├── getAUJobDetailsController.cs │ │ │ ├── getAUJobSummaryController.cs │ │ │ ├── getBatchStatisticsController.cs │ │ │ ├── getCustomerPaymentProfileController.cs │ │ │ ├── getCustomerPaymentProfileListController.cs │ │ │ ├── getCustomerPaymentProfileNonceController.cs │ │ │ ├── getCustomerProfileController.cs │ │ │ ├── getCustomerProfileIdsController.cs │ │ │ ├── getCustomerShippingAddressController.cs │ │ │ ├── getHostedPaymentPageController.cs │ │ │ ├── getHostedProfilePageController.cs │ │ │ ├── getMerchantDetailsController.cs │ │ │ ├── getSettledBatchListController.cs │ │ │ ├── getTransactionDetailsController.cs │ │ │ ├── getTransactionListController.cs │ │ │ ├── getTransactionListForCustomerController.cs │ │ │ ├── getUnsettledTransactionListController.cs │ │ │ ├── isAliveController.cs │ │ │ ├── logoutController.cs │ │ │ ├── mobileDeviceLoginController.cs │ │ │ ├── mobileDeviceRegistrationController.cs │ │ │ ├── securePaymentContainerController.cs │ │ │ ├── sendCustomerTransactionReceiptController.cs │ │ │ ├── transactionController.cs │ │ │ ├── updateCustomerPaymentProfileController.cs │ │ │ ├── updateCustomerProfileController.cs │ │ │ ├── updateCustomerShippingAddressController.cs │ │ │ ├── updateHeldTransactionController.cs │ │ │ ├── updateMerchantDetailsController.cs │ │ │ ├── updateSplitTenderGroupController.cs │ │ │ └── validateCustomerPaymentProfileController.cs │ ├── App.cs │ ├── AuthorizeNET.csproj │ ├── Environment.cs │ └── Utilities │ │ ├── Constants.cs │ │ ├── Crypto.cs │ │ ├── CryptoRandom.cs │ │ ├── HttpUtility.cs │ │ ├── LogFactory.cs │ │ └── XmlUtility.cs └── AuthorizeNet.Core.sln ├── AuthorizeNetDotNetCore.nuspec ├── LICENSE ├── README.md └── ReleaseArtifact ├── AuthorizeNET.dll └── AuthorizeNET.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: 2 | csharp 3 | dist: trusty 4 | mono: latest 5 | dotnet: 2.0.0 6 | 7 | os: 8 | - linux 9 | - osx 10 | 11 | before_script: 12 | - git submodule update --remote --recursive 13 | - dotnet restore ./AuthorizeNET/AuthorizeNET.csproj 14 | - dotnet restore ./sample-code-csharp/SampleCode_DotNet_Core.csproj 15 | - dotnet restore ./sample-code-csharp/SampleCodeTest/SampleCodeTest_DotNet_Core.csproj 16 | 17 | 18 | script: 19 | - dotnet build ./AuthorizeNET/AuthorizeNET.csproj 20 | - dotnet build ./sample-code-csharp/SampleCode_DotNet_Core.csproj 21 | - dotnet build ./sample-code-csharp/SampleCodeTest/SampleCodeTest_DotNet_Core.csproj 22 | - dotnet test ./sample-code-csharp/SampleCodeTest/SampleCodeTest_DotNet_Core.csproj -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Contracts.V1 2 | { 3 | using System; 4 | #pragma warning disable 169 5 | #pragma warning disable 1591 6 | // ReSharper disable InconsistentNaming 7 | /// 8 | /// Special case handlers 9 | /// 10 | /// validated on ????/??/?? for objects listed at the end 11 | /// should be validated after each update of AnetApiSchema.cs 12 | /// for fields/properties that are minOccurs="0" since xsd.exe 13 | /// generates "specified" property for such fields and requires 14 | /// special handling to set them seamlessly 15 | /// Make sure to update the respective controllers to call the respective request hand 16 | /// 17 | /// 18 | public static class RequestFactoryWithSpecified 19 | { 20 | } 21 | } 22 | public static void decryptPaymentDataRequest(decryptPaymentDataRequest argument) 23 | { 24 | if(null != argument) 25 | { 26 | opaqueDataType(argument.opaqueData); 27 | } 28 | } 29 | public static void opaqueDataType(opaqueDataType argument) 30 | { 31 | if(null != argument) 32 | { 33 | if(argument.expirationTimeStamp) { argument.expirationTimeStampSpecified=true;} 34 | } 35 | } 36 | public static void processorType(processorType argument) 37 | { 38 | if(null != argument) 39 | { 40 | [System.Xml.Serialization.XmlArrayItemAttribute("cardType")] 41 | } 42 | } 43 | public static void auDetailsType(auDetailsType argument) 44 | { 45 | if(null != argument) 46 | { 47 | long(argument.customerProfileID); 48 | long(argument.customerPaymentProfileID); 49 | } 50 | } 51 | public static void auDeleteType(auDeleteType argument) 52 | { 53 | if(null != argument) 54 | { 55 | auDetailsType (argument); 56 | creditCardMaskedType(argument.creditCard); 57 | } 58 | } 59 | public static void creditCardMaskedType(creditCardMaskedType argument) 60 | { 61 | if(null != argument) 62 | { 63 | cardArt(argument.cardArt); 64 | if(argument.isPaymentToken) { argument.isPaymentTokenSpecified=true;} 65 | } 66 | } 67 | public static void cardArt(cardArt argument) 68 | { 69 | if(null != argument) 70 | { 71 | } 72 | } 73 | public static void auUpdateType(auUpdateType argument) 74 | { 75 | if(null != argument) 76 | { 77 | auDetailsType (argument); 78 | creditCardMaskedType(argument.newCreditCard); 79 | creditCardMaskedType(argument.oldCreditCard); 80 | } 81 | } 82 | public static void auResponseType(auResponseType argument) 83 | { 84 | if(null != argument) 85 | { 86 | long(argument.profileCount); 87 | } 88 | } 89 | public static void customerPaymentProfileListItemType(customerPaymentProfileListItemType argument) 90 | { 91 | if(null != argument) 92 | { 93 | if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;} 94 | customerAddressType(argument.billTo); 95 | paymentMaskedType(argument.payment); 96 | } 97 | } 98 | public static void customerAddressType(customerAddressType argument) 99 | { 100 | if(null != argument) 101 | { 102 | nameAndAddressType (argument); 103 | } 104 | } 105 | public static void nameAndAddressType(nameAndAddressType argument) 106 | { 107 | if(null != argument) 108 | { 109 | } 110 | } 111 | public static void customerAddressExType(customerAddressExType argument) 112 | { 113 | if(null != argument) 114 | { 115 | customerAddressType (argument); 116 | } 117 | } 118 | public static void paymentMaskedType(paymentMaskedType argument) 119 | { 120 | if(null != argument) 121 | { 122 | bankAccountMaskedType(argument); 123 | creditCardMaskedType(argument); 124 | tokenMaskedType(argument); 125 | } 126 | } 127 | public static void bankAccountMaskedType(bankAccountMaskedType argument) 128 | { 129 | if(null != argument) 130 | { 131 | if(argument.accountType) { argument.accountTypeSpecified=true;} 132 | if(argument.echeckType) { argument.echeckTypeSpecified=true;} 133 | } 134 | } 135 | public static void tokenMaskedType(tokenMaskedType argument) 136 | { 137 | if(null != argument) 138 | { 139 | } 140 | } 141 | public static void CustomerPaymentProfileSorting(CustomerPaymentProfileSorting argument) 142 | { 143 | if(null != argument) 144 | { 145 | (argument.orderDescending); 146 | } 147 | } 148 | public static void customerProfileSummaryType(customerProfileSummaryType argument) 149 | { 150 | if(null != argument) 151 | { 152 | } 153 | } 154 | public static void SubscriptionDetail(SubscriptionDetail argument) 155 | { 156 | if(null != argument) 157 | { 158 | if(argument.customerShippingProfileId) { argument.customerShippingProfileIdSpecified=true;} 159 | } 160 | } 161 | public static void ARBGetSubscriptionListSorting(ARBGetSubscriptionListSorting argument) 162 | { 163 | if(null != argument) 164 | { 165 | (argument.orderDescending); 166 | } 167 | } 168 | public static void Paging(Paging argument) 169 | { 170 | if(null != argument) 171 | { 172 | } 173 | } 174 | public static void TransactionListSorting(TransactionListSorting argument) 175 | { 176 | if(null != argument) 177 | { 178 | (argument.orderDescending); 179 | } 180 | } 181 | public static void heldTransactionRequestType(heldTransactionRequestType argument) 182 | { 183 | if(null != argument) 184 | { 185 | } 186 | } 187 | public static void createProfileResponse(createProfileResponse argument) 188 | { 189 | if(null != argument) 190 | { 191 | messagesType(argument.messages); 192 | } 193 | } 194 | public static void messagesType(messagesType argument) 195 | { 196 | if(null != argument) 197 | { 198 | if(null != argument.message){ foreach( var value in argument.message) { messagesTypeMessage(value);} } 199 | } 200 | } 201 | public static void messagesTypeMessage(messagesTypeMessage argument) 202 | { 203 | if(null != argument) 204 | { 205 | } 206 | } 207 | public static void transactionResponse(transactionResponse argument) 208 | { 209 | if(null != argument) 210 | { 211 | transactionResponsePrePaidCard(argument.prePaidCard); 212 | if(null != argument.messages){ foreach( var value in argument.messages) { transactionResponseMessage(value);} } 213 | if(null != argument.errors){ foreach( var value in argument.errors) { transactionResponseError(value);} } 214 | if(null != argument.splitTenderPayments){ foreach( var value in argument.splitTenderPayments) { transactionResponseSplitTenderPayment(value);} } 215 | if(null != argument.userFields){ foreach( var value in argument.userFields) { userField(value);} } 216 | nameAndAddressType(argument.shipTo); 217 | transactionResponseSecureAcceptance(argument.secureAcceptance); 218 | transactionResponseEmvResponse(argument.emvResponse); 219 | customerProfileIdType(argument.profile); 220 | } 221 | } 222 | public static void transactionResponsePrePaidCard(transactionResponsePrePaidCard argument) 223 | { 224 | if(null != argument) 225 | { 226 | } 227 | } 228 | public static void transactionResponseMessage(transactionResponseMessage argument) 229 | { 230 | if(null != argument) 231 | { 232 | } 233 | } 234 | public static void transactionResponseError(transactionResponseError argument) 235 | { 236 | if(null != argument) 237 | { 238 | } 239 | } 240 | public static void transactionResponseSplitTenderPayment(transactionResponseSplitTenderPayment argument) 241 | { 242 | if(null != argument) 243 | { 244 | } 245 | } 246 | public static void userField(userField argument) 247 | { 248 | if(null != argument) 249 | { 250 | } 251 | } 252 | public static void transactionResponseSecureAcceptance(transactionResponseSecureAcceptance argument) 253 | { 254 | if(null != argument) 255 | { 256 | } 257 | } 258 | public static void transactionResponseEmvResponse(transactionResponseEmvResponse argument) 259 | { 260 | if(null != argument) 261 | { 262 | if(null != argument.tags){ foreach( var value in argument.tags) { emvTag(value);} } 263 | } 264 | } 265 | public static void emvTag(emvTag argument) 266 | { 267 | if(null != argument) 268 | { 269 | } 270 | } 271 | public static void customerProfileIdType(customerProfileIdType argument) 272 | { 273 | if(null != argument) 274 | { 275 | } 276 | } 277 | public static void returnedItemType(returnedItemType argument) 278 | { 279 | if(null != argument) 280 | { 281 | } 282 | } 283 | public static void transactionDetailsType(transactionDetailsType argument) 284 | { 285 | if(null != argument) 286 | { 287 | subscriptionPaymentType(argument.subscription); 288 | if(null != argument.FDSFilters){ foreach( var value in argument.FDSFilters) { FDSFilterType(value);} } 289 | batchDetailsType(argument.batch); 290 | orderExType(argument.order); 291 | if(argument.requestedAmount) { argument.requestedAmountSpecified=true;} 292 | extendedAmountType(argument.tax); 293 | extendedAmountType(argument.shipping); 294 | extendedAmountType(argument.duty); 295 | if(null != argument.lineItems){ foreach( var value in argument.lineItems) { lineItemType(value);} } 296 | if(argument.prepaidBalanceRemaining) { argument.prepaidBalanceRemainingSpecified=true;} 297 | if(argument.taxExempt) { argument.taxExemptSpecified=true;} 298 | paymentMaskedType(argument.payment); 299 | customerDataType(argument.customer); 300 | customerAddressType(argument.billTo); 301 | nameAndAddressType(argument.shipTo); 302 | if(argument.recurringBilling) { argument.recurringBillingSpecified=true;} 303 | if(null != argument.returnedItems){ foreach( var value in argument.returnedItems) { returnedItemType(value);} } 304 | solutionType(argument.solution); 305 | if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} } 306 | customerProfileIdType(argument.profile); 307 | extendedAmountType(argument.surcharge); 308 | extendedAmountType(argument.tip); 309 | otherTaxType(argument.otherTax); 310 | nameAndAddressType(argument.shipFrom); 311 | } 312 | } 313 | public static void subscriptionPaymentType(subscriptionPaymentType argument) 314 | { 315 | if(null != argument) 316 | { 317 | } 318 | } 319 | public static void FDSFilterType(FDSFilterType argument) 320 | { 321 | if(null != argument) 322 | { 323 | } 324 | } 325 | public static void batchDetailsType(batchDetailsType argument) 326 | { 327 | if(null != argument) 328 | { 329 | if(argument.settlementTimeUTC) { argument.settlementTimeUTCSpecified=true;} 330 | if(argument.settlementTimeLocal) { argument.settlementTimeLocalSpecified=true;} 331 | if(null != argument.statistics){ foreach( var value in argument.statistics) { batchStatisticType(value);} } 332 | } 333 | } 334 | public static void batchStatisticType(batchStatisticType argument) 335 | { 336 | if(null != argument) 337 | { 338 | if(argument.returnedItemAmount) { argument.returnedItemAmountSpecified=true;} 339 | if(argument.returnedItemCount) { argument.returnedItemCountSpecified=true;} 340 | if(argument.chargebackAmount) { argument.chargebackAmountSpecified=true;} 341 | if(argument.chargebackCount) { argument.chargebackCountSpecified=true;} 342 | if(argument.correctionNoticeCount) { argument.correctionNoticeCountSpecified=true;} 343 | if(argument.chargeChargeBackAmount) { argument.chargeChargeBackAmountSpecified=true;} 344 | if(argument.chargeChargeBackCount) { argument.chargeChargeBackCountSpecified=true;} 345 | if(argument.refundChargeBackAmount) { argument.refundChargeBackAmountSpecified=true;} 346 | if(argument.refundChargeBackCount) { argument.refundChargeBackCountSpecified=true;} 347 | if(argument.chargeReturnedItemsAmount) { argument.chargeReturnedItemsAmountSpecified=true;} 348 | if(argument.chargeReturnedItemsCount) { argument.chargeReturnedItemsCountSpecified=true;} 349 | if(argument.refundReturnedItemsAmount) { argument.refundReturnedItemsAmountSpecified=true;} 350 | if(argument.refundReturnedItemsCount) { argument.refundReturnedItemsCountSpecified=true;} 351 | } 352 | } 353 | public static void orderExType(orderExType argument) 354 | { 355 | if(null != argument) 356 | { 357 | orderType (argument); 358 | } 359 | } 360 | public static void orderType(orderType argument) 361 | { 362 | if(null != argument) 363 | { 364 | if(argument.discountAmount) { argument.discountAmountSpecified=true;} 365 | if(argument.taxIsAfterDiscount) { argument.taxIsAfterDiscountSpecified=true;} 366 | if(argument.purchaseOrderDateUTC) { argument.purchaseOrderDateUTCSpecified=true;} 367 | } 368 | } 369 | public static void extendedAmountType(extendedAmountType argument) 370 | { 371 | if(null != argument) 372 | { 373 | } 374 | } 375 | public static void lineItemType(lineItemType argument) 376 | { 377 | if(null != argument) 378 | { 379 | if(argument.taxable) { argument.taxableSpecified=true;} 380 | if(argument.taxRate) { argument.taxRateSpecified=true;} 381 | if(argument.taxAmount) { argument.taxAmountSpecified=true;} 382 | if(argument.nationalTax) { argument.nationalTaxSpecified=true;} 383 | if(argument.localTax) { argument.localTaxSpecified=true;} 384 | if(argument.vatRate) { argument.vatRateSpecified=true;} 385 | if(argument.alternateTaxRate) { argument.alternateTaxRateSpecified=true;} 386 | if(argument.alternateTaxAmount) { argument.alternateTaxAmountSpecified=true;} 387 | if(argument.totalAmount) { argument.totalAmountSpecified=true;} 388 | if(argument.discountRate) { argument.discountRateSpecified=true;} 389 | if(argument.discountAmount) { argument.discountAmountSpecified=true;} 390 | if(argument.taxIncludedInTotal) { argument.taxIncludedInTotalSpecified=true;} 391 | if(argument.taxIsAfterDiscount) { argument.taxIsAfterDiscountSpecified=true;} 392 | } 393 | } 394 | public static void customerDataType(customerDataType argument) 395 | { 396 | if(null != argument) 397 | { 398 | if(argument.type) { argument.typeSpecified=true;} 399 | driversLicenseType(argument.driversLicense); 400 | } 401 | } 402 | public static void driversLicenseType(driversLicenseType argument) 403 | { 404 | if(null != argument) 405 | { 406 | } 407 | } 408 | public static void solutionType(solutionType argument) 409 | { 410 | if(null != argument) 411 | { 412 | } 413 | } 414 | public static void transactionDetailsTypeTag(transactionDetailsTypeTag argument) 415 | { 416 | if(null != argument) 417 | { 418 | } 419 | } 420 | public static void otherTaxType(otherTaxType argument) 421 | { 422 | if(null != argument) 423 | { 424 | if(argument.nationalTaxAmount) { argument.nationalTaxAmountSpecified=true;} 425 | if(argument.localTaxAmount) { argument.localTaxAmountSpecified=true;} 426 | if(argument.alternateTaxAmount) { argument.alternateTaxAmountSpecified=true;} 427 | if(argument.vatTaxRate) { argument.vatTaxRateSpecified=true;} 428 | if(argument.vatTaxAmount) { argument.vatTaxAmountSpecified=true;} 429 | } 430 | } 431 | public static void profileTransactionType(profileTransactionType argument) 432 | { 433 | if(null != argument) 434 | { 435 | profileTransAuthCaptureType(argument); 436 | profileTransAuthOnlyType(argument); 437 | profileTransCaptureOnlyType(argument); 438 | profileTransPriorAuthCaptureType(argument); 439 | profileTransRefundType(argument); 440 | profileTransVoidType(argument); 441 | } 442 | } 443 | public static void profileTransAuthCaptureType(profileTransAuthCaptureType argument) 444 | { 445 | if(null != argument) 446 | { 447 | profileTransOrderType (argument); 448 | } 449 | } 450 | public static void profileTransOrderType(profileTransOrderType argument) 451 | { 452 | if(null != argument) 453 | { 454 | profileTransAmountType (argument); 455 | orderExType(argument.order); 456 | if(argument.taxExempt) { argument.taxExemptSpecified=true;} 457 | if(argument.recurringBilling) { argument.recurringBillingSpecified=true;} 458 | processingOptions(argument.processingOptions); 459 | subsequentAuthInformation(argument.subsequentAuthInformation); 460 | } 461 | } 462 | public static void processingOptions(processingOptions argument) 463 | { 464 | if(null != argument) 465 | { 466 | if(argument.isFirstRecurringPayment) { argument.isFirstRecurringPaymentSpecified=true;} 467 | if(argument.isFirstSubsequentAuth) { argument.isFirstSubsequentAuthSpecified=true;} 468 | if(argument.isSubsequentAuth) { argument.isSubsequentAuthSpecified=true;} 469 | if(argument.isStoredCredentials) { argument.isStoredCredentialsSpecified=true;} 470 | } 471 | } 472 | public static void subsequentAuthInformation(subsequentAuthInformation argument) 473 | { 474 | if(null != argument) 475 | { 476 | if(argument.reason) { argument.reasonSpecified=true;} 477 | } 478 | } 479 | public static void profileTransAmountType(profileTransAmountType argument) 480 | { 481 | if(null != argument) 482 | { 483 | extendedAmountType(argument.tax); 484 | extendedAmountType(argument.shipping); 485 | extendedAmountType(argument.duty); 486 | if(null != argument.lineItems){ foreach( var value in argument.lineItems) { lineItemType(value);} } 487 | } 488 | } 489 | public static void profileTransRefundType(profileTransRefundType argument) 490 | { 491 | if(null != argument) 492 | { 493 | profileTransAmountType (argument); 494 | orderExType(argument.order); 495 | } 496 | } 497 | public static void profileTransPriorAuthCaptureType(profileTransPriorAuthCaptureType argument) 498 | { 499 | if(null != argument) 500 | { 501 | profileTransAmountType (argument); 502 | } 503 | } 504 | public static void profileTransCaptureOnlyType(profileTransCaptureOnlyType argument) 505 | { 506 | if(null != argument) 507 | { 508 | profileTransOrderType (argument); 509 | } 510 | } 511 | public static void profileTransAuthOnlyType(profileTransAuthOnlyType argument) 512 | { 513 | if(null != argument) 514 | { 515 | profileTransOrderType (argument); 516 | } 517 | } 518 | public static void profileTransVoidType(profileTransVoidType argument) 519 | { 520 | if(null != argument) 521 | { 522 | } 523 | } 524 | public static void paymentProfile(paymentProfile argument) 525 | { 526 | if(null != argument) 527 | { 528 | } 529 | } 530 | public static void customerProfilePaymentType(customerProfilePaymentType argument) 531 | { 532 | if(null != argument) 533 | { 534 | if(argument.createProfile) { argument.createProfileSpecified=true;} 535 | paymentProfile(argument.paymentProfile); 536 | } 537 | } 538 | public static void transactionRequestType(transactionRequestType argument) 539 | { 540 | if(null != argument) 541 | { 542 | if(argument.amount) { argument.amountSpecified=true;} 543 | paymentType(argument.payment); 544 | customerProfilePaymentType(argument.profile); 545 | solutionType(argument.solution); 546 | orderType(argument.order); 547 | if(null != argument.lineItems){ foreach( var value in argument.lineItems) { lineItemType(value);} } 548 | extendedAmountType(argument.tax); 549 | extendedAmountType(argument.duty); 550 | extendedAmountType(argument.shipping); 551 | if(argument.taxExempt) { argument.taxExemptSpecified=true;} 552 | customerDataType(argument.customer); 553 | customerAddressType(argument.billTo); 554 | nameAndAddressType(argument.shipTo); 555 | ccAuthenticationType(argument.cardholderAuthentication); 556 | transRetailInfoType(argument.retail); 557 | if(null != argument.transactionSettings){ foreach( var value in argument.transactionSettings) { settingType(value);} } 558 | if(null != argument.userFields){ foreach( var value in argument.userFields) { userField(value);} } 559 | extendedAmountType(argument.surcharge); 560 | subMerchantType(argument.subMerchant); 561 | extendedAmountType(argument.tip); 562 | processingOptions(argument.processingOptions); 563 | subsequentAuthInformation(argument.subsequentAuthInformation); 564 | otherTaxType(argument.otherTax); 565 | nameAndAddressType(argument.shipFrom); 566 | } 567 | } 568 | public static void paymentType(paymentType argument) 569 | { 570 | if(null != argument) 571 | { 572 | bankAccountType(argument); 573 | creditCardType(argument); 574 | paymentEmvType(argument); 575 | encryptedTrackDataType(argument); 576 | opaqueDataType(argument); 577 | payPalType(argument); 578 | creditCardTrackType(argument); 579 | } 580 | } 581 | public static void bankAccountType(bankAccountType argument) 582 | { 583 | if(null != argument) 584 | { 585 | if(argument.accountType) { argument.accountTypeSpecified=true;} 586 | if(argument.echeckType) { argument.echeckTypeSpecified=true;} 587 | } 588 | } 589 | public static void creditCardType(creditCardType argument) 590 | { 591 | if(null != argument) 592 | { 593 | creditCardSimpleType (argument); 594 | if(argument.isPaymentToken) { argument.isPaymentTokenSpecified=true;} 595 | } 596 | } 597 | public static void creditCardSimpleType(creditCardSimpleType argument) 598 | { 599 | if(null != argument) 600 | { 601 | } 602 | } 603 | public static void paymentEmvType(paymentEmvType argument) 604 | { 605 | if(null != argument) 606 | { 607 | } 608 | } 609 | public static void encryptedTrackDataType(encryptedTrackDataType argument) 610 | { 611 | if(null != argument) 612 | { 613 | KeyBlock(argument.FormOfPayment); 614 | } 615 | } 616 | public static void KeyBlock(KeyBlock argument) 617 | { 618 | if(null != argument) 619 | { 620 | KeyValue(argument.Value); 621 | } 622 | } 623 | public static void KeyValue(KeyValue argument) 624 | { 625 | if(null != argument) 626 | { 627 | EncodingType(argument.Encoding); 628 | EncryptionAlgorithmType(argument.EncryptionAlgorithm); 629 | KeyManagementScheme(argument.Scheme); 630 | } 631 | } 632 | public static void KeyManagementScheme(KeyManagementScheme argument) 633 | { 634 | if(null != argument) 635 | { 636 | KeyManagementSchemeDUKPT(argument.DUKPT); 637 | } 638 | } 639 | public static void KeyManagementSchemeDUKPT(KeyManagementSchemeDUKPT argument) 640 | { 641 | if(null != argument) 642 | { 643 | OperationType(argument.Operation); 644 | KeyManagementSchemeDUKPTMode(argument.Mode); 645 | KeyManagementSchemeDUKPTDeviceInfo(argument.DeviceInfo); 646 | KeyManagementSchemeDUKPTEncryptedData(argument.EncryptedData); 647 | } 648 | } 649 | public static void KeyManagementSchemeDUKPTMode(KeyManagementSchemeDUKPTMode argument) 650 | { 651 | if(null != argument) 652 | { 653 | } 654 | } 655 | public static void KeyManagementSchemeDUKPTDeviceInfo(KeyManagementSchemeDUKPTDeviceInfo argument) 656 | { 657 | if(null != argument) 658 | { 659 | } 660 | } 661 | public static void KeyManagementSchemeDUKPTEncryptedData(KeyManagementSchemeDUKPTEncryptedData argument) 662 | { 663 | if(null != argument) 664 | { 665 | } 666 | } 667 | public static void payPalType(payPalType argument) 668 | { 669 | if(null != argument) 670 | { 671 | } 672 | } 673 | public static void creditCardTrackType(creditCardTrackType argument) 674 | { 675 | if(null != argument) 676 | { 677 | } 678 | } 679 | public static void ccAuthenticationType(ccAuthenticationType argument) 680 | { 681 | if(null != argument) 682 | { 683 | } 684 | } 685 | public static void transRetailInfoType(transRetailInfoType argument) 686 | { 687 | if(null != argument) 688 | { 689 | transRetailInfoType() { 690 | this.marketType = "2"; 691 | } 692 | } 693 | public static void settingType(settingType argument) 694 | { 695 | if(null != argument) 696 | { 697 | } 698 | } 699 | public static void subMerchantType(subMerchantType argument) 700 | { 701 | if(null != argument) 702 | { 703 | } 704 | } 705 | public static void mobileDeviceType(mobileDeviceType argument) 706 | { 707 | if(null != argument) 708 | { 709 | if(argument.deviceActivation) { argument.deviceActivationSpecified=true;} 710 | } 711 | } 712 | public static void customerPaymentProfileBaseType(customerPaymentProfileBaseType argument) 713 | { 714 | if(null != argument) 715 | { 716 | if(argument.customerType) { argument.customerTypeSpecified=true;} 717 | customerAddressType(argument.billTo); 718 | } 719 | } 720 | public static void customerPaymentProfileMaskedType(customerPaymentProfileMaskedType argument) 721 | { 722 | if(null != argument) 723 | { 724 | customerPaymentProfileBaseType (argument); 725 | if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;} 726 | paymentMaskedType(argument.payment); 727 | driversLicenseMaskedType(argument.driversLicense); 728 | } 729 | } 730 | public static void driversLicenseMaskedType(driversLicenseMaskedType argument) 731 | { 732 | if(null != argument) 733 | { 734 | } 735 | } 736 | public static void customerPaymentProfileType(customerPaymentProfileType argument) 737 | { 738 | if(null != argument) 739 | { 740 | customerPaymentProfileBaseType (argument); 741 | paymentType(argument.payment); 742 | driversLicenseType(argument.driversLicense); 743 | if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;} 744 | } 745 | } 746 | public static void customerPaymentProfileExType(customerPaymentProfileExType argument) 747 | { 748 | if(null != argument) 749 | { 750 | customerPaymentProfileType (argument); 751 | } 752 | } 753 | public static void customerProfileBaseType(customerProfileBaseType argument) 754 | { 755 | if(null != argument) 756 | { 757 | } 758 | } 759 | public static void customerProfileExType(customerProfileExType argument) 760 | { 761 | if(null != argument) 762 | { 763 | customerProfileBaseType (argument); 764 | } 765 | } 766 | public static void customerProfileMaskedType(customerProfileMaskedType argument) 767 | { 768 | if(null != argument) 769 | { 770 | customerProfileExType (argument); 771 | if(null != argument.paymentProfiles){ foreach( var value in argument.paymentProfiles) { customerPaymentProfileMaskedType(value);} } 772 | if(null != argument.shipToList){ foreach( var value in argument.shipToList) { customerAddressExType(value);} } 773 | if(argument.profileType) { argument.profileTypeSpecified=true;} 774 | } 775 | } 776 | public static void customerProfileInfoExType(customerProfileInfoExType argument) 777 | { 778 | if(null != argument) 779 | { 780 | customerProfileExType (argument); 781 | if(argument.profileType) { argument.profileTypeSpecified=true;} 782 | } 783 | } 784 | public static void subscriptionCustomerProfileType(subscriptionCustomerProfileType argument) 785 | { 786 | if(null != argument) 787 | { 788 | customerProfileExType (argument); 789 | customerPaymentProfileMaskedType(argument.paymentProfile); 790 | customerAddressExType(argument.shippingProfile); 791 | } 792 | } 793 | public static void customerProfileType(customerProfileType argument) 794 | { 795 | if(null != argument) 796 | { 797 | customerProfileBaseType (argument); 798 | if(null != argument.paymentProfiles){ foreach( var value in argument.paymentProfiles) { customerPaymentProfileType(value);} } 799 | if(null != argument.shipToList){ foreach( var value in argument.shipToList) { customerAddressType(value);} } 800 | if(argument.profileType) { argument.profileTypeSpecified=true;} 801 | } 802 | } 803 | public static void ARBSubscriptionMaskedType(ARBSubscriptionMaskedType argument) 804 | { 805 | if(null != argument) 806 | { 807 | paymentScheduleType(argument.paymentSchedule); 808 | if(argument.amount) { argument.amountSpecified=true;} 809 | if(argument.trialAmount) { argument.trialAmountSpecified=true;} 810 | if(argument.status) { argument.statusSpecified=true;} 811 | subscriptionCustomerProfileType(argument.profile); 812 | orderType(argument.order); 813 | if(null != argument.arbTransactions){ foreach( var value in argument.arbTransactions) { arbTransaction(value);} } 814 | } 815 | } 816 | public static void paymentScheduleType(paymentScheduleType argument) 817 | { 818 | if(null != argument) 819 | { 820 | paymentScheduleTypeInterval(argument.interval); 821 | if(argument.startDate) { argument.startDateSpecified=true;} 822 | if(argument.totalOccurrences) { argument.totalOccurrencesSpecified=true;} 823 | if(argument.trialOccurrences) { argument.trialOccurrencesSpecified=true;} 824 | } 825 | } 826 | public static void paymentScheduleTypeInterval(paymentScheduleTypeInterval argument) 827 | { 828 | if(null != argument) 829 | { 830 | } 831 | } 832 | public static void arbTransaction(arbTransaction argument) 833 | { 834 | if(null != argument) 835 | { 836 | if(argument.submitTimeUTC) { argument.submitTimeUTCSpecified=true;} 837 | if(argument.payNum) { argument.payNumSpecified=true;} 838 | if(argument.attemptNum) { argument.attemptNumSpecified=true;} 839 | } 840 | } 841 | public static void securePaymentContainerErrorType(securePaymentContainerErrorType argument) 842 | { 843 | if(null != argument) 844 | { 845 | } 846 | } 847 | public static void customerType(customerType argument) 848 | { 849 | if(null != argument) 850 | { 851 | if(argument.type) { argument.typeSpecified=true;} 852 | driversLicenseType(argument.driversLicense); 853 | } 854 | } 855 | public static void paymentSimpleType(paymentSimpleType argument) 856 | { 857 | if(null != argument) 858 | { 859 | bankAccountType(argument); 860 | creditCardSimpleType(argument); 861 | } 862 | } 863 | public static void merchantContactType(merchantContactType argument) 864 | { 865 | if(null != argument) 866 | { 867 | } 868 | } 869 | public static void ContactDetailType(ContactDetailType argument) 870 | { 871 | if(null != argument) 872 | { 873 | } 874 | } 875 | public static void permissionType(permissionType argument) 876 | { 877 | if(null != argument) 878 | { 879 | } 880 | } 881 | public static void ArrayOfSetting(ArrayOfSetting argument) 882 | { 883 | if(null != argument) 884 | { 885 | if(null != argument.setting){ foreach( var value in argument.setting) { settingType(value);} } 886 | } 887 | } 888 | public static void emailSettingsType(emailSettingsType argument) 889 | { 890 | if(null != argument) 891 | { 892 | ArrayOfSetting (argument); 893 | } 894 | } 895 | public static void fraudInformationType(fraudInformationType argument) 896 | { 897 | if(null != argument) 898 | { 899 | } 900 | } 901 | public static void transactionSummaryType(transactionSummaryType argument) 902 | { 903 | if(null != argument) 904 | { 905 | subscriptionPaymentType(argument.subscription); 906 | if(argument.hasReturnedItems) { argument.hasReturnedItemsSpecified=true;} 907 | fraudInformationType(argument.fraudInformation); 908 | customerProfileIdType(argument.profile); 909 | } 910 | } 911 | public static void ARBSubscriptionType(ARBSubscriptionType argument) 912 | { 913 | if(null != argument) 914 | { 915 | paymentScheduleType(argument.paymentSchedule); 916 | if(argument.amount) { argument.amountSpecified=true;} 917 | if(argument.trialAmount) { argument.trialAmountSpecified=true;} 918 | paymentType(argument.payment); 919 | orderType(argument.order); 920 | customerType(argument.customer); 921 | nameAndAddressType(argument.billTo); 922 | nameAndAddressType(argument.shipTo); 923 | customerProfileIdType(argument.profile); 924 | } 925 | } 926 | public static void webCheckOutDataTypeToken(webCheckOutDataTypeToken argument) 927 | { 928 | if(null != argument) 929 | { 930 | } 931 | } 932 | public static void webCheckOutDataType(webCheckOutDataType argument) 933 | { 934 | if(null != argument) 935 | { 936 | webCheckOutDataTypeToken(argument.token); 937 | bankAccountType(argument.bankToken); 938 | } 939 | } 940 | public static void paymentDetails(paymentDetails argument) 941 | { 942 | if(null != argument) 943 | { 944 | } 945 | } 946 | public static void fingerPrintType(fingerPrintType argument) 947 | { 948 | if(null != argument) 949 | { 950 | } 951 | } 952 | public static void impersonationAuthenticationType(impersonationAuthenticationType argument) 953 | { 954 | if(null != argument) 955 | { 956 | } 957 | } 958 | public static void merchantAuthenticationType(merchantAuthenticationType argument) 959 | { 960 | if(null != argument) 961 | { 962 | fingerPrintType(argument); 963 | impersonationAuthenticationType(argument); 964 | } 965 | } 966 | public static void ANetApiRequest(ANetApiRequest argument) 967 | { 968 | if(null != argument) 969 | { 970 | merchantAuthenticationType(argument.merchantAuthentication); 971 | } 972 | } 973 | public static void decryptPaymentDataResponse(decryptPaymentDataResponse argument) 974 | { 975 | if(null != argument) 976 | { 977 | customerAddressType(argument.shippingInfo); 978 | customerAddressType(argument.billingInfo); 979 | creditCardMaskedType(argument.cardInfo); 980 | paymentDetails(argument.paymentDetails); 981 | } 982 | } 983 | public static void ANetApiResponse(ANetApiResponse argument) 984 | { 985 | if(null != argument) 986 | { 987 | messagesType(argument.messages); 988 | } 989 | } 990 | public static void securePaymentContainerRequest(securePaymentContainerRequest argument) 991 | { 992 | if(null != argument) 993 | { 994 | webCheckOutDataType(argument.data); 995 | } 996 | } 997 | public static void securePaymentContainerResponse(securePaymentContainerResponse argument) 998 | { 999 | if(null != argument) 1000 | { 1001 | opaqueDataType(argument.opaqueData); 1002 | } 1003 | } 1004 | public static void isAliveRequest(isAliveRequest argument) 1005 | { 1006 | if(null != argument) 1007 | { 1008 | } 1009 | } 1010 | public static void isAliveResponse(isAliveResponse argument) 1011 | { 1012 | if(null != argument) 1013 | { 1014 | } 1015 | } 1016 | public static void authenticateTestRequest(authenticateTestRequest argument) 1017 | { 1018 | if(null != argument) 1019 | { 1020 | } 1021 | } 1022 | public static void authenticateTestResponse(authenticateTestResponse argument) 1023 | { 1024 | if(null != argument) 1025 | { 1026 | } 1027 | } 1028 | public static void ARBCreateSubscriptionRequest(ARBCreateSubscriptionRequest argument) 1029 | { 1030 | if(null != argument) 1031 | { 1032 | ARBSubscriptionType(argument.subscription); 1033 | } 1034 | } 1035 | public static void ARBCreateSubscriptionResponse(ARBCreateSubscriptionResponse argument) 1036 | { 1037 | if(null != argument) 1038 | { 1039 | customerProfileIdType(argument.profile); 1040 | } 1041 | } 1042 | public static void ARBUpdateSubscriptionRequest(ARBUpdateSubscriptionRequest argument) 1043 | { 1044 | if(null != argument) 1045 | { 1046 | ARBSubscriptionType(argument.subscription); 1047 | } 1048 | } 1049 | public static void ARBUpdateSubscriptionResponse(ARBUpdateSubscriptionResponse argument) 1050 | { 1051 | if(null != argument) 1052 | { 1053 | customerProfileIdType(argument.profile); 1054 | } 1055 | } 1056 | public static void ARBCancelSubscriptionRequest(ARBCancelSubscriptionRequest argument) 1057 | { 1058 | if(null != argument) 1059 | { 1060 | } 1061 | } 1062 | public static void ARBCancelSubscriptionResponse(ARBCancelSubscriptionResponse argument) 1063 | { 1064 | if(null != argument) 1065 | { 1066 | } 1067 | } 1068 | public static void ARBGetSubscriptionStatusRequest(ARBGetSubscriptionStatusRequest argument) 1069 | { 1070 | if(null != argument) 1071 | { 1072 | } 1073 | } 1074 | public static void ARBGetSubscriptionStatusResponse(ARBGetSubscriptionStatusResponse argument) 1075 | { 1076 | if(null != argument) 1077 | { 1078 | if(argument.status) { argument.statusSpecified=true;} 1079 | } 1080 | } 1081 | public static void createCustomerProfileRequest(createCustomerProfileRequest argument) 1082 | { 1083 | if(null != argument) 1084 | { 1085 | customerProfileType(argument.profile); 1086 | if(argument.validationMode) { argument.validationModeSpecified=true;} 1087 | } 1088 | } 1089 | public static void createCustomerProfileResponse(createCustomerProfileResponse argument) 1090 | { 1091 | if(null != argument) 1092 | { 1093 | } 1094 | } 1095 | public static void createCustomerPaymentProfileRequest(createCustomerPaymentProfileRequest argument) 1096 | { 1097 | if(null != argument) 1098 | { 1099 | customerPaymentProfileType(argument.paymentProfile); 1100 | if(argument.validationMode) { argument.validationModeSpecified=true;} 1101 | } 1102 | } 1103 | public static void createCustomerPaymentProfileResponse(createCustomerPaymentProfileResponse argument) 1104 | { 1105 | if(null != argument) 1106 | { 1107 | } 1108 | } 1109 | public static void createCustomerShippingAddressRequest(createCustomerShippingAddressRequest argument) 1110 | { 1111 | if(null != argument) 1112 | { 1113 | customerAddressType(argument.address); 1114 | if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;} 1115 | } 1116 | } 1117 | public static void createCustomerShippingAddressResponse(createCustomerShippingAddressResponse argument) 1118 | { 1119 | if(null != argument) 1120 | { 1121 | } 1122 | } 1123 | public static void createCustomerProfileFromTransactionRequest(createCustomerProfileFromTransactionRequest argument) 1124 | { 1125 | if(null != argument) 1126 | { 1127 | customerProfileBaseType(argument.customer); 1128 | if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;} 1129 | if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;} 1130 | if(argument.profileType) { argument.profileTypeSpecified=true;} 1131 | } 1132 | } 1133 | public static void getCustomerProfileRequest(getCustomerProfileRequest argument) 1134 | { 1135 | if(null != argument) 1136 | { 1137 | if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;} 1138 | if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;} 1139 | } 1140 | } 1141 | public static void getCustomerProfileResponse(getCustomerProfileResponse argument) 1142 | { 1143 | if(null != argument) 1144 | { 1145 | customerProfileMaskedType(argument.profile); 1146 | } 1147 | } 1148 | public static void getCustomerPaymentProfileRequest(getCustomerPaymentProfileRequest argument) 1149 | { 1150 | if(null != argument) 1151 | { 1152 | if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;} 1153 | if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;} 1154 | } 1155 | } 1156 | public static void getCustomerPaymentProfileResponse(getCustomerPaymentProfileResponse argument) 1157 | { 1158 | if(null != argument) 1159 | { 1160 | customerPaymentProfileMaskedType(argument.paymentProfile); 1161 | } 1162 | } 1163 | public static void getCustomerShippingAddressRequest(getCustomerShippingAddressRequest argument) 1164 | { 1165 | if(null != argument) 1166 | { 1167 | } 1168 | } 1169 | public static void getCustomerShippingAddressResponse(getCustomerShippingAddressResponse argument) 1170 | { 1171 | if(null != argument) 1172 | { 1173 | if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;} 1174 | customerAddressExType(argument.address); 1175 | } 1176 | } 1177 | public static void updateCustomerProfileRequest(updateCustomerProfileRequest argument) 1178 | { 1179 | if(null != argument) 1180 | { 1181 | customerProfileExType(argument.profile); 1182 | } 1183 | } 1184 | public static void updateCustomerProfileResponse(updateCustomerProfileResponse argument) 1185 | { 1186 | if(null != argument) 1187 | { 1188 | } 1189 | } 1190 | public static void updateCustomerPaymentProfileRequest(updateCustomerPaymentProfileRequest argument) 1191 | { 1192 | if(null != argument) 1193 | { 1194 | customerPaymentProfileExType(argument.paymentProfile); 1195 | if(argument.validationMode) { argument.validationModeSpecified=true;} 1196 | } 1197 | } 1198 | public static void updateCustomerPaymentProfileResponse(updateCustomerPaymentProfileResponse argument) 1199 | { 1200 | if(null != argument) 1201 | { 1202 | } 1203 | } 1204 | public static void updateCustomerShippingAddressRequest(updateCustomerShippingAddressRequest argument) 1205 | { 1206 | if(null != argument) 1207 | { 1208 | customerAddressExType(argument.address); 1209 | if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;} 1210 | } 1211 | } 1212 | public static void updateCustomerShippingAddressResponse(updateCustomerShippingAddressResponse argument) 1213 | { 1214 | if(null != argument) 1215 | { 1216 | } 1217 | } 1218 | public static void deleteCustomerProfileRequest(deleteCustomerProfileRequest argument) 1219 | { 1220 | if(null != argument) 1221 | { 1222 | } 1223 | } 1224 | public static void deleteCustomerProfileResponse(deleteCustomerProfileResponse argument) 1225 | { 1226 | if(null != argument) 1227 | { 1228 | } 1229 | } 1230 | public static void deleteCustomerPaymentProfileRequest(deleteCustomerPaymentProfileRequest argument) 1231 | { 1232 | if(null != argument) 1233 | { 1234 | } 1235 | } 1236 | public static void deleteCustomerPaymentProfileResponse(deleteCustomerPaymentProfileResponse argument) 1237 | { 1238 | if(null != argument) 1239 | { 1240 | } 1241 | } 1242 | public static void deleteCustomerShippingAddressRequest(deleteCustomerShippingAddressRequest argument) 1243 | { 1244 | if(null != argument) 1245 | { 1246 | } 1247 | } 1248 | public static void deleteCustomerShippingAddressResponse(deleteCustomerShippingAddressResponse argument) 1249 | { 1250 | if(null != argument) 1251 | { 1252 | } 1253 | } 1254 | public static void createCustomerProfileTransactionRequest(createCustomerProfileTransactionRequest argument) 1255 | { 1256 | if(null != argument) 1257 | { 1258 | profileTransactionType(argument.transaction); 1259 | } 1260 | } 1261 | public static void createCustomerProfileTransactionResponse(createCustomerProfileTransactionResponse argument) 1262 | { 1263 | if(null != argument) 1264 | { 1265 | transactionResponse(argument.transactionResponse); 1266 | } 1267 | } 1268 | public static void validateCustomerPaymentProfileRequest(validateCustomerPaymentProfileRequest argument) 1269 | { 1270 | if(null != argument) 1271 | { 1272 | } 1273 | } 1274 | public static void validateCustomerPaymentProfileResponse(validateCustomerPaymentProfileResponse argument) 1275 | { 1276 | if(null != argument) 1277 | { 1278 | } 1279 | } 1280 | public static void getCustomerProfileIdsRequest(getCustomerProfileIdsRequest argument) 1281 | { 1282 | if(null != argument) 1283 | { 1284 | } 1285 | } 1286 | public static void getCustomerProfileIdsResponse(getCustomerProfileIdsResponse argument) 1287 | { 1288 | if(null != argument) 1289 | { 1290 | } 1291 | } 1292 | public static void updateSplitTenderGroupRequest(updateSplitTenderGroupRequest argument) 1293 | { 1294 | if(null != argument) 1295 | { 1296 | } 1297 | } 1298 | public static void updateSplitTenderGroupResponse(updateSplitTenderGroupResponse argument) 1299 | { 1300 | if(null != argument) 1301 | { 1302 | } 1303 | } 1304 | public static void getTransactionDetailsRequest(getTransactionDetailsRequest argument) 1305 | { 1306 | if(null != argument) 1307 | { 1308 | } 1309 | } 1310 | public static void getTransactionDetailsResponse(getTransactionDetailsResponse argument) 1311 | { 1312 | if(null != argument) 1313 | { 1314 | transactionDetailsType(argument.transaction); 1315 | } 1316 | } 1317 | public static void createTransactionRequest(createTransactionRequest argument) 1318 | { 1319 | if(null != argument) 1320 | { 1321 | transactionRequestType(argument.transactionRequest); 1322 | } 1323 | } 1324 | public static void createTransactionResponse(createTransactionResponse argument) 1325 | { 1326 | if(null != argument) 1327 | { 1328 | transactionResponse(argument.transactionResponse); 1329 | createProfileResponse(argument.profileResponse); 1330 | } 1331 | } 1332 | public static void updateHeldTransactionRequest(updateHeldTransactionRequest argument) 1333 | { 1334 | if(null != argument) 1335 | { 1336 | heldTransactionRequestType(argument.heldTransactionRequest); 1337 | } 1338 | } 1339 | public static void updateHeldTransactionResponse(updateHeldTransactionResponse argument) 1340 | { 1341 | if(null != argument) 1342 | { 1343 | transactionResponse(argument.transactionResponse); 1344 | } 1345 | } 1346 | public static void getBatchStatisticsRequest(getBatchStatisticsRequest argument) 1347 | { 1348 | if(null != argument) 1349 | { 1350 | } 1351 | } 1352 | public static void getBatchStatisticsResponse(getBatchStatisticsResponse argument) 1353 | { 1354 | if(null != argument) 1355 | { 1356 | batchDetailsType(argument.batch); 1357 | } 1358 | } 1359 | public static void getSettledBatchListRequest(getSettledBatchListRequest argument) 1360 | { 1361 | if(null != argument) 1362 | { 1363 | if(argument.includeStatistics) { argument.includeStatisticsSpecified=true;} 1364 | if(argument.firstSettlementDate) { argument.firstSettlementDateSpecified=true;} 1365 | if(argument.lastSettlementDate) { argument.lastSettlementDateSpecified=true;} 1366 | } 1367 | } 1368 | public static void getSettledBatchListResponse(getSettledBatchListResponse argument) 1369 | { 1370 | if(null != argument) 1371 | { 1372 | if(null != argument.batchList){ foreach( var value in argument.batchList) { batchDetailsType(value);} } 1373 | } 1374 | } 1375 | public static void getTransactionListRequest(getTransactionListRequest argument) 1376 | { 1377 | if(null != argument) 1378 | { 1379 | TransactionListSorting(argument.sorting); 1380 | Paging(argument.paging); 1381 | } 1382 | } 1383 | public static void getTransactionListResponse(getTransactionListResponse argument) 1384 | { 1385 | if(null != argument) 1386 | { 1387 | if(null != argument.transactions){ foreach( var value in argument.transactions) { transactionSummaryType(value);} } 1388 | if(argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true;} 1389 | } 1390 | } 1391 | public static void getHostedProfilePageRequest(getHostedProfilePageRequest argument) 1392 | { 1393 | if(null != argument) 1394 | { 1395 | if(null != argument.hostedProfileSettings){ foreach( var value in argument.hostedProfileSettings) { settingType(value);} } 1396 | } 1397 | } 1398 | public static void getHostedProfilePageResponse(getHostedProfilePageResponse argument) 1399 | { 1400 | if(null != argument) 1401 | { 1402 | } 1403 | } 1404 | public static void getUnsettledTransactionListRequest(getUnsettledTransactionListRequest argument) 1405 | { 1406 | if(null != argument) 1407 | { 1408 | if(argument.status) { argument.statusSpecified=true;} 1409 | TransactionListSorting(argument.sorting); 1410 | Paging(argument.paging); 1411 | } 1412 | } 1413 | public static void getHostedPaymentPageRequest(getHostedPaymentPageRequest argument) 1414 | { 1415 | if(null != argument) 1416 | { 1417 | transactionRequestType(argument.transactionRequest); 1418 | if(null != argument.hostedPaymentSettings){ foreach( var value in argument.hostedPaymentSettings) { settingType(value);} } 1419 | } 1420 | } 1421 | public static void getHostedPaymentPageResponse(getHostedPaymentPageResponse argument) 1422 | { 1423 | if(null != argument) 1424 | { 1425 | } 1426 | } 1427 | public static void getUnsettledTransactionListResponse(getUnsettledTransactionListResponse argument) 1428 | { 1429 | if(null != argument) 1430 | { 1431 | if(null != argument.transactions){ foreach( var value in argument.transactions) { transactionSummaryType(value);} } 1432 | if(argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true;} 1433 | } 1434 | } 1435 | public static void mobileDeviceRegistrationRequest(mobileDeviceRegistrationRequest argument) 1436 | { 1437 | if(null != argument) 1438 | { 1439 | mobileDeviceType(argument.mobileDevice); 1440 | } 1441 | } 1442 | public static void mobileDeviceRegistrationResponse(mobileDeviceRegistrationResponse argument) 1443 | { 1444 | if(null != argument) 1445 | { 1446 | } 1447 | } 1448 | public static void mobileDeviceLoginRequest(mobileDeviceLoginRequest argument) 1449 | { 1450 | if(null != argument) 1451 | { 1452 | } 1453 | } 1454 | public static void mobileDeviceLoginResponse(mobileDeviceLoginResponse argument) 1455 | { 1456 | if(null != argument) 1457 | { 1458 | merchantContactType(argument.merchantContact); 1459 | if(null != argument.userPermissions){ foreach( var value in argument.userPermissions) { permissionType(value);} } 1460 | transRetailInfoType(argument.merchantAccount); 1461 | } 1462 | } 1463 | public static void logoutRequest(logoutRequest argument) 1464 | { 1465 | if(null != argument) 1466 | { 1467 | } 1468 | } 1469 | public static void logoutResponse(logoutResponse argument) 1470 | { 1471 | if(null != argument) 1472 | { 1473 | } 1474 | } 1475 | public static void sendCustomerTransactionReceiptRequest(sendCustomerTransactionReceiptRequest argument) 1476 | { 1477 | if(null != argument) 1478 | { 1479 | emailSettingsType(argument.emailSettings); 1480 | } 1481 | } 1482 | public static void sendCustomerTransactionReceiptResponse(sendCustomerTransactionReceiptResponse argument) 1483 | { 1484 | if(null != argument) 1485 | { 1486 | } 1487 | } 1488 | public static void ARBGetSubscriptionListRequest(ARBGetSubscriptionListRequest argument) 1489 | { 1490 | if(null != argument) 1491 | { 1492 | ARBGetSubscriptionListSorting(argument.sorting); 1493 | Paging(argument.paging); 1494 | } 1495 | } 1496 | public static void ARBGetSubscriptionListResponse(ARBGetSubscriptionListResponse argument) 1497 | { 1498 | if(null != argument) 1499 | { 1500 | if(argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true;} 1501 | if(null != argument.subscriptionDetails){ foreach( var value in argument.subscriptionDetails) { SubscriptionDetail(value);} } 1502 | } 1503 | } 1504 | public static void EnumCollection(EnumCollection argument) 1505 | { 1506 | if(null != argument) 1507 | { 1508 | customerProfileSummaryType(argument.customerProfileSummaryType); 1509 | paymentSimpleType(argument.paymentSimpleType); 1510 | typeEmailReceipt, 1511 | } 1512 | } 1513 | public static void getCustomerPaymentProfileListRequest(getCustomerPaymentProfileListRequest argument) 1514 | { 1515 | if(null != argument) 1516 | { 1517 | CustomerPaymentProfileSorting(argument.sorting); 1518 | Paging(argument.paging); 1519 | } 1520 | } 1521 | public static void getCustomerPaymentProfileListResponse(getCustomerPaymentProfileListResponse argument) 1522 | { 1523 | if(null != argument) 1524 | { 1525 | if(null != argument.paymentProfiles){ foreach( var value in argument.paymentProfiles) { customerPaymentProfileListItemType(value);} } 1526 | } 1527 | } 1528 | public static void ARBGetSubscriptionRequest(ARBGetSubscriptionRequest argument) 1529 | { 1530 | if(null != argument) 1531 | { 1532 | if(argument.includeTransactions) { argument.includeTransactionsSpecified=true;} 1533 | } 1534 | } 1535 | public static void ARBGetSubscriptionResponse(ARBGetSubscriptionResponse argument) 1536 | { 1537 | if(null != argument) 1538 | { 1539 | ARBSubscriptionMaskedType(argument.subscription); 1540 | } 1541 | } 1542 | public static void getTransactionListForCustomerRequest(getTransactionListForCustomerRequest argument) 1543 | { 1544 | if(null != argument) 1545 | { 1546 | TransactionListSorting(argument.sorting); 1547 | Paging(argument.paging); 1548 | } 1549 | } 1550 | public static void getAUJobSummaryRequest(getAUJobSummaryRequest argument) 1551 | { 1552 | if(null != argument) 1553 | { 1554 | } 1555 | } 1556 | public static void getAUJobSummaryResponse(getAUJobSummaryResponse argument) 1557 | { 1558 | if(null != argument) 1559 | { 1560 | if(null != argument.auSummary){ foreach( var value in argument.auSummary) { auResponseType(value);} } 1561 | } 1562 | } 1563 | public static void getAUJobDetailsRequest(getAUJobDetailsRequest argument) 1564 | { 1565 | if(null != argument) 1566 | { 1567 | if(argument.modifiedTypeFilter) { argument.modifiedTypeFilterSpecified=true;} 1568 | Paging(argument.paging); 1569 | } 1570 | } 1571 | public static void getAUJobDetailsResponse(getAUJobDetailsResponse argument) 1572 | { 1573 | if(null != argument) 1574 | { 1575 | if(argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true;} 1576 | [System.Xml.Serialization.XmlArrayItemAttribute("auDelete", typeof(auDeleteType), IsNullable=false)] 1577 | [System.Xml.Serialization.XmlArrayItemAttribute("auUpdate", typeof(auUpdateType), IsNullable=false)] 1578 | if(null != argument.auDetails){ foreach( var value in argument.auDetails) { auDetailsType(value);} } 1579 | } 1580 | } 1581 | public static void getMerchantDetailsRequest(getMerchantDetailsRequest argument) 1582 | { 1583 | if(null != argument) 1584 | { 1585 | } 1586 | } 1587 | public static void getMerchantDetailsResponse(getMerchantDetailsResponse argument) 1588 | { 1589 | if(null != argument) 1590 | { 1591 | if(argument.isTestMode) { argument.isTestModeSpecified=true;} 1592 | if(null != argument.processors){ foreach( var value in argument.processors) { processorType(value);} } 1593 | [System.Xml.Serialization.XmlArrayItemAttribute("marketType")] 1594 | System.Nullable< 1595 | customerAddressType(argument.businessInformation); 1596 | if(null != argument.contactDetails){ foreach( var value in argument.contactDetails) { ContactDetailType(value);} } 1597 | } 1598 | } 1599 | public static void updateMerchantDetailsRequest(updateMerchantDetailsRequest argument) 1600 | { 1601 | if(null != argument) 1602 | { 1603 | } 1604 | } 1605 | public static void updateMerchantDetailsResponse(updateMerchantDetailsResponse argument) 1606 | { 1607 | if(null != argument) 1608 | { 1609 | } 1610 | } 1611 | public static void getCustomerPaymentProfileNonceRequest(getCustomerPaymentProfileNonceRequest argument) 1612 | { 1613 | if(null != argument) 1614 | { 1615 | } 1616 | } 1617 | public static void getCustomerPaymentProfileNonceResponse(getCustomerPaymentProfileNonceResponse argument) 1618 | { 1619 | if(null != argument) 1620 | { 1621 | opaqueDataType(argument.opaqueData); 1622 | } 1623 | } 1624 | } 1625 | // ReSharper restore InconsistentNaming 1626 | #pragma warning restore 1591 1627 | #pragma warning restore 169 1628 | } 1629 | /* 1630 | Requests 1631 | ARBCreateSubscriptionRequest 1632 | ARBUpdateSubscriptionRequest 1633 | createCustomerPaymentProfileRequest 1634 | createCustomerProfileRequest 1635 | createCustomerProfileTransactionRequest 1636 | createTransactionRequest 1637 | getSettledBatchListRequest 1638 | mobileDeviceRegistrationRequest 1639 | updateCustomerPaymentProfileRequest 1640 | XXDoNotUseDummyRequest 1641 | ECHO is off. 1642 | */ 1643 | /* 1644 | Objects 1645 | ECHO is off. 1646 | ARBSubscriptionType 1647 | bankAccountMaskedType 1648 | bankAccountType 1649 | batchDetailsType 1650 | batchStatisticType 1651 | customerDataType 1652 | customerPaymentProfileBaseType 1653 | customerPaymentProfileExType 1654 | customerPaymentProfileMaskedType 1655 | customerPaymentProfileType 1656 | customerProfileMaskedType 1657 | customerProfileType 1658 | customerType 1659 | lineItemType 1660 | mobileDeviceType 1661 | paymentMaskedType 1662 | paymentScheduleType 1663 | paymentSimpleType 1664 | paymentType 1665 | profileTransactionType 1666 | profileTransAmountType 1667 | profileTransAuthCaptureType 1668 | profileTransAuthOnlyType 1669 | profileTransCaptureOnlyType 1670 | profileTransOrderType 1671 | profileTransPriorAuthCaptureType 1672 | profileTransRefundType 1673 | transactionDetailsType 1674 | transactionRequestType 1675 | transactionSummaryType 1676 | ECHO is off. 1677 | */ 1678 | -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/ControllerTemplate.cst: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | 8 | public class APICONTROLLERNAMEController : ApiOperationBase { 9 | 10 | public APICONTROLLERNAMEController(APICONTROLLERNAMERequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.APICONTROLLERNAMEType(request); 27 | } 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/ARBCancelSubscriptionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class ARBCancelSubscriptionController : ApiOperationBase { 9 | 10 | public ARBCancelSubscriptionController(ARBCancelSubscriptionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/ARBCreateSubscriptionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class ARBCreateSubscriptionController : ApiOperationBase { 9 | 10 | public ARBCreateSubscriptionController(ARBCreateSubscriptionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | if (null == request.subscription) throw new ArgumentException("subscription cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.ARBCreateSubscriptionRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/ARBGetSubscriptionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class ARBGetSubscriptionController : ApiOperationBase { 9 | 10 | public ARBGetSubscriptionController(ARBGetSubscriptionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | if ( request.subscriptionId == null) throw new ArgumentException( "Subscription ID cannot be null"); 18 | 19 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 20 | 21 | //validate not-required fields 22 | } 23 | 24 | protected override void BeforeExecute() 25 | { 26 | var request = GetApiRequest(); 27 | RequestFactoryWithSpecified.ARBGetSubscriptionRequest(request); 28 | } 29 | } 30 | #pragma warning restore 1591 31 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/ARBGetSubscriptionListController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class ARBGetSubscriptionListController : ApiOperationBase { 9 | 10 | public ARBGetSubscriptionListController(ARBGetSubscriptionListRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | } 16 | } 17 | #pragma warning restore 1591 18 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/ARBGetSubscriptionStatusController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class ARBGetSubscriptionStatusController : ApiOperationBase { 9 | 10 | public ARBGetSubscriptionStatusController(ARBGetSubscriptionStatusRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/ARBUpdateSubscriptionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class ARBUpdateSubscriptionController : ApiOperationBase { 9 | 10 | public ARBUpdateSubscriptionController(ARBUpdateSubscriptionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.ARBUpdateSubscriptionRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/Bases/ApiOperationBase.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers.Bases 2 | { 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System; 6 | using Contracts.V1; 7 | using Utilities; 8 | using Microsoft.Extensions.Logging; 9 | 10 | public abstract class ApiOperationBase : IApiOperation 11 | where TQ : ANetApiRequest 12 | where TS : ANetApiResponse 13 | { 14 | protected static ILogger Logger = LogFactory.getLog(typeof(ApiOperationBase)); 15 | 16 | public static AuthorizeNet.Environment RunEnvironment { get; set; } 17 | public static merchantAuthenticationType MerchantAuthentication { get; set; } 18 | 19 | private TQ _apiRequest; 20 | private TS _apiResponse; 21 | 22 | readonly Type _requestClass; 23 | readonly Type _responseClass; 24 | 25 | private ANetApiResponse _errorResponse; 26 | 27 | protected ApiOperationBase(TQ apiRequest) 28 | { 29 | if (null == apiRequest) 30 | { 31 | Logger.LogError("null apiRequest"); 32 | throw new ArgumentNullException("apiRequest", "Input request cannot be null"); 33 | } 34 | if (null != GetApiResponse()) 35 | { 36 | Logger.LogError(GetApiResponse().ToString()); 37 | throw new InvalidOperationException("Response should be null"); 38 | } 39 | 40 | _requestClass = typeof(TQ); 41 | _responseClass = typeof(TS); 42 | SetApiRequest(apiRequest); 43 | 44 | Logger.LogDebug("Creating instance for request:'{0}' and response:'{1}'", _requestClass, _responseClass); 45 | Validate(); 46 | } 47 | 48 | protected TQ GetApiRequest() 49 | { 50 | return _apiRequest; 51 | } 52 | 53 | protected void SetApiRequest(TQ apiRequest) 54 | { 55 | _apiRequest = apiRequest; 56 | } 57 | 58 | public TS GetApiResponse() 59 | { 60 | return _apiResponse; 61 | } 62 | 63 | private void SetApiResponse(TS apiResponse) 64 | { 65 | _apiResponse = apiResponse; 66 | } 67 | 68 | public ANetApiResponse GetErrorResponse() 69 | { 70 | return _errorResponse; 71 | } 72 | 73 | private void SetErrorResponse(ANetApiResponse errorResponse) 74 | { 75 | _errorResponse = errorResponse; 76 | } 77 | 78 | public TS ExecuteWithApiResponse(AuthorizeNet.Environment environment = null) 79 | { 80 | Execute(environment); 81 | return GetApiResponse(); 82 | } 83 | 84 | const String NullEnvironmentErrorMessage = "Environment not set. Set environment using setter or use overloaded method to pass appropriate environment"; 85 | 86 | public void Execute(AuthorizeNet.Environment environment = null) 87 | { 88 | BeforeExecute(); 89 | 90 | if (null == environment) { environment = ApiOperationBase.RunEnvironment; } 91 | if (null == environment) throw new ArgumentException(NullEnvironmentErrorMessage); 92 | 93 | var httpApiResponse = HttpUtility.PostData(environment, GetApiRequest()); 94 | 95 | if (null != httpApiResponse) 96 | { 97 | Logger.LogDebug("Received Response:'{0}' for request:'{1}'", httpApiResponse, GetApiRequest()); 98 | if (httpApiResponse.GetType() == _responseClass) 99 | { 100 | var response = (TS)httpApiResponse; 101 | SetApiResponse(response); 102 | Logger.LogDebug("Setting response: '{0}'", response); 103 | } 104 | else if (httpApiResponse.GetType() == typeof(ErrorResponse)) 105 | { 106 | SetErrorResponse(httpApiResponse); 107 | Logger.LogDebug("Received ErrorResponse:'{0}'", httpApiResponse); 108 | } 109 | else 110 | { 111 | SetErrorResponse(httpApiResponse); 112 | Logger.LogError("Invalid response:'{0}'", httpApiResponse); 113 | } 114 | Logger.LogDebug("Response obtained: {0}", GetApiResponse()); 115 | SetResultStatus(); 116 | 117 | } 118 | else 119 | { 120 | Logger.LogDebug("Got a 'null' Response for request:'{0}'\n", GetApiRequest()); 121 | } 122 | AfterExecute(); 123 | } 124 | 125 | public messageTypeEnum GetResultCode() 126 | { 127 | return ResultCode; 128 | } 129 | 130 | private void SetResultStatus() 131 | { 132 | Results = new List(); 133 | var messageTypes = GetResultMessage(); 134 | 135 | if (null != messageTypes) 136 | { 137 | ResultCode = messageTypes.resultCode; 138 | } 139 | 140 | if (null != messageTypes) 141 | { 142 | foreach (var amessage in messageTypes.message) 143 | { 144 | Results.Add(string.Format(CultureInfo.InvariantCulture, "{0}:{1}", amessage.code, amessage.text)); 145 | } 146 | } 147 | } 148 | 149 | public List GetResults() 150 | { 151 | return Results; 152 | } 153 | 154 | private messagesType GetResultMessage() 155 | { 156 | messagesType messageTypes = null; 157 | 158 | if (null != GetErrorResponse()) 159 | { 160 | messageTypes = GetErrorResponse().messages; 161 | } 162 | else if (null != GetApiResponse()) 163 | { 164 | messageTypes = GetApiResponse().messages; 165 | } 166 | 167 | return messageTypes; 168 | } 169 | 170 | protected List Results = null; 171 | protected messageTypeEnum ResultCode = messageTypeEnum.Ok; 172 | 173 | protected virtual void BeforeExecute() { } 174 | protected virtual void AfterExecute() { } 175 | 176 | protected abstract void ValidateRequest(); 177 | 178 | private void Validate() 179 | { 180 | //validate not nulls 181 | ValidateAndSetMerchantAuthentication(); 182 | 183 | //set the client Id 184 | SetClientId(); 185 | ValidateRequest(); 186 | } 187 | 188 | private void ValidateAndSetMerchantAuthentication() 189 | { 190 | ANetApiRequest request = GetApiRequest(); 191 | 192 | if (null == request.merchantAuthentication) 193 | { 194 | if (null != ApiOperationBase.MerchantAuthentication) 195 | { 196 | request.merchantAuthentication = ApiOperationBase.MerchantAuthentication; 197 | } 198 | else 199 | { 200 | throw new ArgumentException("MerchantAuthentication cannot be null"); 201 | } 202 | } 203 | } 204 | 205 | private void SetClientId() 206 | { 207 | ANetApiRequest request = GetApiRequest(); 208 | request.clientId = "sdk-dotnet-" + Constants.SDKVersion; 209 | } 210 | } 211 | 212 | } 213 | -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/Bases/ErrorResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers.Bases 2 | { 3 | using System.Text; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | 6 | //@XmlRootElement(name = "ErrorResponse") 7 | /** 8 | * Since JAXB does not generate the class for this element, custom coding it 9 | * @author ramittal 10 | * 11 | */ 12 | abstract class ErrorResponse : ANetApiResponse { 13 | 14 | public new string ToString() { 15 | var builder = new StringBuilder(); 16 | builder.Append("ErrorResponse: "); 17 | builder.Append(base.ToString()); 18 | builder.Append(", Id: ").Append( refId); 19 | builder.Append(", SessionToken: ").Append(sessionToken); 20 | var messagesType = messages; 21 | builder.Append(", MessagesType: "); 22 | if ( null != messagesType) 23 | { 24 | builder.Append(", ResultCode:").Append(messagesType.resultCode); 25 | var resultMessages = messagesType.message; 26 | if ( null != resultMessages) { 27 | foreach (var message in resultMessages) 28 | { 29 | builder.Append(", Message-> "); 30 | builder.Append(", Code: ").Append(message.code); 31 | builder.Append(", Text: ").Append(message.text); 32 | } 33 | } 34 | } 35 | 36 | return builder.ToString(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/Bases/IApiOperation.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers.Bases 2 | { 3 | using System.Collections.Generic; 4 | 5 | /** 6 | * @author ramittal 7 | * 8 | */ 9 | #pragma warning disable 1591 10 | public interface IApiOperation 11 | where TQ : AuthorizeNet.Api.Contracts.V1.ANetApiRequest 12 | where TS : AuthorizeNet.Api.Contracts.V1.ANetApiResponse 13 | { 14 | TS GetApiResponse(); 15 | AuthorizeNet.Api.Contracts.V1.ANetApiResponse GetErrorResponse(); 16 | TS ExecuteWithApiResponse(AuthorizeNet.Environment environment = null); 17 | void Execute(AuthorizeNet.Environment environment = null); 18 | AuthorizeNet.Api.Contracts.V1.messageTypeEnum GetResultCode(); 19 | List GetResults(); 20 | } 21 | #pragma warning restore 1591 22 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/authenticateTestController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class authenticateTestController : ApiOperationBase { 9 | 10 | public authenticateTestController(authenticateTestRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.authenticateTestRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createCustomerPaymentProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createCustomerPaymentProfileController : ApiOperationBase { 9 | 10 | public createCustomerPaymentProfileController(createCustomerPaymentProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.createCustomerPaymentProfileRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createCustomerProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createCustomerProfileController : ApiOperationBase { 9 | 10 | public createCustomerProfileController(createCustomerProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.createCustomerProfileRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createCustomerProfileFromTransactionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createCustomerProfileFromTransactionController : ApiOperationBase 9 | { 10 | 11 | public createCustomerProfileFromTransactionController(createCustomerProfileFromTransactionRequest apiRequest) 12 | : base(apiRequest) 13 | { 14 | } 15 | 16 | override protected void ValidateRequest() { 17 | var request = GetApiRequest(); 18 | 19 | //validate required fields 20 | if (null == request.transId) throw new ArgumentException("transactionId cannot be null"); 21 | 22 | //validate not-required fields 23 | } 24 | } 25 | #pragma warning restore 1591 26 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createCustomerProfileTransactionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createCustomerProfileTransactionController : ApiOperationBase { 9 | 10 | public createCustomerProfileTransactionController(createCustomerProfileTransactionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | if (null == request.transaction) throw new ArgumentException("transaction cannot be null"); 18 | 19 | //validate not-required fields 20 | } 21 | } 22 | #pragma warning restore 1591 23 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createCustomerShippingAddressController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createCustomerShippingAddressController : ApiOperationBase { 9 | 10 | public createCustomerShippingAddressController(createCustomerShippingAddressRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createFingerPrintController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createFingerPrintController : ApiOperationBase { 9 | 10 | public createFingerPrintController(createFingerPrintRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | if (null == request.supportInformation) throw new ArgumentException("supportInformation cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.createFingerPrintRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createProfileController 9 | //: ApiOperationBase 10 | { 11 | 12 | public createProfileController(customerProfilePaymentType apiRequest)// : base(apiRequest) 13 | { 14 | } 15 | 16 | //override 17 | protected void ValidateRequest() { 18 | //var request = GetApiRequest(); 19 | 20 | //validate required fields 21 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 22 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 23 | 24 | //validate not-required fields 25 | } 26 | 27 | //protected override void BeforeExecute() 28 | protected void BeforeExecute() 29 | { 30 | //var request = GetApiRequest(); 31 | //RequestFactoryWithSpecified.createProfileType(request); 32 | } 33 | } 34 | #pragma warning restore 1591 35 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/createTransactionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class createTransactionController : ApiOperationBase { 9 | 10 | public createTransactionController(createTransactionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.createTransactionRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/decryptPaymentDataController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class decryptPaymentDataController : ApiOperationBase { 9 | 10 | public decryptPaymentDataController(decryptPaymentDataRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.decryptPaymentDataRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/deleteCustomerPaymentProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class deleteCustomerPaymentProfileController : ApiOperationBase { 9 | 10 | public deleteCustomerPaymentProfileController(deleteCustomerPaymentProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/deleteCustomerProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class deleteCustomerProfileController : ApiOperationBase { 9 | 10 | public deleteCustomerProfileController(deleteCustomerProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/deleteCustomerShippingAddressController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class deleteCustomerShippingAddressController : ApiOperationBase { 9 | 10 | public deleteCustomerShippingAddressController(deleteCustomerShippingAddressRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getAUJobDetailsController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getAUJobDetailsController : ApiOperationBase { 9 | 10 | public getAUJobDetailsController(getAUJobDetailsRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | } 27 | } 28 | #pragma warning restore 1591 29 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getAUJobSummaryController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getAUJobSummaryController : ApiOperationBase { 9 | 10 | public getAUJobSummaryController(getAUJobSummaryRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | } 27 | } 28 | #pragma warning restore 1591 29 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getBatchStatisticsController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getBatchStatisticsController : ApiOperationBase { 9 | 10 | public getBatchStatisticsController(getBatchStatisticsRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getCustomerPaymentProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getCustomerPaymentProfileController : ApiOperationBase { 9 | 10 | public getCustomerPaymentProfileController(getCustomerPaymentProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getCustomerPaymentProfileListController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getCustomerPaymentProfileListController : ApiOperationBase { 9 | 10 | public getCustomerPaymentProfileListController(getCustomerPaymentProfileListRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | if (request.searchType < 0) throw new ArgumentException("SearchType cannot be null"); 18 | if (request.month == null) throw new ArgumentException("month cannot be null"); 19 | 20 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 21 | 22 | //validate not-required fields 23 | } 24 | 25 | protected override void BeforeExecute() 26 | { 27 | var request = GetApiRequest(); 28 | RequestFactoryWithSpecified.getCustomerPaymentProfileListRequest(request); 29 | } 30 | } 31 | #pragma warning restore 1591 32 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getCustomerPaymentProfileNonceController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getCustomerPaymentProfileNonceController : ApiOperationBase { 9 | 10 | public getCustomerPaymentProfileNonceController(getCustomerPaymentProfileNonceRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | // RequestFactoryWithSpecified.getCustomerPaymentProfileNonceType(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getCustomerProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getCustomerProfileController : ApiOperationBase { 9 | 10 | public getCustomerProfileController(getCustomerProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getCustomerProfileIdsController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getCustomerProfileIdsController : ApiOperationBase { 9 | 10 | public getCustomerProfileIdsController(getCustomerProfileIdsRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getCustomerShippingAddressController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getCustomerShippingAddressController : ApiOperationBase { 9 | 10 | public getCustomerShippingAddressController(getCustomerShippingAddressRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getHostedPaymentPageController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getHostedPaymentPageController : ApiOperationBase { 9 | 10 | public getHostedPaymentPageController(getHostedPaymentPageRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.getHostedPaymentPageRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getHostedProfilePageController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getHostedProfilePageController : ApiOperationBase { 9 | 10 | public getHostedProfilePageController(getHostedProfilePageRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getMerchantDetailsController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getMerchantDetailsController : ApiOperationBase { 9 | 10 | public getMerchantDetailsController(getMerchantDetailsRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.getMerchantDetailsRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getSettledBatchListController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getSettledBatchListController : ApiOperationBase { 9 | 10 | public getSettledBatchListController(getSettledBatchListRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.getSettledBatchListRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getTransactionDetailsController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getTransactionDetailsController : ApiOperationBase { 9 | 10 | public getTransactionDetailsController(getTransactionDetailsRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getTransactionListController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getTransactionListController : ApiOperationBase { 9 | 10 | public getTransactionListController(getTransactionListRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getTransactionListForCustomerController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getTransactionListForCustomerController : ApiOperationBase { 9 | 10 | public getTransactionListForCustomerController(getTransactionListForCustomerRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.getTransactionListForCustomerRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/getUnsettledTransactionListController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class getUnsettledTransactionListController : ApiOperationBase { 9 | 10 | public getUnsettledTransactionListController(getUnsettledTransactionListRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/isAliveController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class isAliveController : ApiOperationBase 9 | { 10 | 11 | public isAliveController(ANetApiRequest apiRequest) 12 | : base(apiRequest) 13 | { 14 | } 15 | 16 | override protected void ValidateRequest() { 17 | var request = GetApiRequest(); 18 | 19 | } 20 | 21 | protected override void BeforeExecute() 22 | { 23 | var request = GetApiRequest(); 24 | RequestFactoryWithSpecified.isAliveRequest(request); 25 | } 26 | } 27 | #pragma warning restore 1591 28 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/logoutController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class logoutController : ApiOperationBase { 9 | 10 | public logoutController(logoutRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.logoutRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/mobileDeviceLoginController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class mobileDeviceLoginController : ApiOperationBase { 9 | 10 | public mobileDeviceLoginController(mobileDeviceLoginRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/mobileDeviceRegistrationController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class mobileDeviceRegistrationController : ApiOperationBase { 9 | 10 | public mobileDeviceRegistrationController(mobileDeviceRegistrationRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.mobileDeviceRegistrationRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/securePaymentContainerController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class securePaymentContainerController : ApiOperationBase { 9 | 10 | public securePaymentContainerController(securePaymentContainerRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.securePaymentContainerRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/sendCustomerTransactionReceiptController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class sendCustomerTransactionReceiptController : ApiOperationBase { 9 | 10 | public sendCustomerTransactionReceiptController(sendCustomerTransactionReceiptRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/transactionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class transactionController 9 | //: ApiOperationBase 10 | { 11 | 12 | public transactionController(transactionRequestType apiRequest) 13 | //: base(apiRequest) 14 | { 15 | } 16 | 17 | //override 18 | protected void ValidateRequest() { 19 | //var request = GetApiRequest(); 20 | 21 | //validate required fields 22 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 23 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 24 | 25 | //validate not-required fields 26 | } 27 | 28 | //protected override void BeforeExecute() 29 | protected void BeforeExecute() 30 | { 31 | //var request = GetApiRequest(); 32 | //RequestFactoryWithSpecified.transactionRequestType(request); 33 | } 34 | } 35 | #pragma warning restore 1591 36 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/updateCustomerPaymentProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class updateCustomerPaymentProfileController : ApiOperationBase { 9 | 10 | public updateCustomerPaymentProfileController(updateCustomerPaymentProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.updateCustomerPaymentProfileRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/updateCustomerProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class updateCustomerProfileController : ApiOperationBase { 9 | 10 | public updateCustomerProfileController(updateCustomerProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.updateCustomerProfileRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/updateCustomerShippingAddressController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class updateCustomerShippingAddressController : ApiOperationBase { 9 | 10 | public updateCustomerShippingAddressController(updateCustomerShippingAddressRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/updateHeldTransactionController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class updateHeldTransactionController : ApiOperationBase { 9 | 10 | public updateHeldTransactionController(updateHeldTransactionRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.updateHeldTransactionRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/updateMerchantDetailsController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class updateMerchantDetailsController : ApiOperationBase { 9 | 10 | public updateMerchantDetailsController(updateMerchantDetailsRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | 23 | protected override void BeforeExecute() 24 | { 25 | var request = GetApiRequest(); 26 | RequestFactoryWithSpecified.updateMerchantDetailsRequest(request); 27 | } 28 | } 29 | #pragma warning restore 1591 30 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/updateSplitTenderGroupController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class updateSplitTenderGroupController : ApiOperationBase { 9 | 10 | public updateSplitTenderGroupController(updateSplitTenderGroupRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Api/Controllers/validateCustomerPaymentProfileController.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Api.Controllers 2 | { 3 | using System; 4 | using AuthorizeNet.Api.Contracts.V1; 5 | using AuthorizeNet.Api.Controllers.Bases; 6 | 7 | #pragma warning disable 1591 8 | public class validateCustomerPaymentProfileController : ApiOperationBase { 9 | 10 | public validateCustomerPaymentProfileController(validateCustomerPaymentProfileRequest apiRequest) : base(apiRequest) { 11 | } 12 | 13 | override protected void ValidateRequest() { 14 | var request = GetApiRequest(); 15 | 16 | //validate required fields 17 | //if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null"); 18 | //if ( null == request.Paging) throw new ArgumentException("Paging cannot be null"); 19 | 20 | //validate not-required fields 21 | } 22 | } 23 | #pragma warning restore 1591 24 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/App.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet 2 | { 3 | public class App 4 | { 5 | 6 | public const string CpVersion = "1.0"; // card present version 7 | protected Environment Environment { get; set; } 8 | protected string Login { get; set; } 9 | protected string TransactionKey { get; set; } 10 | 11 | private App() 12 | { 13 | Environment = Environment.SANDBOX; 14 | } 15 | 16 | public static App CreateApp(Environment environment, string login, string transactionKey) 17 | { 18 | var merchant = new App { Environment = environment, Login = login, TransactionKey = transactionKey }; 19 | 20 | return merchant; 21 | } 22 | 23 | public bool IsSandboxEnvironment() 24 | { 25 | return (Environment != null && 26 | (Environment.SANDBOX == Environment)); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/AuthorizeNET.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 1.0.0.0 6 | 7 | 8 | 9 | bin\Release\netcoreapp2.0\AuthorizeNET.xml 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Environment.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet 2 | { 3 | /*================================================================================ 4 | * 5 | * Determines the target environment to post API requests. 6 | * 7 | * SANDBOX should be used for testing. Transactions submitted to the sandbox 8 | * will not result in an actual card payment. Instead, the sandbox simulates 9 | * the response. Use the Testing Guide to generate specific gateway responses. 10 | * 11 | * PRODUCTION connects to the production gateway environment. 12 | * 13 | *===============================================================================*/ 14 | public class Environment 15 | { 16 | public static readonly Environment SANDBOX = new Environment("https://test.authorize.net", "https://apitest.authorize.net", "https://test.authorize.net"); 17 | public static readonly Environment PRODUCTION = new Environment("https://secure2.authorize.net", "https://api2.authorize.net", "https://cardpresent.authorize.net"); 18 | public static readonly Environment LOCAL_VM = new Environment(null, null, null); 19 | public static readonly Environment HOSTED_VM = new Environment(null, null, null); 20 | public static Environment CUSTOM = new Environment(null, null, null); 21 | 22 | public bool HttpUseProxy { get; set; } 23 | public string HttpsProxyUsername { get; set; } 24 | public string HttpsProxyPassword { get; set; } 25 | public string HttpProxyHost { get; set; } 26 | public int HttpProxyPort { get; set; } 27 | 28 | 29 | private Environment(string baseUrl, string xmlBaseUrl, string cardPresentUrl) 30 | { 31 | BaseUrl = baseUrl; 32 | XmlBaseUrl = xmlBaseUrl; 33 | CardPresentUrl = cardPresentUrl; 34 | } 35 | 36 | /// 37 | /// Gets the base url 38 | /// 39 | public string BaseUrl { get; private set; } 40 | 41 | /// 42 | /// Gets the xml base url 43 | /// 44 | public string XmlBaseUrl { get; private set; } 45 | 46 | /// 47 | /// Gets the card present url 48 | /// 49 | public string CardPresentUrl { get; private set; } 50 | 51 | /// 52 | /// Create a custom environment with the specified base url 53 | /// 54 | /// Base url 55 | /// Xml base url 56 | /// The custom environment 57 | public static Environment createEnvironment(string baseUrl, string xmlBaseUrl) 58 | { 59 | 60 | return createEnvironment(baseUrl, xmlBaseUrl, null); 61 | } 62 | 63 | 64 | /// 65 | /// Create a custom environment with the specified base url 66 | /// 67 | /// Base url 68 | /// Xml base url 69 | /// Card present url 70 | /// The custom environment 71 | public static Environment createEnvironment(string baseUrl, string xmlBaseUrl, string cardPresentUrl) 72 | { 73 | var environment = CUSTOM; 74 | environment.BaseUrl = baseUrl; 75 | environment.XmlBaseUrl = xmlBaseUrl; 76 | environment.CardPresentUrl = cardPresentUrl; 77 | 78 | return environment; 79 | } 80 | 81 | /// 82 | /// Reads an integer value from the environment 83 | /// 84 | /// Name of the int property to read 85 | /// Integer property value 86 | public static int getIntProperty(string propertyName) 87 | { 88 | int value = 0; 89 | var stringValue = GetProperty(propertyName); 90 | if (!string.IsNullOrWhiteSpace(stringValue)) 91 | { 92 | int.TryParse(stringValue.Trim(), out value); 93 | } 94 | 95 | return value; 96 | } 97 | 98 | /// 99 | /// Reads a boolean value from the environment 100 | /// 101 | /// Name of the boolean property to read 102 | /// Boolean property value 103 | public static bool getBooleanProperty(string propertyName) 104 | { 105 | var value = false; 106 | var stringValue = GetProperty(propertyName); 107 | if (!string.IsNullOrWhiteSpace(stringValue)) 108 | { 109 | bool.TryParse(stringValue.Trim(), out value); 110 | } 111 | 112 | return value; 113 | } 114 | 115 | /// 116 | /// Reads the value from the environment 117 | /// 118 | /// Name of the property to read 119 | /// String property value 120 | public static string GetProperty(string propertyName) 121 | { 122 | return System.Environment.GetEnvironmentVariable(propertyName); 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Utilities/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Utilities 2 | { 3 | public static class Constants 4 | { 5 | public const string ProxyProtocol = "http"; 6 | 7 | public const string HttpsUseProxy = "https.proxyUse"; 8 | public const string HttpsProxyHost = "https.proxyHost"; 9 | public const string HttpsProxyPort = "https.proxyPort"; 10 | public const string HttpsProxyUsername = "https.proxyUsername"; 11 | public const string HttpsProxyPassword = "https.proxyPassword"; 12 | 13 | public const string EnvApiLoginid = "API_LOGIN_ID"; 14 | 15 | public const string PropApiLoginid = "api.login.id"; 16 | 17 | public const string HttpConnectionTimeout = "http.connectionTimeout"; 18 | public const string HttpReadWriteTimeout = "http.readWriteTimeout"; 19 | 20 | public const int HttpConnectionDefaultTimeout = 30000; 21 | public const int HttpReadWriteDefaultTimeout = 30000; 22 | 23 | public const string SDKVersion = "1.0.0"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Utilities/Crypto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace AuthorizeNet.Utilities 5 | { 6 | public class Crypto 7 | { 8 | /// 9 | /// Generates the HMAC-encrypted hash to send along with the SIM form 10 | /// 11 | /// The merchant's transaction key 12 | /// The merchant's Authorize.NET API Login 13 | /// The amount of the transaction 14 | /// The sequence 15 | /// The timeStamp 16 | /// string 17 | public static string GenerateFingerprint(string transactionKey, string login, decimal amount, string sequence, string timeStamp) 18 | { 19 | var result = ""; 20 | var keyString = string.Format("{0}^{1}^{2}^{3}^", login, sequence, timeStamp.ToString(), amount.ToString()); 21 | result = EncryptHMAC(transactionKey, keyString); 22 | return result; 23 | } 24 | 25 | /// 26 | /// Encrypts the key/value pair supplied using HMAC-MD5 27 | /// 28 | /// key 29 | /// value 30 | /// 31 | public static string EncryptHMAC(string key, string value) 32 | { 33 | // The first two lines take the input values and convert them from strings to Byte arrays 34 | byte[] HMACkey = (new System.Text.ASCIIEncoding()).GetBytes(key); 35 | byte[] HMACdata = (new System.Text.ASCIIEncoding()).GetBytes(value); 36 | 37 | // create a HMACMD5 object with the key set 38 | HMACMD5 myhmacMD5 = new HMACMD5(HMACkey); 39 | 40 | //calculate the hash (returns a byte array) 41 | byte[] HMAChash = myhmacMD5.ComputeHash(HMACdata); 42 | 43 | //loop through the byte array and add append each piece to a string to obtain a hash string 44 | string fingerprint = ""; 45 | for (int i = 0; i < HMAChash.Length; i++) 46 | { 47 | fingerprint += HMAChash[i].ToString("x").PadLeft(2, '0'); 48 | } 49 | 50 | return fingerprint; 51 | } 52 | 53 | /// 54 | /// Generates a 4-place sequence number randomly 55 | /// 56 | /// 57 | public static string GenerateSequence() 58 | { 59 | CryptoRandom random = new CryptoRandom(); 60 | return (random.Next(0, 10000000)).ToString(); 61 | 62 | } 63 | 64 | /// 65 | /// Generates a timestamp in seconds from 1970 66 | /// 67 | public static int GenerateTimestamp() 68 | { 69 | return ((int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds); 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Utilities/CryptoRandom.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace AuthorizeNet.Utilities 5 | { 6 | /// 7 | /// Source Code from MSDN article http://msdn.microsoft.com/en-us/magazine/cc163367.aspx 8 | /// 9 | public class CryptoRandom 10 | { 11 | private RandomNumberGenerator _rng = RandomNumberGenerator.Create(); 12 | 13 | private byte[] _uint32Buffer = new byte[4]; 14 | 15 | public CryptoRandom() { } 16 | public CryptoRandom(Int32 ignoredSeed) { } 17 | 18 | public Int32 Next() 19 | { 20 | _rng.GetBytes(_uint32Buffer); 21 | return BitConverter.ToInt32(_uint32Buffer, 0) & 0x7FFFFFFF; 22 | } 23 | 24 | public Int32 Next(Int32 maxValue) 25 | { 26 | if (maxValue < 0) 27 | throw new ArgumentOutOfRangeException("maxValue"); 28 | return Next(0, maxValue); 29 | } 30 | 31 | public Int32 Next(Int32 minValue, Int32 maxValue) 32 | { 33 | if (minValue > maxValue) 34 | throw new ArgumentOutOfRangeException("minValue"); 35 | if (minValue == maxValue) return minValue; 36 | Int64 diff = maxValue - minValue; 37 | while (true) 38 | { 39 | _rng.GetBytes(_uint32Buffer); 40 | UInt32 rand = BitConverter.ToUInt32(_uint32Buffer, 0); 41 | 42 | Int64 max = (1 + (Int64)UInt32.MaxValue); 43 | Int64 remainder = max % diff; 44 | if (rand < max - remainder) 45 | { 46 | return (Int32)(minValue + (rand % diff)); 47 | } 48 | } 49 | } 50 | 51 | public double NextDouble() 52 | { 53 | _rng.GetBytes(_uint32Buffer); 54 | UInt32 rand = BitConverter.ToUInt32(_uint32Buffer, 0); 55 | return rand / (1.0 + UInt32.MaxValue); 56 | } 57 | 58 | public void NextBytes(byte[] buffer) 59 | { 60 | if (buffer == null) throw new ArgumentNullException("buffer"); 61 | _rng.GetBytes(buffer); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Utilities/HttpUtility.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Utilities 2 | { 3 | using Api.Contracts.V1; 4 | using Api.Controllers.Bases; 5 | using Microsoft.Extensions.Logging; 6 | using System; 7 | using System.Net.Http; 8 | using System.Text; 9 | using System.Net; 10 | 11 | public static class HttpUtility 12 | { 13 | 14 | private static readonly ILogger Logger = LogFactory.getLog(typeof(HttpUtility)); 15 | private static bool _proxySet; 16 | 17 | private static Uri GetPostUrl(AuthorizeNet.Environment env) 18 | { 19 | var postUrl = new Uri(env.XmlBaseUrl + "/xml/v1/request.api"); 20 | Logger.LogDebug("Creating PostRequest Url: '{0}'", postUrl); 21 | 22 | return postUrl; 23 | } 24 | 25 | public static ANetApiResponse PostData(AuthorizeNet.Environment env, TQ request) 26 | where TQ : ANetApiRequest 27 | where TS : ANetApiResponse 28 | { 29 | ANetApiResponse response = null; 30 | if (null == request) 31 | { 32 | throw new ArgumentNullException("request"); 33 | } 34 | Logger.LogDebug("MerchantInfo->LoginId/TransactionKey: '{0}':'{1}'->{2}", request.merchantAuthentication.name, request.merchantAuthentication.ItemElementName, request.merchantAuthentication.Item); 35 | 36 | var postUrl = GetPostUrl(env); 37 | 38 | string responseAsString = null; 39 | using (var clientHandler = new HttpClientHandler()) 40 | { 41 | clientHandler.Proxy = SetProxyIfRequested(clientHandler.Proxy, env); 42 | using (var client = new HttpClient(clientHandler)) 43 | { 44 | //set the http connection timeout 45 | var httpConnectionTimeout = AuthorizeNet.Environment.getIntProperty(Constants.HttpConnectionTimeout); 46 | client.Timeout = TimeSpan.FromMilliseconds(httpConnectionTimeout != 0 ? httpConnectionTimeout : Constants.HttpConnectionDefaultTimeout); 47 | var content = new StringContent(XmlUtility.Serialize(request), Encoding.UTF8, "text/xml"); 48 | var webResponse = client.PostAsync(postUrl, content).Result; 49 | Logger.LogDebug("Retrieving Response from Url: '{0}'", postUrl); 50 | 51 | // Get the response 52 | Logger.LogDebug("Received Response: '{0}'", webResponse); 53 | responseAsString = webResponse.Content.ReadAsStringAsync().Result; 54 | Logger.LogDebug("Response from Stream: '{0}'", responseAsString); 55 | 56 | } 57 | } 58 | if (null != responseAsString) 59 | { 60 | try 61 | { 62 | // try deserializing to the expected response type 63 | response = XmlUtility.Deserialize(responseAsString); 64 | } 65 | catch (Exception) 66 | { 67 | // probably a bad response, try if this is an error response 68 | response = XmlUtility.Deserialize(responseAsString); 69 | } 70 | 71 | //if error response 72 | if (response is ErrorResponse) 73 | { 74 | response = response as ErrorResponse; 75 | } 76 | } 77 | 78 | return response; 79 | } 80 | 81 | public static IWebProxy SetProxyIfRequested(IWebProxy proxy, AuthorizeNet.Environment env) 82 | { 83 | var newProxy = proxy as WebProxy; 84 | ICredentials credentials = null; 85 | 86 | if (env.HttpUseProxy) 87 | { 88 | var proxyUri = new Uri(string.Format("{0}://{1}:{2}", Constants.ProxyProtocol, env.HttpProxyHost, env.HttpProxyPort)); 89 | if (!_proxySet) 90 | { 91 | Logger.LogInformation(string.Format("Setting up proxy to URL: '{0}'", proxyUri)); 92 | _proxySet = true; 93 | } 94 | 95 | if (!string.IsNullOrEmpty(env.HttpsProxyUsername)) 96 | { 97 | //Set credentials 98 | credentials = new NetworkCredential(env.HttpsProxyUsername, env.HttpsProxyPassword); 99 | } 100 | 101 | if (null == proxy || null == newProxy) 102 | { 103 | if (credentials == null) 104 | { 105 | newProxy = new WebProxy(proxyUri); 106 | } 107 | else 108 | { 109 | newProxy = new WebProxy(proxyUri, true, null, credentials); 110 | } 111 | } 112 | } 113 | return (newProxy ?? proxy); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Utilities/LogFactory.cs: -------------------------------------------------------------------------------- 1 | namespace AuthorizeNet.Utilities 2 | { 3 | using System; 4 | using Microsoft.Extensions.Logging; 5 | 6 | public static class LogFactory 7 | { 8 | private static ILoggerFactory LoggerFactory => new LoggerFactory().AddDebug(LogLevel.Debug); 9 | 10 | public static ILogger getLog(Type classType) 11 | { 12 | return LoggerFactory.CreateLogger(classType.FullName); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNET/Utilities/XmlUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using System.Xml; 5 | using System.Xml.Serialization; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace AuthorizeNet.Utilities 9 | { 10 | public static class XmlUtility 11 | { 12 | 13 | private static readonly ILogger Logger = LogFactory.getLog(typeof(XmlUtility)); 14 | 15 | public static string Serialize(T entity) 16 | { 17 | string xmlString; 18 | var requestType = typeof(T); 19 | 20 | try 21 | { 22 | var serializer = new XmlSerializer(requestType); 23 | var settings = new XmlWriterSettings() { Encoding = new UTF8Encoding() }; 24 | using (var textWriter = new StringWriter()) 25 | { 26 | using (var xmlWriter = XmlWriter.Create(textWriter, settings)) 27 | { 28 | serializer.Serialize(xmlWriter, entity); 29 | } 30 | 31 | xmlString = textWriter.ToString(); 32 | } 33 | } 34 | catch (Exception e) 35 | { 36 | Logger.LogError("Error:'{0}' when serializing object:'{1}' to xml", e.Message, requestType); 37 | throw; 38 | } 39 | 40 | return xmlString; 41 | } 42 | 43 | public static T Deserialize(string xml) 44 | { 45 | var entity = default(T); 46 | 47 | if (!string.IsNullOrWhiteSpace(xml)) 48 | { 49 | var responseType = typeof(T); 50 | try 51 | { 52 | var serializer = new XmlSerializer(responseType); 53 | using (var reader = new StringReader(xml)) 54 | { 55 | entity = (T)serializer.Deserialize(reader); 56 | } 57 | } 58 | catch (Exception e) 59 | { 60 | Logger.LogError("Error:'{0}' when deserializing the into object:'{1}' from xml:'{2}'", e.Message, responseType, xml); 61 | throw; 62 | } 63 | } 64 | 65 | return entity; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /AuthorizeNET/AuthorizeNet.Core.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2018 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthorizeNET", "AuthorizeNET\AuthorizeNET.csproj", "{3F665C7E-A2E2-47E5-A032-E7D2F67AE165}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3F665C7E-A2E2-47E5-A032-E7D2F67AE165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3F665C7E-A2E2-47E5-A032-E7D2F67AE165}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3F665C7E-A2E2-47E5-A032-E7D2F67AE165}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3F665C7E-A2E2-47E5-A032-E7D2F67AE165}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {4998A08B-F729-405F-B70A-731F53C1983D} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /AuthorizeNetDotNetCore.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AuthorizeNet.DotnetCore 5 | 1.0.0 6 | AuthorizeNet.DotnetCore 7 | Authorize.Net 8 | AuthorizeNet 9 | https://github.com/AuthorizeNet/dotnet-core-sdk-beta/blob/master/LICENSE 10 | https://github.com/AuthorizeNet/dotnet-core-sdk-beta 11 | http://developer.authorize.net/resources/images/favicon.ico 12 | false 13 | Use this SDK to integrate with the Authorize.Net APIs for Payment Transactions, Recurring Billing and Customer Payment Profiles. 14 | Authorize.Net SDK for .Net Core 15 | Payments API Authorize.Net 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Authorize.Net 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Authorize.Net .NET Core SDK - Beta 2 | 3 | [//]: # "[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-dotnet.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-dotnet)" 4 | [//]: # "[![Code Climate](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet/badges/gpa.svg)](https://codeclimate.com/github/AuthorizeNet/sdk-dotnet)" 5 | 6 | 7 | 8 | ## Requirements 9 | * .NET Core 1.1.0 or later 10 | * Microsoft® Visual Studio 2017 or later 11 | * An Authorize.Net account (see _Registration & Configuration_ section below) 12 | 13 | ### TLS 1.2 14 | 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. 15 | 16 | 17 | ## Installation 18 | [//]: # "To install the AuthorizeNet .NET Core SDK, run the following command in the Package Manager Console:" 19 | 20 | [//]: # "`PM> Install-Package AuthorizeNet`" 21 | 22 | Since this is a beta release, the SDK will not be available in NuGet gallery at the moment. To facilitate testing by the developer community, we have pre-compiled the SDK and placed it in `ReleaseArtifact` folder. 23 | 24 | 25 | ## Registration & Configuration 26 | 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. 27 | 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/). 28 | 29 | ### Authentication 30 | 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). 31 | 32 | 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. 33 | 34 | #### To set your API credentials for an API request: 35 | ```csharp 36 | ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType() 37 | { 38 | name = "YOUR_API_LOGIN_ID", 39 | ItemElementName = ItemChoiceType.transactionKey, 40 | Item = "YOUR_TRANSACTION_KEY", 41 | }; 42 | ``` 43 | 44 | 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. 45 | 46 | ### Switching between the sandbox environment and the production environment 47 | 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: 48 | ```csharp 49 | // For PRODUCTION use 50 | ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.PRODUCTION; 51 | ``` 52 | 53 | API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments. 54 | 55 | 56 | ## SDK Usage Examples and Sample Code 57 | To get started using this SDK, it's highly recommended to download our sample code repository: 58 | * [Authorize.Net C# Sample Code Repository (on GitHub)](https://github.com/AuthorizeNet/sample-code-csharp) 59 | 60 | In that respository, we have comprehensive sample code for all common uses of our API: 61 | 62 | Additionally, you can find details and examples of how our API is structured in our API Reference Guide: 63 | * [Developer Center API Reference](http://developer.authorize.net/api/reference/index.html) 64 | 65 | 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. 66 | 67 | 68 | ## Building & Testing the SDK 69 | 70 | ### Running the SDK Tests 71 | All the tests can be run against a stub backend using the USELOCAL run configuration. 72 | 73 | Get a sandbox account at https://developer.authorize.net/sandbox/ 74 | Update app.config in the AuthorizeNetTest folder to run all the tests against your sandbox account 75 | 76 | For reporting tests, go to https://sandbox.authorize.net/ under Account tab->Transaction Details API and enable it. 77 | 78 | ### Testing Guide 79 | 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. 80 | 81 | 82 | ## License 83 | This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file. 84 | -------------------------------------------------------------------------------- /ReleaseArtifact/AuthorizeNET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AuthorizeNet/dotnet-core-sdk-beta/b5fb4cd51363c483b559c34a39169c91bb665331/ReleaseArtifact/AuthorizeNET.dll --------------------------------------------------------------------------------