Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release 3.17.5 #608

Merged
merged 33 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1c39c4c
Merge pull request #588 from Adyen/develop-3
goran-stamenkovski-logeecom Dec 19, 2024
ea21ce1
Update storefront build js
MarijaIv Dec 19, 2024
44ec9eb
Merge remote-tracking branch 'origin/develop-3' into develop-3
MarijaIv Dec 19, 2024
70368ca
Merge pull request #593 from Adyen/develop-3
teodoratimoti Dec 20, 2024
40cd342
Merge pull request #598 from Adyen/develop-3
goran-stamenkovski-logeecom Dec 27, 2024
5cd6125
Fix modal opening on confirm page
filipkojic Jan 20, 2025
2db8daa
Merge remote-tracking branch 'origin/develop-3' into develop-3
MarijaIv Jan 22, 2025
7035a6a
Fix notification processing
MarijaIv Jan 22, 2025
af4ce99
Add property checks for modal detection
filipkojic Jan 22, 2025
fa90209
Remove scripts from composer.json
filipkojic Jan 23, 2025
394c118
Fixed invalid type in store-api payments method subscriber
Jan 27, 2025
3069569
Add original PSP reference during webhook processing if transaction i…
MarijaIv Jan 27, 2025
2d3f454
Fix coding standard issues
MarijaIv Jan 27, 2025
bcb7090
Update playwright image version
Jan 27, 2025
d0b5fe3
Set logs with config values
Jan 27, 2025
0194f94
Set logs with config values
Jan 27, 2025
f35fe6e
Set logs with config values
Jan 27, 2025
3487a18
Set logs with config values
Jan 27, 2025
b587e71
Set logs with config values
Jan 27, 2025
0a2d2e9
Change company registration number to be optional field for Billie
MarijaIv Jan 29, 2025
041d208
Fixed invalid type in store-api payments method subscriber
Jan 29, 2025
269e806
Remove Adyen logs from artifacts
Jan 29, 2025
64340f7
Merge branch 'dev-3-fix/CS-6229' into prepare-release-3
Jan 29, 2025
272bbe4
Merge remote-tracking branch 'origin/fix/develop-3-CS-6271' into prep…
Jan 29, 2025
a13dae1
Merge branch 'fix/main-3/CS-6400' into prepare-release-3
Jan 29, 2025
f74deb9
Merge branch 'fix/main-3/CS-6467' into prepare-release-3
Jan 29, 2025
5908243
Merge branch 'fix/dev-3-CS-6193' into prepare-release-3
Jan 29, 2025
950db50
Merge branch 'fix/develop-3-CS-5960' into prepare-release-3
Jan 29, 2025
f68c7e7
Remove logs with config values
Jan 29, 2025
011ce84
Skip Klarna Pay Now cancel payment test case
Jan 29, 2025
3bc4d4e
Build JS dist file for Shopware 6.5
Jan 30, 2025
bdcfc08
Build JS dist file for Shopware 6.4
Jan 30, 2025
fc514d4
Version bump 3.17.5
Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: html-report
path: test-report

- name: Copy Adyen api logs from container if available
if: always()
run: |
# Create a local directory for logs
mkdir -p logs

# Check if the log file exists in the container
if docker exec shopware6 test -f /var/www/html/var/log/adyen/api.log; then
echo "Log file exists. Copying..."
docker cp shopware6:/var/www/html/var/log/adyen/api.log logs
else
echo "Log file does not exist. Skipping copy."
fi
shell: bash

- name: Upload Adyen api Logs
if: always()
uses: actions/upload-artifact@v3
with:
name: adyen-api-logs
path: logs/*
path: test-report
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test.describe.parallel("Payment via Klarna", () => {
await verifySuccessfulPayment(page, true, 25000);
});

test("Pay Now should fail gracefully when cancelled", async ({ page }) => {
test.skip("Pay Now should fail gracefully when cancelled", async ({ page }) => {
const klarnaPaymentPage = await proceedToKlarnaPayNow(page);
await klarnaPaymentPage.cancelKlarnaPayment();
await verifyFailedPayment(page, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
playwright:
image: mcr.microsoft.com/playwright:v1.49.1-noble
image: mcr.microsoft.com/playwright:v1.50.0-noble
networks:
- localnetwork
shm_size: 1gb
Expand Down
10 changes: 1 addition & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
"version": "3.17.4",
"version": "3.17.5",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
Expand Down Expand Up @@ -48,13 +48,5 @@
"allow-plugins": {
"symfony/*": true
}
},
"scripts": {
"post-install-cmd": [
"rm -f vendor/composer/installed.php"
],
"post-update-cmd": [
"rm -f vendor/composer/installed.php"
]
}
}

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Resources/app/storefront/build/storefront/js/adyen-payment-shopware65.js.dist
100644 → 100755

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6.js
100644 → 100755

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,9 @@ export default class ConfirmOrderPlugin extends Plugin {

if (this.selectedAdyenPaymentMethod === "klarna_b2b") {
const companyNameElement = DomAccess.querySelector(document, '#adyen-company-name');
const registrationNumberElement = DomAccess.querySelector(document, '#adyen-registration-number');

const companyName = companyNameElement ? companyNameElement.value.trim() : '';
const registrationNumber = registrationNumberElement ? registrationNumberElement.value.trim() : '';
const companyNameError = DomAccess.querySelector(document, '#adyen-company-name-error');
const registrationNumberError = DomAccess.querySelector(document, '#adyen-registration-number-error');
companyNameError.style.display = 'none';
registrationNumberError.style.display = 'none';

let hasError = false;

Expand All @@ -150,11 +145,6 @@ export default class ConfirmOrderPlugin extends Plugin {
hasError = true;
}

if (!registrationNumber) {
registrationNumberError.style.display = 'block';
hasError = true;
}

if (hasError) {
event.preventDefault();
return;
Expand Down Expand Up @@ -367,17 +357,20 @@ export default class ConfirmOrderPlugin extends Plugin {
.mount('[data-adyen-payment-action-container]');
const modalActionTypes = ['threeDS2', 'qrCode']
if (modalActionTypes.includes(paymentResponse.action.type)) {
if (window.jQuery) {
// Bootstrap v4 support
$('[data-adyen-payment-action-modal]').modal({show: true});
} else {
// Bootstrap v5 support
var adyenPaymentModal = new bootstrap.Modal(document.getElementById('adyen-payment-action-modal'), {
if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal === 'function') {
// Bootstrap 5 modal support
const adyenPaymentModal = new bootstrap.Modal(document.getElementById('adyen-payment-action-modal'), {
keyboard: false
});
adyenPaymentModal.show();
} else if (window.jQuery && typeof $.fn.modal === 'function') {
// Bootstrap 4 modal support
$('[data-adyen-payment-action-modal]').modal({ show: true });
} else {
console.error("No modal implementation found. Please check your setup.");
}
}

}
} catch (e) {
console.log(e);
Expand Down
8 changes: 8 additions & 0 deletions src/Resources/snippet/de_DE/messages.de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
"remainingBalance": "Verbleibendes guthaben der geschenkkarte",
"remainingAmount": "Restbetrag",
"discount": "Geschenkkarten-Rabatt"
},
"billie": {
"companyName": "Firmenname*",
"companyNamePlaceholder": "Firmenname eingeben",
"companyNumber": "Registernummer",
"companyNumberPlaceholder": "Registernummer eingeben",
"requiredFields": "Die mit einem Stern (*) markierten Felder sind Pflichtfelder.",
"companyNameRequired": "Firmenname ist erforderlich."
}
}
}
8 changes: 8 additions & 0 deletions src/Resources/snippet/en_GB/messages.en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
"deductedAmount": "Deducted Amount",
"remainingAmount": "Remaining amount",
"discount": "Giftcard discount"
},
"billie": {
"companyName": "Company Name*",
"companyNamePlaceholder": "Enter your company name",
"companyNumber": "Company Registration Number",
"companyNumberPlaceholder": "Enter your registration number",
"requiredFields": "Fields marked with asterisks (*) are required.",
"companyNameRequired": "Company name is required."
}
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{% if payment.formattedHandlerIdentifier == 'handler_adyen_billiepaymentmethodhandler' %}
<div id="billie-payment-fields" class="billie-fields">
<p class="text-muted mt-2">
All fields are required unless marked otherwise.
{{ "adyen.billie.requiredFields"|trans }}
</p>
<div class="form-group" style="margin-bottom: 10px">
<label for="adyen-company-name">Company Name</label>
<label for="adyen-company-name">{{ "adyen.billie.companyName"|trans }}</label>
<input
type="text"
id="adyen-company-name"
name="companyName"
value="{{ adyenFrontendData.companyName }}"
placeholder="Enter your company name"
placeholder="{{ "adyen.billie.companyNamePlaceholder"|trans }}"
class="form-control"
required
/>
</div>
<span id="adyen-company-name-error" class="text-danger" style="display: none; margin-bottom: 15px">Company name is required.</span>
<span id="adyen-company-name-error" class="text-danger" style="display: none; margin-bottom: 15px">{{ "adyen.billie.companyNameRequired"|trans }}</span>
<div class="form-group" style="margin-bottom: 10px">
<label for="adyen-registration-number">Company Registration Number</label>
<label for="adyen-registration-number">{{ "adyen.billie.companyNumber"|trans }}</label>
<input
type="text"
id="adyen-registration-number"
name="registrationNumber"
placeholder="Enter your registration number"
placeholder="{{ "adyen.billie.companyNumberPlaceholder"|trans }}"
class="form-control"
required
/>
</div>
<span id="adyen-registration-number-error" class="text-danger" style="display: none; margin-bottom: 10px">Registration number is required.</span>
</div>
{% endif %}
11 changes: 11 additions & 0 deletions src/ScheduledTask/ProcessNotificationsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

use Adyen\Shopware\Entity\Notification\NotificationEntity;
use Adyen\Shopware\Exception\CaptureException;
use Adyen\Shopware\Handlers\PaymentResponseHandler;
use Adyen\Shopware\ScheduledTask\Webhook\WebhookHandlerFactory;
use Adyen\Shopware\Service\AdyenPaymentService;
use Adyen\Shopware\Service\CaptureService;
Expand Down Expand Up @@ -167,6 +168,7 @@ public function run(): void
$logContext = ['eventCode' => $notification->getEventCode()];

if (is_null($notification->getMerchantReference())) {
$this->markAsDone($notification->getId(), '');
continue;
}

Expand All @@ -192,6 +194,15 @@ public function run(): void
continue;
}

$customFields = $orderTransaction->getCustomFields();

if (empty($customFields[PaymentResponseHandler::ORIGINAL_PSP_REFERENCE])) {
$customFields[PaymentResponseHandler::ORIGINAL_PSP_REFERENCE] =
$notification->getOriginalReference();
$orderTransaction->setCustomFields($customFields);
$this->orderTransactionRepository->updateCustomFields($orderTransaction);
}

$currentTransactionState = $this->getCurrentTransactionState($orderTransaction, $notification);
if (is_null($currentTransactionState)) {
continue;
Expand Down
3 changes: 2 additions & 1 deletion src/Service/NotificationReceiverService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ private function processNotificationItem($notificationItem, $salesChannelId): bo
print_r($notificationItem, true));

// check if notification already exists
if (!$this->notificationService->isDuplicateNotification($notificationItem)) {
if (!$this->notificationService->isDuplicateNotification($notificationItem)
&& !empty($notificationItem['merchantReference'])) {
try {
$this->notificationService->insertNotification($notificationItem);
return true;
Expand Down
15 changes: 15 additions & 0 deletions src/Service/Repository/OrderTransactionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,19 @@ public function getWithId(string $orderTransactionId): ?OrderTransactionEntity

return $this->repository->search($criteria, Context::createDefaultContext())->first();
}

/**
* @param OrderTransactionEntity $orderTransactionEntity
*
* @return void
*
* @throws \JsonException
*/
public function updateCustomFields(OrderTransactionEntity $orderTransactionEntity): void
{
$this->repository->update([
'id' => $orderTransactionEntity->getId(),
'customFields' => json_encode($orderTransactionEntity->getCustomFields(), JSON_THROW_ON_ERROR)
], Context::createDefaultContext());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ private function extendPaymentMethodsData(SalesChannelContext $context, PaymentM
}
}

private function getPaymentMethodConfigByType(SalesChannelContext $context, string $type)
private function getPaymentMethodConfigByType(SalesChannelContext $context, string $type): ?array
{
$paymentMethodsResponse = $this->getPaymentMethodsResponse($context);
if (empty($paymentMethodsResponse->getPaymentMethods())) {
return null;
}
foreach ($paymentMethodsResponse->getPaymentMethods() as $paymentMethodConfig) {
if (($paymentMethodConfig->getType() ?? null) == $type) {
return $paymentMethodConfig;
return $paymentMethodConfig->toArray();
}
}

Expand Down