From 432ee4439e519e98f4ce172b804f1076718910ec Mon Sep 17 00:00:00 2001 From: Ivascu Madalin Date: Mon, 30 Oct 2023 08:22:34 +0000 Subject: [PATCH 1/2] Add sonarqube --- .github/workflows/sonarqube.yml | 24 ++++++++++++++++++++++++ sonar-project.properties | 9 +++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/sonarqube.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml new file mode 100644 index 0000000..ec147dc --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,24 @@ +name: SonarQube Analysis + +on: + push: + branches: + - master + - develop + - "releases/**" + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: SonarQube Analysis + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..4b10ff8 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,9 @@ +# Unique key for the project +sonar.projectKey=Hyva-Checkout + +# Display name and version for the SonarQube UI +sonar.projectName=Hyva Checkout +sonar.projectVersion=1.0 + +# Path to the source code, relative to the sonar-project.properties file +sonar.sources=. \ No newline at end of file From e5cd0bc655b6402006e9140a6557c61b810268b7 Mon Sep 17 00:00:00 2001 From: Ivascu Madalin Date: Mon, 30 Oct 2023 08:58:12 +0000 Subject: [PATCH 2/2] fix small issues --- Model/Magewire/Payment/PlaceOrderService.php | 2 +- Model/Validation/Rules/Iban.php | 2 +- .../templates/component/payment/before.phtml | 47 +++++++++++++++---- .../component/payment/method/afterpay.phtml | 29 +++++++++--- .../component/payment/method/afterpay20.phtml | 20 ++++++-- .../component/payment/method/applepay.phtml | 7 ++- .../component/payment/method/billink.phtml | 16 +++++-- .../component/payment/method/creditcard.phtml | 12 ++--- .../payment/method/creditcards.phtml | 44 ++++++++++++++--- .../component/payment/method/giftcards.phtml | 36 +++++++++++--- .../component/payment/method/giropay.phtml | 9 +++- .../component/payment/method/ideal.phtml | 7 ++- .../component/payment/method/in3.phtml | 18 +++++-- .../component/payment/method/klarna.phtml | 2 +- .../component/payment/method/mrcash.phtml | 33 +++++++++++-- .../payment/method/payperemail.phtml | 30 ++++++++++-- .../component/payment/method/sepaDirect.phtml | 9 +++- .../component/payment/method/tinka.phtml | 18 +++++-- .../component/payment/method/voucher.phtml | 16 +++++-- .../templates/total-segments/empty.phtml | 2 - 20 files changed, 286 insertions(+), 73 deletions(-) diff --git a/Model/Magewire/Payment/PlaceOrderService.php b/Model/Magewire/Payment/PlaceOrderService.php index c63f693..253d43d 100644 --- a/Model/Magewire/Payment/PlaceOrderService.php +++ b/Model/Magewire/Payment/PlaceOrderService.php @@ -49,4 +49,4 @@ private function hasRedirect(): bool $response = $this->getResponse(); return !empty($response->RequiredAction->RedirectURL); } -} \ No newline at end of file +} diff --git a/Model/Validation/Rules/Iban.php b/Model/Validation/Rules/Iban.php index f31d6ae..20cf248 100644 --- a/Model/Validation/Rules/Iban.php +++ b/Model/Validation/Rules/Iban.php @@ -41,7 +41,7 @@ public function check($value): bool $checksum %= 97; } - return ((98 - $checksum) == $check); + return (98 - $checksum) == $check; } else { return false; } diff --git a/view/frontend/templates/component/payment/before.phtml b/view/frontend/templates/component/payment/before.phtml index 36caf30..6113d8e 100644 --- a/view/frontend/templates/component/payment/before.phtml +++ b/view/frontend/templates/component/payment/before.phtml @@ -33,7 +33,11 @@ }); hyva.formValidation.addRule('bk-validateCardCvc', (value, options, field, context) => { - if (!BuckarooClientSideEncryption.V001.validateCvc(value, context.determineIssuer(context.cardNumber))) { + if (!BuckarooClientSideEncryption.V001.validateCvc( + value, + context.determineIssuer(context.cardNumber) + ) + ) { return 'escapeJs(__('Please enter a valid Cvc number.')) ?>'; }; return true; @@ -106,7 +110,12 @@ }) } }" x-init="initModal()"> - diff --git a/view/frontend/templates/component/payment/method/afterpay.phtml b/view/frontend/templates/component/payment/method/afterpay.phtml index b91f1e4..34d6062 100644 --- a/view/frontend/templates/component/payment/method/afterpay.phtml +++ b/view/frontend/templates/component/payment/method/afterpay.phtml @@ -21,7 +21,13 @@ use Magento\Framework\Escaper; escapeHtml(__('Date of Birth:')); ?> * - + hasError('dateOfBirth')) : ?>
escapeHtmlAttr($magewire->getError('dateOfBirth')) ?>
@@ -47,8 +53,15 @@ use Magento\Framework\Escaper; showBusinessSelector()) { ?>
- - @@ -59,7 +72,7 @@ use Magento\Framework\Escaper; ?>
@@ -99,10 +112,14 @@ use Magento\Framework\Escaper; hasError('tos')) : ?>
escapeHtmlAttr($magewire->getError('tos')) ?>
-
\ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/afterpay20.phtml b/view/frontend/templates/component/payment/method/afterpay20.phtml index 85bb73b..793dfd8 100644 --- a/view/frontend/templates/component/payment/method/afterpay20.phtml +++ b/view/frontend/templates/component/payment/method/afterpay20.phtml @@ -11,7 +11,12 @@ use Magento\Framework\Escaper; - + showBirth()) { @@ -21,7 +26,12 @@ use Magento\Framework\Escaper; escapeHtml(__('Date of Birth:')); ?> * - + hasError('dateOfBirth')): ?>
escapeHtmlAttr($magewire->getError('dateOfBirth')) ?>
@@ -80,7 +90,11 @@ use Magento\Framework\Escaper; hasError('tos')): ?>
escapeHtmlAttr($magewire->getError('tos')) ?>
diff --git a/view/frontend/templates/component/payment/method/applepay.phtml b/view/frontend/templates/component/payment/method/applepay.phtml index e3687d3..0330bb4 100644 --- a/view/frontend/templates/component/payment/method/applepay.phtml +++ b/view/frontend/templates/component/payment/method/applepay.phtml @@ -87,9 +87,8 @@ use Magento\Framework\Escaper; this.loadSdk().then(async () => { this.canDisplay = await BuckarooApplePay.checkPaySupport(); const v = async () => { - if(this.canDisplay) { - await this.beginPayment(); - } + if(this.canDisplay) + await this.beginPayment(); }; window.dispatchEvent(new CustomEvent('buckaroo-add-task', { detail: { @@ -104,4 +103,4 @@ use Magento\Framework\Escaper; escapeHtml(__('Place Order')) ?> - \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/billink.phtml b/view/frontend/templates/component/payment/method/billink.phtml index eed7c65..c625951 100644 --- a/view/frontend/templates/component/payment/method/billink.phtml +++ b/view/frontend/templates/component/payment/method/billink.phtml @@ -38,7 +38,12 @@ use Magento\Framework\Escaper; escapeHtml(__('Date of Birth:')); ?> * - + hasError('dateOfBirth')) : ?>
escapeHtmlAttr($magewire->getError('dateOfBirth')) ?>
@@ -89,10 +94,15 @@ use Magento\Framework\Escaper; hasError('tos')) : ?>
escapeHtmlAttr($magewire->getError('tos')) ?>
- \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/creditcard.phtml b/view/frontend/templates/component/payment/method/creditcard.phtml index 1e0e0f6..aa34d35 100644 --- a/view/frontend/templates/component/payment/method/creditcard.phtml +++ b/view/frontend/templates/component/payment/method/creditcard.phtml @@ -11,13 +11,14 @@ $issuers = $magewire->getIssuers();
displayAsSelect()) { ?> - + +
@@ -126,9 +134,18 @@ use Magento\Framework\Escaper; *
- +
- +
@@ -140,7 +157,14 @@ use Magento\Framework\Escaper; escapeHtml(__('Expiration:')); ?> * - +
@@ -148,7 +172,15 @@ use Magento\Framework\Escaper; escapeHtml(__('CVC / CVV:')); ?> * - +
diff --git a/view/frontend/templates/component/payment/method/giftcards.phtml b/view/frontend/templates/component/payment/method/giftcards.phtml index 986dcfa..2a14a0c 100644 --- a/view/frontend/templates/component/payment/method/giftcards.phtml +++ b/view/frontend/templates/component/payment/method/giftcards.phtml @@ -66,7 +66,7 @@ if (!$magewire->isRedirect()) { this.displaySuccess(response); } }) - }, + }, register() { this.listenToSubmit(); const v = async () => { @@ -85,8 +85,16 @@ if (!$magewire->isRedirect()) { })" x-init="register()" novalidate>
- - getGiftcardIssuers() as $issuer) { @@ -106,16 +114,32 @@ if (!$magewire->isRedirect()) { escapeHtml(__('Card number:')); ?> * - +
- +
- + getGenderList(); escapeHtml(__('BIC Number')); ?> * - + hasError('bic')) : ?>
escapeHtmlAttr($magewire->getError('bic')) ?>
- \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/ideal.phtml b/view/frontend/templates/component/payment/method/ideal.phtml index 8a0a398..2fff4b8 100644 --- a/view/frontend/templates/component/payment/method/ideal.phtml +++ b/view/frontend/templates/component/payment/method/ideal.phtml @@ -16,8 +16,7 @@ $issuers = $magewire->getIssuers(); - getIssuers(); - +
@@ -78,7 +86,15 @@ use Magento\Framework\Escaper; escapeHtml(__('Card number:')); ?> * - +
@@ -86,11 +102,20 @@ use Magento\Framework\Escaper; escapeHtml(__('Expiration:')); ?> * - +
- \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/payperemail.phtml b/view/frontend/templates/component/payment/method/payperemail.phtml index a5807ac..d105b2d 100644 --- a/view/frontend/templates/component/payment/method/payperemail.phtml +++ b/view/frontend/templates/component/payment/method/payperemail.phtml @@ -32,7 +32,12 @@ use Magento\Framework\Escaper; escapeHtml(__('Billing First Name:')); ?> * - + hasError('firstName')) : ?>
escapeHtmlAttr($magewire->getError('firstName')) ?>
@@ -42,7 +47,12 @@ use Magento\Framework\Escaper; - +
@@ -50,7 +60,12 @@ use Magento\Framework\Escaper; escapeHtml(__('Billing Last Name:')); ?> * - + hasError('lastName')) : ?>
escapeHtmlAttr($magewire->getError('lastName')) ?>
@@ -61,9 +76,14 @@ use Magento\Framework\Escaper; escapeHtml(__('Email:')); ?> * - + hasError('email')) : ?>
escapeHtmlAttr($magewire->getError('email')) ?>
- \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/sepaDirect.phtml b/view/frontend/templates/component/payment/method/sepaDirect.phtml index 08b8a89..c795244 100644 --- a/view/frontend/templates/component/payment/method/sepaDirect.phtml +++ b/view/frontend/templates/component/payment/method/sepaDirect.phtml @@ -37,7 +37,12 @@ use Magento\Framework\Escaper; escapeHtml(__('BIC Number')); ?> * - + hasError('bic')) : ?>
escapeHtmlAttr($magewire->getError('bic')) ?>
@@ -46,4 +51,4 @@ use Magento\Framework\Escaper; } ?> - \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/tinka.phtml b/view/frontend/templates/component/payment/method/tinka.phtml index f1362d2..17bb733 100644 --- a/view/frontend/templates/component/payment/method/tinka.phtml +++ b/view/frontend/templates/component/payment/method/tinka.phtml @@ -11,7 +11,13 @@ use Magento\Framework\Escaper; - + showBirth()) { @@ -21,7 +27,13 @@ use Magento\Framework\Escaper; escapeHtml(__('Date of Birth:')); ?> * - + hasError('dateOfBirth')) : ?>
escapeHtmlAttr($magewire->getError('dateOfBirth')) ?>
@@ -45,4 +57,4 @@ use Magento\Framework\Escaper; } ?> - \ No newline at end of file + diff --git a/view/frontend/templates/component/payment/method/voucher.phtml b/view/frontend/templates/component/payment/method/voucher.phtml index 47b7d40..421b69c 100644 --- a/view/frontend/templates/component/payment/method/voucher.phtml +++ b/view/frontend/templates/component/payment/method/voucher.phtml @@ -91,10 +91,20 @@ use Magento\Framework\Escaper; escapeHtml(__('Voucher code:')); ?> * - + - + - \ No newline at end of file + diff --git a/view/frontend/templates/total-segments/empty.phtml b/view/frontend/templates/total-segments/empty.phtml index 784da93..a766f11 100644 --- a/view/frontend/templates/total-segments/empty.phtml +++ b/view/frontend/templates/total-segments/empty.phtml @@ -1,4 +1,2 @@ \ No newline at end of file