Skip to content

Commit

Permalink
Merge pull request #305 from AuthorizeNet/future
Browse files Browse the repository at this point in the history
Future
  • Loading branch information
gnongsie authored Sep 18, 2024
2 parents c343d3e + 4e56678 commit f41b545
Show file tree
Hide file tree
Showing 22 changed files with 481 additions and 310 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/dotnet-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Authorize.net DotNet CI
on:
push:
pull_request:
workflow_dispatch:
env:
sdk_dotnet: 'sdk-dotnet'
sample_code_csharp: 'sample-code-csharp'
jobs:
workflow-job-build:
defaults:
run:
shell: bash
runs-on: windows-2019
steps:
- name: Checkout authorizenet/sdk-dotnet
uses: actions/checkout@v4
with:
path: ${{env.sdk_dotnet}}

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Compile the SDK
shell: pwsh
run: |
cd $Env:sdk_dotnet
(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
nuget install ./AuthorizeNETtest/packages.config -OutputDirectory packages
msbuild -version
msbuild "./AuthorizeNET.sln" -property:Configuration=Release -t:rebuild
Write-Output "Build Successful"
nuget pack AuthorizeNet.nuspec
- name: Upload SDK Nupkg
uses: actions/upload-artifact@v4
with:
name: sdk-nupkg
path: ${{env.sdk_dotnet}}/*.nupkg

- name: Run UnitTests
uses: josepho0918/vstest-action@main
with:
testAssembly: AuthorizeNETtest.dll
searchFolder: ${{env.sdk_dotnet}}/AuthorizeNETtest/bin/Release/
runInParallel: true

workflow-job-integration-tests:
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
operating-system: [windows-latest, windows-2019]
net-framework-version: [4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1]
exclude:
- operating-system: windows-2019
net-framework-version: 4.8.1
- operating-system: windows-latest
net-framework-version: 4.6.1
needs: workflow-job-build
runs-on: ${{matrix.operating-system}}
steps:
- name: Download SDK from previous job
uses: actions/download-artifact@v4
with:
name: sdk-nupkg
path: sdk-nupkg

- name: Checkout authorizenet/sample-code-csharp
uses: actions/checkout@v4
with:
repository: 'authorizenet/sample-code-csharp'
ref: 'future'
path: ${{env.sample_code_csharp}}

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Compile the Sample Application
shell: pwsh
run: |
$clientSdkFolderName = (Get-ChildItem -Path sdk-nupkg -Filter "*nupkg" | Select-Object -First 1).BaseName
$clientSdkVersion = $clientSdkFolderName.Substring(13)
nuget Sources Add -Name "temporary_nuget_source" -Source ((Get-Location).Path + "\sdk-nupkg")
cd $Env:sample_code_csharp
(Get-Content ./packages.config) | ForEach-Object { $_ -replace '.*<package\s*id="AuthorizeNet".*\/>', "<package id=`"AuthorizeNet`" version=`"$clientSdkVersion`" targetFramework=`"net461`" />" } | Set-Content ./packages.config
nuget install ./packages.config -OutputDirectory packages -Source temporary_nuget_source -Source https://api.nuget.org/v3/index.json
nuget install ./SampleCodeTest/packages.config -OutputDirectory packages -Source temporary_nuget_source -Source https://api.nuget.org/v3/index.json
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>packages\\$clientSdkFolderName\\lib\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCode.csproj
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<HintPath>)(.)+(AuthorizeNet.dll</HintPath>)", "<HintPath>..\\packages\\$clientSdkFolderName\\lib\\AuthorizeNet.dll</HintPath>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
(Get-Content ./SampleCode.csproj) | ForEach-Object { $_ -replace "(<TargetFrameworkVersion>)(.)+(</TargetFrameworkVersion>)", "<TargetFrameworkVersion>v${{matrix.net-framework-version}}</TargetFrameworkVersion>" } | Set-Content ./SampleCode.csproj
(Get-Content ./SampleCodeTest/SampleCodeTest.csproj) | ForEach-Object { $_ -replace "(<TargetFrameworkVersion>)(.)+(</TargetFrameworkVersion>)", "<TargetFrameworkVersion>v${{matrix.net-framework-version}}</TargetFrameworkVersion>" } | Set-Content ./SampleCodeTest/SampleCodeTest.csproj
msbuild -version
msbuild "./SampleCode.sln" -property:Configuration=Debug -t:rebuild
Write-Output "Build Successful"
- name: Run UnitTests
uses: josepho0918/vstest-action@main
with:
testAssembly: SampleCodeTest.dll
searchFolder: ${{env.sample_code_csharp}}/SampleCodeTest/bin/Debug/
runInParallel: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,6 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/
/NUnit.ConsoleRunner.3.13.0
/.vs
/nuget.exe
23 changes: 22 additions & 1 deletion Authorize.NET/Api/Contracts/V1/AnetApiSchema.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ public partial class customerPaymentProfileListItemType : object, System.Compone
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool originalAuthAmountSpecified;

/// <remarks/>
public bool excludeFromAccountUpdater;

/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool excludeFromAccountUpdaterSpecified;

public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

protected void RaisePropertyChanged(string propertyName) {
Expand Down Expand Up @@ -3502,6 +3509,13 @@ public partial class customerPaymentProfileMaskedType : customerPaymentProfileBa
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool originalAuthAmountSpecified;

/// <remarks/>
public bool excludeFromAccountUpdater;

/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool excludeFromAccountUpdaterSpecified;
}

/// <remarks/>
Expand Down Expand Up @@ -3558,6 +3572,13 @@ public partial class customerPaymentProfileType : customerPaymentProfileBaseType

/// <remarks/>
public subsequentAuthInformation subsequentAuthInformation;

/// <remarks/>
public bool excludeFromAccountUpdater;

/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool excludeFromAccountUpdaterSpecified;
}

/// <remarks/>
Expand Down Expand Up @@ -5097,7 +5118,7 @@ public partial class getCustomerShippingAddressResponse : ANetApiResponse {
public partial class updateCustomerProfileRequest : ANetApiRequest {

/// <remarks/>
public customerProfileExType profile;
public customerProfileInfoExType profile;
}

/// <remarks/>
Expand Down
49 changes: 26 additions & 23 deletions Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ public static void customerPaymentProfileListItemType(customerPaymentProfileList
{
if (null != argument)
{
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
customerAddressType(argument.billTo);
paymentMaskedType(argument.payment);
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true; }
}
}

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

if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value);} }
if(null != argument.emvDetails){ foreach( var value in argument.emvDetails) { transactionDetailsTypeTag(value); } }

customerProfileIdType(argument.profile);
extendedAmountType(argument.surcharge);
Expand Down Expand Up @@ -597,7 +598,7 @@ public static void creditCardMaskedType(creditCardMaskedType argument)
if (null != argument)
{
cardArt(argument.cardArt);
if(argument.isPaymentToken) { argument.isPaymentTokenSpecified=true;}
if(argument.isPaymentToken) { argument.isPaymentTokenSpecified=true; }
}
}
public static void cardArt(cardArt argument)
Expand Down Expand Up @@ -787,9 +788,10 @@ public static void customerPaymentProfileMaskedType(customerPaymentProfileMasked
if (null != argument)
{
customerPaymentProfileBaseType(argument);
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
paymentMaskedType(argument.payment);
driversLicenseMaskedType(argument.driversLicense);
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true; }
}
}
public static void customerPaymentProfileType(customerPaymentProfileType argument)
Expand All @@ -799,8 +801,9 @@ public static void customerPaymentProfileType(customerPaymentProfileType argumen
customerPaymentProfileBaseType(argument);
paymentType(argument.payment);
driversLicenseType(argument.driversLicense);
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
subsequentAuthInformation(argument.subsequentAuthInformation);
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true; }
}
}
public static void customerPaymentProfileExType(customerPaymentProfileExType argument)
Expand Down Expand Up @@ -830,15 +833,15 @@ public static void customerProfileMaskedType(customerProfileMaskedType argument)
customerProfileExType(argument);
if (null != argument.paymentProfiles) { foreach (var value in argument.paymentProfiles) { customerPaymentProfileMaskedType(value); } }
if (null != argument.shipToList) { foreach (var value in argument.shipToList) { customerAddressExType(value); } }
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
}
}
public static void customerProfileInfoExType(customerProfileInfoExType argument)
{
if(null != argument)
{
customerProfileExType (argument);
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
}
}
public static void customerProfileType(customerProfileType argument)
Expand All @@ -848,7 +851,7 @@ public static void customerProfileType(customerProfileType argument)
customerProfileBaseType(argument);
if (null != argument.paymentProfiles) { foreach (var value in argument.paymentProfiles) { customerPaymentProfileType(value); } }
if (null != argument.shipToList) { foreach (var value in argument.shipToList) { customerAddressType(value); } }
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
}
}
public static void ContactDetailType(ContactDetailType argument)
Expand Down Expand Up @@ -1131,17 +1134,17 @@ public static void createCustomerProfileFromTransactionRequest(createCustomerPro
if (null != argument)
{
customerProfileBaseType(argument.customer);
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;}
if(0 <= argument.profileType) { argument.profileTypeSpecified=true;}
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true; }
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true; }
if(0 <= argument.profileType) { argument.profileTypeSpecified=true; }
}
}
public static void getCustomerProfileRequest(getCustomerProfileRequest argument)
{
if (null != argument)
{
if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true;}
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;}
if(argument.unmaskExpirationDate) { argument.unmaskExpirationDateSpecified=true; }
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true; }

}
}
Expand All @@ -1156,7 +1159,7 @@ public static void getCustomerPaymentProfileRequest(getCustomerPaymentProfileReq
{
if (null != argument)
{
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true;}
if(argument.includeIssuerInfo) { argument.includeIssuerInfoSpecified=true; }

}
}
Expand All @@ -1177,7 +1180,7 @@ public static void getCustomerShippingAddressResponse(getCustomerShippingAddress
{
if (null != argument)
{
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;}
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true; }
customerAddressExType(argument.address);
}
}
Expand Down Expand Up @@ -1220,7 +1223,7 @@ public static void updateCustomerShippingAddressRequest(updateCustomerShippingAd
if (null != argument)
{
customerAddressExType(argument.address);
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true;}
if(argument.defaultShippingAddress) { argument.defaultShippingAddressSpecified=true; }
}
}
public static void updateCustomerShippingAddressResponse(updateCustomerShippingAddressResponse argument)
Expand Down Expand Up @@ -1432,7 +1435,7 @@ public static void getHostedPaymentPageRequest(getHostedPaymentPageRequest argum
if(null != argument)
{
transactionRequestType(argument.transactionRequest);
if(null != argument.hostedPaymentSettings){ foreach( var value in argument.hostedPaymentSettings) { settingType(value);} }
if(null != argument.hostedPaymentSettings){ foreach( var value in argument.hostedPaymentSettings) { settingType(value); } }
}
}
public static void getHostedPaymentPageResponse(getHostedPaymentPageResponse argument)
Expand Down Expand Up @@ -1607,23 +1610,23 @@ public static void getAUJobSummaryResponse(getAUJobSummaryResponse argument)
{
if(null != argument)
{
if(null != argument.auSummary){ foreach( var value in argument.auSummary) { auResponseType(value);} }
if(null != argument.auSummary){ foreach( var value in argument.auSummary) { auResponseType(value); } }
}
}
public static void getAUJobDetailsRequest(getAUJobDetailsRequest argument)
{
if(null != argument)
{
if(0 <= argument.modifiedTypeFilter) { argument.modifiedTypeFilterSpecified=true;}
if(0 <= argument.modifiedTypeFilter) { argument.modifiedTypeFilterSpecified=true; }
Paging(argument.paging);
}
}
public static void getAUJobDetailsResponse(getAUJobDetailsResponse argument)
{
if(null != argument)
{
if(0 <= argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true;}
if(null != argument.auDetails){ foreach( var value in argument.auDetails) { auDetailsType(value);} }
if(0 <= argument.totalNumInResultSet) { argument.totalNumInResultSetSpecified=true; }
if(null != argument.auDetails){ foreach( var value in argument.auDetails) { auDetailsType(value); } }
}
}

Expand All @@ -1636,8 +1639,8 @@ public static void getMerchantDetailsResponse(getMerchantDetailsResponse argumen
{
if(null != argument)
{
if(argument.isTestMode) { argument.isTestModeSpecified=true;}
if(null != argument.processors){ foreach( var value in argument.processors) { processorType(value);} }
if(argument.isTestMode) { argument.isTestModeSpecified=true; }
if(null != argument.processors){ foreach( var value in argument.processors) { processorType(value); } }
customerAddressType(argument.businessInformation);
if (null != argument.contactDetails) { foreach (var value in argument.contactDetails) { ContactDetailType(value); } }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ namespace AuthorizeNet.Api.Contracts.V1
customerAddressType(argument.billTo);
paymentMaskedType(argument.payment);
if(argument.originalAuthAmount) { argument.originalAuthAmountSpecified=true;}
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true;}
}
}
public static void customerAddressType(customerAddressType argument)
Expand Down Expand Up @@ -738,6 +739,7 @@ transRetailInfoType() {
paymentMaskedType(argument.payment);
driversLicenseMaskedType(argument.driversLicense);
if(argument.originalAuthAmount) { argument.originalAuthAmountSpecified=true;}
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true;}
}
}
public static void driversLicenseMaskedType(driversLicenseMaskedType argument)
Expand All @@ -755,6 +757,7 @@ transRetailInfoType() {
driversLicenseType(argument.driversLicense);
if(argument.defaultPaymentProfile) { argument.defaultPaymentProfileSpecified=true;}
subsequentAuthInformation(argument.subsequentAuthInformation);
if(argument.excludeFromAccountUpdater) { argument.excludeFromAccountUpdaterSpecified=true;}
}
}
public static void customerPaymentProfileExType(customerPaymentProfileExType argument)
Expand Down Expand Up @@ -1192,7 +1195,7 @@ transRetailInfoType() {
{
if(null != argument)
{
customerProfileExType(argument.profile);
customerProfileInfoExType(argument.profile);
}
}
public static void updateCustomerProfileResponse(updateCustomerProfileResponse argument)
Expand Down
Loading

0 comments on commit f41b545

Please sign in to comment.