From 8c68411e45cc70c8b1da0d90a0a538c96f35d07d Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Fri, 21 Jul 2023 14:36:52 +0200 Subject: [PATCH 1/7] Update PyPI badge link to PyPI (#254) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc3ecf74..f8d14f48 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Adyen APIs Library for Python -[![version](https://img.shields.io/pypi/v/Adyen.svg)](https://docs.adyen.com/development-resources/libraries) +[![version](https://img.shields.io/pypi/v/Adyen.svg)](https://pypi.org/project/Adyen/) This is the officially supported Python library for using Adyen's APIs. From 506bbac497ccbfde182be18975bf3f829a229e8a Mon Sep 17 00:00:00 2001 From: leandromagnabosco <105861049+leandromagnabosco@users.noreply.github.com> Date: Tue, 25 Jul 2023 13:59:51 +0200 Subject: [PATCH 2/7] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3cfc6df4..08bb43df 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Adyen/api-libraries-reviewers @rikterbeek @acampos1916 @candemiralp +* @Adyen/integration-tools-testing From 0105bd9c7f22c69fd4e340dc8d3091651c57ccb5 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Fri, 28 Jul 2023 14:35:12 +0200 Subject: [PATCH 3/7] Migrate release automation (#257) * Migrate workflows * Release targets --- .github/workflows/gh-release.yml | 43 +++++----------------- .github/workflows/release.yml | 61 ++++---------------------------- Makefile | 11 ++++++ 3 files changed, 25 insertions(+), 90 deletions(-) diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 358501ea..23550c47 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -1,43 +1,16 @@ name: Github Release on: - workflow_dispatch: - push: - branches: - - main + workflow_dispatch: + push: + branches: + - main jobs: gh_release: permissions: contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - - name: Get the release script - run: | - wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts - - name: Grab version - uses: actions/github-script@v6 - id: release - with: - script: | - const release = require('./.github/scripts/release.js') - core.setOutput('version', release.setupPythonVersion()) - - name: Create new release - env: - GH_TOKEN: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - run: | - gh release create v${{steps.release.outputs.version}} \ - --title 'Adyen Python API Library v${{steps.release.outputs.version}}' \ - --generate-notes --target main - - name: Delete the release script - run: | - rm -f ./.github/scripts/release.js - - name: Update develop branch - run: | - git checkout develop - git merge main - git push origin develop + uses: Adyen/adyen-node-api-library/.github/workflows/lib-gh-release.yml@develop + with: + project-name: Python + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb7bc352..e46293d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,64 +1,15 @@ name: Release request on: - workflow_dispatch: - push: - branches: - - develop + workflow_dispatch: + push: + branches: + - develop jobs: release: permissions: contents: write pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: main - - name: Reset promotion branch - run: | - git fetch origin develop:develop - git reset --hard develop - - name: Get the release script - run: | - wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts - - name: Prepare release request - uses: actions/github-script@v6 - id: release - with: - script: | - const release = require('./.github/scripts/release.js') - const options = { github, context, core, getCurrentVersion: release.setupPythonVersion }; - await release.bump(options); - - name: Bump version - uses: actions/github-script@v6 - with: - script: | - const release = require('./.github/scripts/release.js') - await release.updatePythonVersion("${{steps.release.outputs.nextVersion}}"); - - name: Delete the release script - run: | - rm -f ./.github/scripts/release.js - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5.0.1 - with: - token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} - author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} - branch: automation/release - title: Release v${{steps.release.outputs.nextVersion}} - body: | - Merged pull requests to be released: - ${{steps.release.outputs.changelog}} - commit-message: "chore(release): bump to ${{steps.release.outputs.nextVersion}}" - delete-branch: true - - name: Enable Pull Request Automerge - if: steps.cpr.outputs.pull-request-operation == 'created' - uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0 - with: - token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: merge - + uses: Adyen/adyen-node-api-library/.github/workflows/lib-release.yml@develop + secrets: inherit \ No newline at end of file diff --git a/Makefile b/Makefile index 701807a6..a29df9fc 100644 --- a/Makefile +++ b/Makefile @@ -88,3 +88,14 @@ generateCheckoutTest: build/spec $(openapi-generator-jar) --skip-validate-spec cp $(output)/api/api-test.py test/methodNamesTests/checkoutTest.py rm -rf build + +## Releases + +version: + perl -lne 'print "currentVersion=$$1" if /version=''(.+)'',/' < setup.py >> "$$GITHUB_OUTPUT" + +bump: + perl -i -pe 's/$$ENV{"CURRENT_VERSION"}/$$ENV{"NEXT_VERSION"}/' setup.py Adyen/settings.py + + +.PHONY: $(services) version bump \ No newline at end of file From a5547ac6053432b40310136201c5c3fbc45c2f3c Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:33:49 +0200 Subject: [PATCH 4/7] change UT name (#258) --- test/UtilTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/UtilTest.py b/test/UtilTest.py index 07bd9e56..d591e283 100644 --- a/test/UtilTest.py +++ b/test/UtilTest.py @@ -49,7 +49,7 @@ def test_notification_request_item_hmac(self): {'hmacSignature': hmac_calculation_str}) self.assertTrue(hmac_validate) - def test_notifications_with_slashes(self): + def test_webhooks_with_slashes(self): hmac_key = "74F490DD33F7327BAECC88B2947C011FC02D014A473AAA33A8EC93E4DC069174" with open('test/mocks/util/backslash_notification.json') as file: backslash_notification = load(file) From 1dee6ce58eaece9d23f59afb1578092d389984f9 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Mon, 14 Aug 2023 09:08:19 +0200 Subject: [PATCH 5/7] Grab current version fix (#259) --- Makefile | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a29df9fc..8cce8169 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ generateCheckoutTest: build/spec $(openapi-generator-jar) ## Releases version: - perl -lne 'print "currentVersion=$$1" if /version=''(.+)'',/' < setup.py >> "$$GITHUB_OUTPUT" + grep version= setup.py | tr -d \', | awk -F '=' '{ printf "currentVersion=%s\n", $$2 }' >> "$$GITHUB_OUTPUT" bump: perl -i -pe 's/$$ENV{"CURRENT_VERSION"}/$$ENV{"NEXT_VERSION"}/' setup.py Adyen/settings.py diff --git a/setup.cfg b/setup.cfg index 9c1f5cea..b799bb2c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [bdist_wheel] [metadata] -description-file = README.md +description_file = README.md [egg_info] tag_build = From d3712750c5ca655d8d1248214dcc75020742a485 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:39:23 +0200 Subject: [PATCH 6/7] Feature/improve hmac validator (#260) * Update util.py * Update util.py --- Adyen/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Adyen/util.py b/Adyen/util.py index 347fc07b..b19e89e8 100644 --- a/Adyen/util.py +++ b/Adyen/util.py @@ -37,6 +37,9 @@ def generate_notification_sig(dict_object, hmac_key): def is_valid_hmac_notification(dict_object, hmac_key): dict_object = dict_object.copy() + if 'notificationItems' in dict_object: + dict_object = dict_object['notificationItems'][0]['NotificationRequestItem'] + if 'additionalData' in dict_object: if dict_object['additionalData']['hmacSignature'] == "": raise ValueError("Must Provide hmacSignature in additionalData") From 5220b418e2a8a97ac0861b44aad77e090c7a00d6 Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Fri, 18 Aug 2023 12:39:39 +0000 Subject: [PATCH 7/7] chore(release): bump to 9.0.2 --- Adyen/settings.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Adyen/settings.py b/Adyen/settings.py index 3bb37fd4..f87da537 100644 --- a/Adyen/settings.py +++ b/Adyen/settings.py @@ -26,4 +26,4 @@ API_LEGAL_ENTITY_MANAGEMENT_VERSION = "v3" API_STORED_VALUE_VERSION = "v46" LIB_NAME = "adyen-python-api-library" -LIB_VERSION = "9.0.1" +LIB_VERSION = "9.0.2" diff --git a/setup.py b/setup.py index 7af4ba7d..ffd28f90 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='Adyen', packages=find_packages(include="Adyen*"), - version='9.0.1', + version='9.0.2', maintainer='Adyen', maintainer_email='support@adyen.com', description='Adyen Python Api',