From ab59f7fd26ed086500d36799c739b9b2d5ee5dae Mon Sep 17 00:00:00 2001 From: leandromagnabosco <105861049+leandromagnabosco@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:57:42 +0200 Subject: [PATCH 1/5] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 808a595..4d4d1c6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Adyen/php +* @Adyen/plugin-developers From ed6d52f1519e0578533a3aa3ceeef5d8e211fd60 Mon Sep 17 00:00:00 2001 From: Khushboo Date: Thu, 24 Aug 2023 14:43:21 +0200 Subject: [PATCH 2/5] Enable code quality and static checks for Express Module (#39) * Codeql and Sonarcloud yaml. * Delete sonarcloud.yml * Update codeql.yml Adding checks for main branch too --- .github/workflows/codeql.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..28bea4f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + push: + branches: [ "develop","main" ] + pull_request: + branches: [ "develop","main"] + schedule: + - cron: "6 1 * * 0" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ javascript ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}" From cd0feeea41a0816e8f429eb3aed7fc7a159572df Mon Sep 17 00:00:00 2001 From: Can Demiralp Date: Tue, 29 Aug 2023 10:46:28 +0200 Subject: [PATCH 3/5] [ECP-8486] Update quote totals and set tax included value in the express Apple Pay checkout (#38) * setup correctly updating the quote with the up-to-date shipping information * set some breakpoints to debug via gitpod * [PW-8486] Call shipping-information to set the quote and update the final amount with tax included value * Update view/frontend/web/js/applepay/button.js Co-authored-by: Peter Ojo * Update view/frontend/web/js/applepay/button.js Co-authored-by: Peter Ojo * [PW-8486] Remove debug statements * [PW-8486] Fix formatting --------- Co-authored-by: RokPopov Co-authored-by: Peter Ojo --- view/frontend/web/js/applepay/button.js | 81 +++++++++++++++++++------ 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/view/frontend/web/js/applepay/button.js b/view/frontend/web/js/applepay/button.js index 8316028..111bc77 100644 --- a/view/frontend/web/js/applepay/button.js +++ b/view/frontend/web/js/applepay/button.js @@ -282,20 +282,36 @@ define([ self.shippingMethod = result[i].method_code; } } + + let address = { + 'countryId': self.shippingAddress.country_id, + 'region': self.shippingAddress.region, + 'regionId': getRegionId(self.shippingAddress.country_id, self.shippingAddress.region), + 'postcode': self.shippingAddress.postcode + }; + + // Create payload to get totals let totalsPayload = { 'addressInformation': { - 'address': { - 'countryId': self.shippingAddress.country_id, - 'region': self.shippingAddress.region, - 'regionId': getRegionId(self.shippingAddress.country_id, self.shippingAddress.region), - 'postcode': self.shippingAddress.postcode - }, + 'address': address, 'shipping_method_code': self.shippingMethods[shippingMethods[0].identifier].method_code, 'shipping_carrier_code': self.shippingMethods[shippingMethods[0].identifier].carrier_code } }; + // Create payload to update quote + let shippingInformationPayload = { + 'addressInformation': { + ...totalsPayload.addressInformation, + 'shipping_address': address, + 'billing_address': address + } + }; + + delete shippingInformationPayload.addressInformation.address; + setShippingInformation(shippingInformationPayload, this.isProductView); + setTotalsInfo(totalsPayload, this.isProductView) .done((response) => { let applePayShippingContactUpdate = {}; @@ -303,7 +319,7 @@ define([ applePayShippingContactUpdate.newShippingMethods = shippingMethods; applePayShippingContactUpdate.newTotal = { label: $t('Grand Total'), - amount: response.grand_total.toString() + amount: (response.grand_total + response.tax_amount).toString() }; applePayShippingContactUpdate.newLineItems = [ { @@ -317,6 +333,15 @@ define([ amount: shippingMethods[0].amount.toString() } ]; + + if (response.tax_amount > 0) { + applePayShippingContactUpdate.newLineItems.push({ + type: 'final', + label: $t('Tax'), + amount: response.tax_amount.toString() + }) + } + resolve(applePayShippingContactUpdate); // Pass shipping methods back }).fail((e) => { @@ -328,29 +353,42 @@ define([ onShippingMethodSelect: function (resolve, reject, event) { let self = this; - let shippingMethod = event.shippingMethod; - let payload = { + + let address = { + 'countryId': self.shippingAddress.country_id, + 'region': self.shippingAddress.region, + 'regionId': getRegionId(self.shippingAddress.country_id, self.shippingAddress.region), + 'postcode': self.shippingAddress.postcode + }; + + let totalsPayload = { 'addressInformation': { - 'address': { - 'countryId': self.shippingAddress.country_id, - 'region': self.shippingAddress.region, - 'regionId': getRegionId(self.shippingAddress.country_id, self.shippingAddress.region), - 'postcode': self.shippingAddress.postcode - }, + 'address': address, 'shipping_method_code': self.shippingMethods[shippingMethod.identifier].method_code, 'shipping_carrier_code': self.shippingMethods[shippingMethod.identifier].carrier_code } }; - setTotalsInfo(payload, this.isProductView) + let shippingInformationPayload = { + 'addressInformation': { + ...totalsPayload.addressInformation, + 'shipping_address': address, + 'billing_address': address + } + }; + + delete shippingInformationPayload.addressInformation.address; + setShippingInformation(shippingInformationPayload, this.isProductView); + + setTotalsInfo(totalsPayload, this.isProductView) .done((response) => { let applePayShippingMethodUpdate = {}; applePayShippingMethodUpdate.newTotal = { type: 'final', label: $t('Grand Total'), - amount: response.grand_total.toString() + amount: (response.grand_total + response.tax_amount).toString() }; applePayShippingMethodUpdate.newLineItems = [ { @@ -364,6 +402,15 @@ define([ amount: shippingMethod.amount.toString() } ]; + + if (response.tax_amount > 0) { + applePayShippingMethodUpdate.newLineItems.push({ + type: 'final', + label: $t('Tax'), + amount: response.tax_amount.toString() + }) + } + self.shippingMethod = shippingMethod.identifier; resolve(applePayShippingMethodUpdate); }).fail((e) => { From de02869a9e0211578655cbe046426dac60d0466f Mon Sep 17 00:00:00 2001 From: hossam-adyen <132500300+hossam-adyen@users.noreply.github.com> Date: Tue, 29 Aug 2023 11:21:52 +0200 Subject: [PATCH 4/5] Create release.yml --- .github/release.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..0cd34a7 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,14 @@ +changelog: + categories: + - title: Breaking Changes 🛠 + labels: + - Breaking change + - title: New Features 💎 + labels: + - Feature + - title: Fixes ⛑️ + labels: + - Fix + - title: Other Changes 🖇️ + labels: + - "*" From 52037f8fb911d3a06b0c4e494d4c819ded730b53 Mon Sep 17 00:00:00 2001 From: RokPopov Date: Thu, 7 Sep 2023 16:54:40 +0200 Subject: [PATCH 5/5] Version bump 1.1.3 --- composer.json | 2 +- etc/module.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5aae839..99e7581 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "adyen/adyen-magento2-expresscheckout", "description": "Official Adyen Magento2 plugin to add express payment method shortcuts.", "type": "magento2-module", - "version": "1.1.2", + "version": "1.1.3", "license": "MIT", "repositories": [ { diff --git a/etc/module.xml b/etc/module.xml index c23ce7a..abb74f5 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -11,7 +11,7 @@ */ --> - +