Skip to content

Commit f41b545

Browse files
authored
Merge pull request #305 from AuthorizeNet/future
Future
2 parents c343d3e + 4e56678 commit f41b545

22 files changed

+481
-310
lines changed

.github/workflows/dotnet-workflow.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Authorize.net DotNet CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
env:
7+
sdk_dotnet: 'sdk-dotnet'
8+
sample_code_csharp: 'sample-code-csharp'
9+
jobs:
10+
workflow-job-build:
11+
defaults:
12+
run:
13+
shell: bash
14+
runs-on: windows-2019
15+
steps:
16+
- name: Checkout authorizenet/sdk-dotnet
17+
uses: actions/checkout@v4
18+
with:
19+
path: ${{env.sdk_dotnet}}
20+
21+
- name: Setup MSBuild
22+
uses: microsoft/setup-msbuild@v2
23+
24+
- name: Compile the SDK
25+
shell: pwsh
26+
run: |
27+
cd $Env:sdk_dotnet
28+
(Get-Content ./AuthorizeNETtest/App.config) | ForEach-Object { $_ -replace '<add key="api.login.id" value="API_LOGIN" />', '<add key="api.login.id" value="5KP3u95bQpv" />' } | ForEach-Object { $_ -replace '<add key="transaction.key" value="API_KEY" />', '<add key="transaction.key" value="346HZ32z3fP4hTG2" />' } | ForEach-Object { $_ -replace '<add key="md5.hash.key" value="" />', '<add key="md5.hash.key" value="MD5_TEST" />' } | Set-Content ./AuthorizeNETtest/App.config
29+
nuget install ./AuthorizeNETtest/packages.config -OutputDirectory packages
30+
msbuild -version
31+
msbuild "./AuthorizeNET.sln" -property:Configuration=Release -t:rebuild
32+
Write-Output "Build Successful"
33+
nuget pack AuthorizeNet.nuspec
34+
35+
- name: Upload SDK Nupkg
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: sdk-nupkg
39+
path: ${{env.sdk_dotnet}}/*.nupkg
40+
41+
- name: Run UnitTests
42+
uses: josepho0918/vstest-action@main
43+
with:
44+
testAssembly: AuthorizeNETtest.dll
45+
searchFolder: ${{env.sdk_dotnet}}/AuthorizeNETtest/bin/Release/
46+
runInParallel: true
47+
48+
workflow-job-integration-tests:
49+
defaults:
50+
run:
51+
shell: bash
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
operating-system: [windows-latest, windows-2019]
56+
net-framework-version: [4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1]
57+
exclude:
58+
- operating-system: windows-2019
59+
net-framework-version: 4.8.1
60+
- operating-system: windows-latest
61+
net-framework-version: 4.6.1
62+
needs: workflow-job-build
63+
runs-on: ${{matrix.operating-system}}
64+
steps:
65+
- name: Download SDK from previous job
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: sdk-nupkg
69+
path: sdk-nupkg
70+
71+
- name: Checkout authorizenet/sample-code-csharp
72+
uses: actions/checkout@v4
73+
with:
74+
repository: 'authorizenet/sample-code-csharp'
75+
ref: 'future'
76+
path: ${{env.sample_code_csharp}}
77+
78+
- name: Setup MSBuild
79+
uses: microsoft/setup-msbuild@v2
80+
81+
- name: Compile the Sample Application
82+
shell: pwsh
83+
run: |
84+
$clientSdkFolderName = (Get-ChildItem -Path sdk-nupkg -Filter "*nupkg" | Select-Object -First 1).BaseName
85+
$clientSdkVersion = $clientSdkFolderName.Substring(13)
86+
nuget Sources Add -Name "temporary_nuget_source" -Source ((Get-Location).Path + "\sdk-nupkg")
87+
88+
cd $Env:sample_code_csharp
89+
(Get-Content ./packages.config) | ForEach-Object { $_ -replace '.*<package\s*id="AuthorizeNet".*\/>', "<package id=`"AuthorizeNet`" version=`"$clientSdkVersion`" targetFramework=`"net461`" />" } | Set-Content ./packages.config
90+
91+
nuget install ./packages.config -OutputDirectory packages -Source temporary_nuget_source -Source https://api.nuget.org/v3/index.json
92+
nuget install ./SampleCodeTest/packages.config -OutputDirectory packages -Source temporary_nuget_source -Source https://api.nuget.org/v3/index.json
93+
94+
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>packages\\$clientSdkFolderName\\lib\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCode.csproj
95+
96+
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>..\\packages\\$clientSdkFolderName\\lib\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
97+
98+
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<TargetFrameworkVersion>)(.)+(</TargetFrameworkVersion>)", "<TargetFrameworkVersion>v${{matrix.net-framework-version}}</TargetFrameworkVersion>" } | Set-Content ./SampleCode.csproj
99+
100+
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<TargetFrameworkVersion>)(.)+(</TargetFrameworkVersion>)", "<TargetFrameworkVersion>v${{matrix.net-framework-version}}</TargetFrameworkVersion>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
101+
102+
msbuild -version
103+
msbuild "./SampleCode.sln" -property:Configuration=Debug -t:rebuild
104+
Write-Output "Build Successful"
105+
106+
- name: Run UnitTests
107+
uses: josepho0918/vstest-action@main
108+
with:
109+
testAssembly: SampleCodeTest.dll
110+
searchFolder: ${{env.sample_code_csharp}}/SampleCodeTest/bin/Debug/
111+
runInParallel: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,6 @@ UpgradeLog*.htm
181181

182182
# Microsoft Fakes
183183
FakesAssemblies/
184+
/NUnit.ConsoleRunner.3.13.0
185+
/.vs
186+
/nuget.exe

Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ public partial class customerPaymentProfileListItemType : object, System.Compone
298298
[System.Xml.Serialization.XmlIgnoreAttribute()]
299299
public bool originalAuthAmountSpecified;
300300

301+
/// <remarks/>
302+
public bool excludeFromAccountUpdater;
303+
304+
/// <remarks/>
305+
[System.Xml.Serialization.XmlIgnoreAttribute()]
306+
public bool excludeFromAccountUpdaterSpecified;
307+
301308
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
302309

303310
protected void RaisePropertyChanged(string propertyName) {
@@ -3502,6 +3509,13 @@ public partial class customerPaymentProfileMaskedType : customerPaymentProfileBa
35023509
/// <remarks/>
35033510
[System.Xml.Serialization.XmlIgnoreAttribute()]
35043511
public bool originalAuthAmountSpecified;
3512+
3513+
/// <remarks/>
3514+
public bool excludeFromAccountUpdater;
3515+
3516+
/// <remarks/>
3517+
[System.Xml.Serialization.XmlIgnoreAttribute()]
3518+
public bool excludeFromAccountUpdaterSpecified;
35053519
}
35063520

35073521
/// <remarks/>
@@ -3558,6 +3572,13 @@ public partial class customerPaymentProfileType : customerPaymentProfileBaseType
35583572

35593573
/// <remarks/>
35603574
public subsequentAuthInformation subsequentAuthInformation;
3575+
3576+
/// <remarks/>
3577+
public bool excludeFromAccountUpdater;
3578+
3579+
/// <remarks/>
3580+
[System.Xml.Serialization.XmlIgnoreAttribute()]
3581+
public bool excludeFromAccountUpdaterSpecified;
35613582
}
35623583

35633584
/// <remarks/>
@@ -5097,7 +5118,7 @@ public partial class getCustomerShippingAddressResponse : ANetApiResponse {
50975118
public partial class updateCustomerProfileRequest : ANetApiRequest {
50985119

50995120
/// <remarks/>
5100-
public customerProfileExType profile;
5121+
public customerProfileInfoExType profile;
51015122
}
51025123

51035124
/// <remarks/>

Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ public static void customerPaymentProfileListItemType(customerPaymentProfileList
4343
{
4444
if (null != argument)
4545
{
46-
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
46+
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
4747
customerAddressType(argument.billTo);
4848
paymentMaskedType(argument.payment);
49+
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true; }
4950
}
5051
}
5152

@@ -560,7 +561,7 @@ public static void transactionDetailsType(transactionDetailsType argument)
560561
if (null != argument.returnedItems) { foreach (var value in argument.returnedItems) { returnedItemType(value); } }
561562
solutionType(argument.solution);
562563

563-
if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} }
564+
if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value); } }
564565

565566
customerProfileIdType(argument.profile);
566567
extendedAmountType(argument.surcharge);
@@ -597,7 +598,7 @@ public static void creditCardMaskedType(creditCardMaskedType argument)
597598
if (null != argument)
598599
{
599600
cardArt(argument.cardArt);
600-
if(argument.isPaymentToken) { argument.isPaymentTokenSpecified=true;}
601+
if(argument.isPaymentToken) { argument.isPaymentTokenSpecified=true; }
601602
}
602603
}
603604
public static void cardArt(cardArt argument)
@@ -787,9 +788,10 @@ public static void customerPaymentProfileMaskedType(customerPaymentProfileMasked
787788
if (null != argument)
788789
{
789790
customerPaymentProfileBaseType(argument);
790-
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
791+
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
791792
paymentMaskedType(argument.payment);
792793
driversLicenseMaskedType(argument.driversLicense);
794+
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true; }
793795
}
794796
}
795797
public static void customerPaymentProfileType(customerPaymentProfileType argument)
@@ -799,8 +801,9 @@ public static void customerPaymentProfileType(customerPaymentProfileType argumen
799801
customerPaymentProfileBaseType(argument);
800802
paymentType(argument.payment);
801803
driversLicenseType(argument.driversLicense);
802-
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
804+
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
803805
subsequentAuthInformation(argument.subsequentAuthInformation);
806+
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true; }
804807
}
805808
}
806809
public static void customerPaymentProfileExType(customerPaymentProfileExType argument)
@@ -830,15 +833,15 @@ public static void customerProfileMaskedType(customerProfileMaskedType argument)
830833
customerProfileExType(argument);
831834
if (null != argument.paymentProfiles) { foreach (var value in argument.paymentProfiles) { customerPaymentProfileMaskedType(value); } }
832835
if (null != argument.shipToList) { foreach (var value in argument.shipToList) { customerAddressExType(value); } }
833-
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
836+
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
834837
}
835838
}
836839
public static void customerProfileInfoExType(customerProfileInfoExType argument)
837840
{
838841
if(null != argument)
839842
{
840843
customerProfileExType (argument);
841-
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
844+
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
842845
}
843846
}
844847
public static void customerProfileType(customerProfileType argument)
@@ -848,7 +851,7 @@ public static void customerProfileType(customerProfileType argument)
848851
customerProfileBaseType(argument);
849852
if (null != argument.paymentProfiles) { foreach (var value in argument.paymentProfiles) { customerPaymentProfileType(value); } }
850853
if (null != argument.shipToList) { foreach (var value in argument.shipToList) { customerAddressType(value); } }
851-
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
854+
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
852855
}
853856
}
854857
public static void ContactDetailType(ContactDetailType argument)
@@ -1131,17 +1134,17 @@ public static void createCustomerProfileFromTransactionRequest(createCustomerPro
11311134
if (null != argument)
11321135
{
11331136
customerProfileBaseType(argument.customer);
1134-
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
1135-
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;}
1136-
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
1137+
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
1138+
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true; }
1139+
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
11371140
}
11381141
}
11391142
public static void getCustomerProfileRequest(getCustomerProfileRequest argument)
11401143
{
11411144
if (null != argument)
11421145
{
1143-
if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;}
1144-
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;}
1146+
if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true; }
1147+
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true; }
11451148

11461149
}
11471150
}
@@ -1156,7 +1159,7 @@ public static void getCustomerPaymentProfileRequest(getCustomerPaymentProfileReq
11561159
{
11571160
if (null != argument)
11581161
{
1159-
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;}
1162+
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true; }
11601163

11611164
}
11621165
}
@@ -1177,7 +1180,7 @@ public static void getCustomerShippingAddressResponse(getCustomerShippingAddress
11771180
{
11781181
if (null != argument)
11791182
{
1180-
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;}
1183+
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true; }
11811184
customerAddressExType(argument.address);
11821185
}
11831186
}
@@ -1220,7 +1223,7 @@ public static void updateCustomerShippingAddressRequest(updateCustomerShippingAd
12201223
if (null != argument)
12211224
{
12221225
customerAddressExType(argument.address);
1223-
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;}
1226+
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true; }
12241227
}
12251228
}
12261229
public static void updateCustomerShippingAddressResponse(updateCustomerShippingAddressResponse argument)
@@ -1432,7 +1435,7 @@ public static void getHostedPaymentPageRequest(getHostedPaymentPageRequest argum
14321435
if(null != argument)
14331436
{
14341437
transactionRequestType(argument.transactionRequest);
1435-
if(null != argument.hostedPaymentSettings){ foreach( var value in argument.hostedPaymentSettings) { settingType(value);} }
1438+
if(null != argument.hostedPaymentSettings){ foreach( var value in argument.hostedPaymentSettings) { settingType(value); } }
14361439
}
14371440
}
14381441
public static void getHostedPaymentPageResponse(getHostedPaymentPageResponse argument)
@@ -1607,23 +1610,23 @@ public static void getAUJobSummaryResponse(getAUJobSummaryResponse argument)
16071610
{
16081611
if(null != argument)
16091612
{
1610-
if(null != argument.auSummary){ foreach( var value in argument.auSummary) { auResponseType(value);} }
1613+
if(null != argument.auSummary){ foreach( var value in argument.auSummary) { auResponseType(value); } }
16111614
}
16121615
}
16131616
public static void getAUJobDetailsRequest(getAUJobDetailsRequest argument)
16141617
{
16151618
if(null != argument)
16161619
{
1617-
if(0 <= argument.modifiedTypeFilter) { argument.modifiedTypeFilterSpecified=true;}
1620+
if(0 <= argument.modifiedTypeFilter) { argument.modifiedTypeFilterSpecified=true; }
16181621
Paging(argument.paging);
16191622
}
16201623
}
16211624
public static void getAUJobDetailsResponse(getAUJobDetailsResponse argument)
16221625
{
16231626
if(null != argument)
16241627
{
1625-
if(0 <= argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true;}
1626-
if(null != argument.auDetails){ foreach( var value in argument.auDetails) { auDetailsType(value);} }
1628+
if(0 <= argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true; }
1629+
if(null != argument.auDetails){ foreach( var value in argument.auDetails) { auDetailsType(value); } }
16271630
}
16281631
}
16291632

@@ -1636,8 +1639,8 @@ public static void getMerchantDetailsResponse(getMerchantDetailsResponse argumen
16361639
{
16371640
if(null != argument)
16381641
{
1639-
if(argument.isTestMode) { argument.isTestModeSpecified=true;}
1640-
if(null != argument.processors){ foreach( var value in argument.processors) { processorType(value);} }
1642+
if(argument.isTestMode) { argument.isTestModeSpecified=true; }
1643+
if(null != argument.processors){ foreach( var value in argument.processors) { processorType(value); } }
16411644
customerAddressType(argument.businessInformation);
16421645
if (null != argument.contactDetails) { foreach (var value in argument.contactDetails) { ContactDetailType(value); } }
16431646
}

Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.generated.org

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ namespace AuthorizeNet.Api.Contracts.V1
9494
customerAddressType(argument.billTo);
9595
paymentMaskedType(argument.payment);
9696
if(argument.originalAuthAmount) { argument.originalAuthAmountSpecified=true;}
97+
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true;}
9798
}
9899
}
99100
public static void customerAddressType(customerAddressType argument)
@@ -738,6 +739,7 @@ transRetailInfoType() {
738739
paymentMaskedType(argument.payment);
739740
driversLicenseMaskedType(argument.driversLicense);
740741
if(argument.originalAuthAmount) { argument.originalAuthAmountSpecified=true;}
742+
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true;}
741743
}
742744
}
743745
public static void driversLicenseMaskedType(driversLicenseMaskedType argument)
@@ -755,6 +757,7 @@ transRetailInfoType() {
755757
driversLicenseType(argument.driversLicense);
756758
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
757759
subsequentAuthInformation(argument.subsequentAuthInformation);
760+
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true;}
758761
}
759762
}
760763
public static void customerPaymentProfileExType(customerPaymentProfileExType argument)
@@ -1192,7 +1195,7 @@ transRetailInfoType() {
11921195
{
11931196
if(null != argument)
11941197
{
1195-
customerProfileExType(argument.profile);
1198+
customerProfileInfoExType(argument.profile);
11961199
}
11971200
}
11981201
public static void updateCustomerProfileResponse(updateCustomerProfileResponse argument)

0 commit comments

Comments
 (0)