Skip to content

Commit

Permalink
Merge pull request #617 from SwedbankPay/release/4.0.0
Browse files Browse the repository at this point in the history
Merge Release/4.0.0 -> master
  • Loading branch information
zunkas authored Mar 7, 2024
2 parents bc486b4 + 6ad7530 commit 58c0a61
Show file tree
Hide file tree
Showing 823 changed files with 13,251 additions and 28,053 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ updates:
time: "03:00"
timezone: Europe/Oslo
open-pull-requests-limit: 99
reviewers: [zunkas, perhassle]
reviewers: [zunkas]
assignees: [zunkas]
- package-ecosystem: github-actions
directory: "/"
Expand Down
4 changes: 2 additions & 2 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ pull_request_rules:
- author~=^dependabot(|-preview)\[bot\]$
actions:
queue:
method: merge
method: squash
name: default

- name: Thank contributor
conditions:
- merged
actions:
comment:
message: "Thank you @{{author}} for your contribution!"
message: "Thank you @{{author}} for your contribution!"
6 changes: 2 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
Configuration: Debug
NUGETVERSIONV2: ${{ needs.callVersion.outputs.NUGETVERSIONV2 }}
SlnPath: ./src/SwedbankPay.Sdk.sln
SdkCsprojPath: ./src/SwedbankPay.Sdk/SwedbankPay.Sdk.csproj
SdkCsprojPath: ./src/SwedbankPay.Sdk.Infrastructure/SwedbankPay.Sdk.Infrastructure.csproj
SampleSiteCsprojPath: ./src/Samples/Sample.AspNetCore/Sample.AspNetCore.csproj
SystemTestsCsprojPath: ./src/Samples/Sample.AspNetCore.SystemTests/Sample.AspNetCore.SystemTests.csproj
UnitTestsCsprojPath: ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
IntegrationTestsCsprojPath: ./src/SwedbankPay.Sdk.IntegrationTests/SwedbankPay.Sdk.IntegrationTests.csproj
UnitTestsCsprojPath: ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
8 changes: 3 additions & 5 deletions .github/workflows/pro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ jobs:
needs: [callVersion]
name: Build and publish artifact
uses: ./.github/workflows/template_build.yml
secrets: inherit
secrets: inherit
with:
Configuration: Release
NUGETVERSIONV2: ${{ needs.callVersion.outputs.NUGETVERSIONV2 }}
SlnPath: ./src/SwedbankPay.Sdk.sln
SdkCsprojPath: ./src/SwedbankPay.Sdk/SwedbankPay.Sdk.csproj
SdkCsprojPath: ./src/SwedbankPay.Sdk.Infrastructure/SwedbankPay.Sdk.Infrastructure.csproj
SampleSiteCsprojPath: ./src/Samples/Sample.AspNetCore/Sample.AspNetCore.csproj
SystemTestsCsprojPath: ./src/Samples/Sample.AspNetCore.SystemTests/Sample.AspNetCore.SystemTests.csproj
UnitTestsCsprojPath: ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
IntegrationTestsCsprojPath: ./src/SwedbankPay.Sdk.IntegrationTests/SwedbankPay.Sdk.IntegrationTests.csproj
UnitTestsCsprojPath: ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
60 changes: 10 additions & 50 deletions .github/workflows/template_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ on:
SampleSiteCsprojPath:
required: true
type: string
SystemTestsCsprojPath:
required: true
type: string
UnitTestsCsprojPath:
required: true
type: string
IntegrationTestsCsprojPath:
required: true
type: string

env:
dotnetVersion: |
5.x
6.x
7.x
8.x
AZURE_WEBAPP_PACKAGE_PATH: '.'

jobs:
Expand All @@ -40,10 +35,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnetVersion }}

Expand All @@ -54,58 +49,23 @@ jobs:
run: dotnet publish --configuration ${{ inputs.Configuration }} -p:Version=${{ inputs.nuGetVersionV2 }} --no-restore ${{ inputs.SampleSiteCsprojPath }} --output '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/samplesite'

- name: Archive Sample.AspNetCore
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Sample.AspNetCore
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/samplesite

- name: Publish Sdk Unit tests
run: dotnet publish --configuration ${{ inputs.Configuration }} -p:Version=${{ inputs.nuGetVersionV2 }} --no-restore ${{ inputs.UnitTestsCsprojPath }} --output '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/unittests' --os win

- name: Archive Sdk Unit tests
uses: actions/upload-artifact@v3
with:
name: Sdk.UnitTests
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/unittests

- name: Publish Sdk Integration tests
run: dotnet publish --configuration ${{ inputs.Configuration }} -p:Version=${{ inputs.nuGetVersionV2 }} --no-restore ${{ inputs.IntegrationTestsCsprojPath }} --output '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/integrationtests' --os win

- name: Archive Sdk Integration tests
uses: actions/upload-artifact@v3
with:
name: Sdk.IntegrationTests
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/integrationtests

- name: Verify chrome driver
shell: pwsh
run: |
./src/Samples/Sample.AspNetCore.SystemTests/chrome-driver-udpate.ps1
- name: Publish Sdk Sample site system test
run: dotnet publish --configuration ${{ inputs.Configuration }} -p:Version=${{ inputs.nuGetVersionV2 }} ${{ inputs.SystemTestsCsprojPath }} --output '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/systemtests' --os win

- name: Copy wwwroot to publish directory
shell: pwsh
run: |
Copy-Item -Path "./src/Samples/Sample.AspNetCore/wwwroot" -Destination "./systemtests/wwwroot" -Recurse -Force
- name: Archive Sample.AspNetCore.SystemTests
uses: actions/upload-artifact@v3
with:
name: Sample.AspNetCore.SystemTests
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/systemtests

- name: Nuget pack SwedbankPay.Sdk
run: dotnet pack ./src/SwedbankPay.Sdk.Infrastructure/SwedbankPay.Sdk.Infrastructure.csproj -p:PackageVersion=${{ inputs.NUGETVERSIONV2 }} -p:Version=${{ inputs.NUGETVERSIONV2 }} --no-restore --configuration=${{ inputs.Configuration }} --output=artifacts
run: dotnet pack ${{ inputs.SdkCsprojPath }} -p:PackageVersion=${{ inputs.NUGETVERSIONV2 }} -p:Version=${{ inputs.NUGETVERSIONV2 }} --no-restore --configuration=${{ inputs.Configuration }} --output=artifacts

- name: Nuget pack SwedbankPay.Sdk.Extensions
run: dotnet pack ./src/SwedbankPay.Sdk.Extensions/SwedbankPay.Sdk.Extensions.csproj -p:PackageVersion=${{ inputs.NUGETVERSIONV2 }} -p:Version=${{ inputs.NUGETVERSIONV2 }} --no-restore --configuration=${{ inputs.Configuration }} --output=artifacts

- name: Archive nuget packages artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
# Artifact name
name: packages
# A file, directory or wildcard pattern that describes what to upload
path: artifacts/*.nupkg
path: |
artifacts/*.nupkg
artifacts/*.snupkg
2 changes: 1 addition & 1 deletion .github/workflows/template_publish_webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
Urls.HostUrls.0: https://swedbankpay-sdk-001-${{ inputs.Environment }}.azurewebsites.net/

- name: 'Run Azure webapp deploy using publish profile credentials'
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: ${{ secrets.AZURE_WEBAPP_NAME }} # Replace with your app name
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/template_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ jobs:
NUGETVERSIONV2: ${{ steps.gitversion.outputs.NUGETVERSIONV2 }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x.x'

- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
versionSpec: '5.x'

- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.15
uses: gittools/actions/gitversion/execute@v0
52 changes: 26 additions & 26 deletions .github/workflows/test_deploy_samplesite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:

env:
dotnetVersion: |
5.x
6.x
8.x
jobs:
test-unit-ui:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: windows-latest
runs-on: ubuntu-latest
environment: ${{ github.event.workflow_run.name }}
outputs:
sourceHeadRepo: ${{ steps.source-run-info.outputs.sourceHeadRepo }}
Expand All @@ -34,39 +34,39 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}

- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnetVersion }}

- name: Run SDK Unit Tests
run: dotnet test Sdk.UnitTests/SwedbankPay.Sdk.Tests.dll
dotnet-version: ${{ env.dotnetVersion }}

- name: Run SDK Integration Tests
run: dotnet test Sdk.IntegrationTests/SwedbankPay.Sdk.IntegrationTests.dll
env:
SwedbankPay:Token: ${{ secrets.MERCHANT_TOKEN }}
SwedbankPay:TokenMobilePay: ${{ secrets.MERCHANT_TOKEN_MOBILE_PAY }}
SwedbankPay:PayeeId: ${{ secrets.MERCHANT_PAYEEID }}
run: |
export SwedbankPay__PayeeId=${{ secrets.MERCHANT_PAYEEID }}
export SwedbankPay__Token=${{ secrets.MERCHANT_TOKEN }}
dotnet test ./src/SwedbankPay.Sdk.IntegrationTests/SwedbankPay.Sdk.IntegrationTests.csproj
- name: Run SDK Unit Tests
run: |
export SwedbankPay__PayeeId=${{ secrets.MERCHANT_PAYEEID }}
export SwedbankPay__Token=${{ secrets.MERCHANT_TOKEN }}
dotnet test ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
- name: Run SDK Sample project tests
run: dotnet test Sample.AspNetCore.SystemTests/Sample.AspNetCore.SystemTests.dll -v n
- name: Cypress run
uses: cypress-io/github-action@v6
with:
working-directory: ./src/Samples/Sample.AspNetCore.UiTests
start: dotnet run --project ../Sample.AspNetCore/Sample.AspNetCore.csproj --urls https://localhost:5001 --SwedbankPay:PayeeId ${{ secrets.MERCHANT_PAYEEID }} --SwedbankPay:Token ${{ secrets.MERCHANT_TOKEN }}
wait-on: 'https://localhost:5001'
browser: chrome
env:
SwedbankPay:Token: ${{ secrets.MERCHANT_TOKEN }}
SwedbankPay:TokenMobilePay: ${{ secrets.MERCHANT_TOKEN_MOBILE_PAY }}
SwedbankPay:PayeeId: ${{ secrets.MERCHANT_PAYEEID }}
SwedbankPay:Sdk:SampleWebsite:BaseUrl: https://localhost:5001
NODE_TLS_REJECT_UNAUTHORIZED: 0


- name: Commit Action Status
if: ${{ always() }}
uses: LouisBrunner/checks-action@v1.5.0
uses: LouisBrunner/checks-action@v2.0.0
with:
sha: ${{ steps.source-run-info.outputs.sourceHeadSha }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -83,7 +83,7 @@ jobs:
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v3
with:
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ jobs:
SlnPath: ./src/SwedbankPay.Sdk.sln
SdkCsprojPath: ./src/SwedbankPay.Sdk/SwedbankPay.Sdk.csproj
SampleSiteCsprojPath: ./src/Samples/Sample.AspNetCore/Sample.AspNetCore.csproj
SystemTestsCsprojPath: ./src/Samples/Sample.AspNetCore.SystemTests/Sample.AspNetCore.SystemTests.csproj
UnitTestsCsprojPath: ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
IntegrationTestsCsprojPath: ./src/SwedbankPay.Sdk.IntegrationTests/SwedbankPay.Sdk.IntegrationTests.csproj
UnitTestsCsprojPath: ./src/SwedbankPay.Sdk.Tests/SwedbankPay.Sdk.Tests.csproj
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ dlldata.c
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
*_p.c
Expand Down Expand Up @@ -295,4 +294,7 @@ tools/**

*.local.json

*.snupkg
*.snupkg

.DS_Store
src/Samples/Sample.AspNetCore.UiTests/cypress/reports
24 changes: 0 additions & 24 deletions Linux.Dockerfile

This file was deleted.

15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,14 @@ support, please wait for a future, stable release.

## Supported APIs

- **Payment Order**
- **Payment Order v3**
- create payment order
- get payment order
- capture
- cancel
- reversal
- abort
- **Swish Payments**
- create swish payment
- get swish payment
- abort
- reversal
- **Card Payments**
- create card payment
- get card payment
- capture
- cancel
- reversal


## Sample App

Check the [the samples folder][samples].
Expand Down
23 changes: 0 additions & 23 deletions Windows.Dockerfile

This file was deleted.

Loading

0 comments on commit 58c0a61

Please sign in to comment.