-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from Adyen/develop
Release 3.14.2
- Loading branch information
Showing
22 changed files
with
290 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 29 additions & 27 deletions
56
...ources/app/administration/src/component/adyen-notifications/adyen-notifications.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
<div v-if="showWidget"> | ||
<sw-card :title="$tc('adyen.notificationsTitle')"> | ||
<sw-data-grid | ||
v-if="notifications.length" | ||
:dataSource="notifications" | ||
:columns="columns" | ||
:showActions="true" | ||
:showSelection="false" | ||
:showSettings="true" | ||
> | ||
{% block sw_data_grid_body_columns %} | ||
{% block sw_data_grid_column_actions %} | ||
<template #actions="{ item }"> | ||
{% block sw_data_grid_column_actions_reschedule %} | ||
<sw-context-menu-item | ||
v-if="item.canBeRescheduled" | ||
@click="onReschedule(item)" | ||
> | ||
{{ $tc('adyen.reprocessNotification') }} | ||
</sw-context-menu-item> | ||
{% endblock %} | ||
</template> | ||
{% block adyen_notifications %} | ||
<div v-if="showWidget"> | ||
<sw-card :title="$tc('adyen.notificationsTitle')"> | ||
<sw-data-grid | ||
v-if="notifications.length" | ||
:dataSource="notifications" | ||
:columns="columns" | ||
:showActions="true" | ||
:showSelection="false" | ||
:showSettings="true" | ||
> | ||
{% block sw_data_grid_body_columns %} | ||
{% block sw_data_grid_column_actions %} | ||
<template #actions="{ item }"> | ||
{% block sw_data_grid_column_actions_reschedule %} | ||
<sw-context-menu-item | ||
v-if="item.canBeRescheduled" | ||
@click="onReschedule(item)" | ||
> | ||
{{ $tc('adyen.reprocessNotification') }} | ||
</sw-context-menu-item> | ||
{% endblock %} | ||
</template> | ||
{% endblock %} | ||
{% endblock %} | ||
{% endblock %} | ||
</sw-data-grid> | ||
<p v-if="!notifications.length">{{ $tc('adyen.noNotificationsReceived') }}</p> | ||
</sw-card> | ||
</div> | ||
</sw-data-grid> | ||
<p v-if="!notifications.length">{{ $tc('adyen.noNotificationsReceived') }}</p> | ||
</sw-card> | ||
</div> | ||
{% endblock %} |
68 changes: 59 additions & 9 deletions
68
.../app/administration/src/component/adyen-partial-payments/adyen-partial-payments.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,59 @@ | ||
<ul v-if="showWidget"> | ||
<dt>{{ $tc('adyen.authorisedPayments') }}</dt> | ||
<dd v-for="payment in partialPayments"> | ||
<a v-bind:href="payment.caLink" target="_blank">{{ payment.pspReference }}</a> - | ||
<span>{{ payment.method }}</span> - | ||
<span>{{ payment.amount }}</span> | ||
</dd> | ||
<dd>{{ errorMessage }}</dd> | ||
</ul> | ||
<div v-if="showWidget"> | ||
<ul v-if="isVersionOlderThan65"> | ||
<dt>{{ $tc('adyen.authorisedPayments') }}</dt> | ||
<dd v-for="payment in partialPayments"> | ||
<a v-bind:href="payment.caLink" target="_blank">{{ payment.pspReference }}</a> - | ||
<span>{{ payment.method }}</span> - | ||
<span>{{ payment.amount }}</span> | ||
</dd> | ||
<dd>{{ errorMessage }}</dd> | ||
</ul> | ||
<ul v-else> | ||
<label>{{ $tc('adyen.authorisedPayments') }}</label> | ||
<div class="sw-data-grid is--compact sw-data-grid--plain-appearance"> | ||
<div class="sw-data-grid__wrapper"> | ||
<table class="sw-data-grid__table"> | ||
<thead class="sw-data-grid__header"> | ||
<tr class="sw-data-grid__rx ow"> | ||
<th class="sw-data-grid__cell sw-data-grid__cell--header sw-data-grid__cell--property sw-data-grid__cell--sortable sw-data-grid__cell--align-left"> | ||
<div class="sw-data-grid__cell-content"> | ||
PSP Reference | ||
</div> | ||
</th> | ||
<th class="sw-data-grid__cell sw-data-grid__cell--header sw-data-grid__cell--property sw-data-grid__cell--sortable sw-data-grid__cell--align-left"> | ||
<div class="sw-data-grid__cell-content"> | ||
Payment Method | ||
</div> | ||
</th> | ||
<th class="sw-data-grid__cell sw-data-grid__cell--header sw-data-grid__cell--property sw-data-grid__cell--sortable sw-data-grid__cell--align-left"> | ||
<div class="sw-data-grid__cell-content"> | ||
Amount | ||
</div> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody class="sw-data-grid__body"> | ||
<tr v-for="payment in partialPayments" class="sw-data-grid__row"> | ||
<td class="sw-data-grid__cell sw-data-grid__cell--order sw-data-grid__cell--align-left"> | ||
<div class="sw-data-grid__cell-content"> | ||
<a v-bind:href="payment.caLink" target="_blank">{{ payment.pspReference }}</a> | ||
</div> | ||
</td> | ||
<td class="sw-data-grid__cell sw-data-grid__cell--order sw-data-grid__cell--align-left"> | ||
<div class="sw-data-grid__cell-content"> | ||
{{ payment.method }} | ||
</div> | ||
</td> | ||
<td class="sw-data-grid__cell sw-data-grid__cell--order sw-data-grid__cell--align-left"> | ||
<div class="sw-data-grid__cell-content"> | ||
{{ payment.amount }} | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
<span>{{ errorMessage }}</span> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 43 additions & 41 deletions
84
...es/app/administration/src/component/adyen-payment-capture/adyen-payment-capture.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
<sw-card :isLoading="isLoading" :title="$tc('adyen.adyenPaymentCaptureTitle')" v-if="showWidget" :large="false" :hero="false"> | ||
<div v-if="!errorOccurred"> | ||
<div class="adyen-card-header"> | ||
<div class="adyen-card-header-first"> | ||
<span v-if="!captureRequests.length">{{ $tc('adyen.noCaptureRequests') }}</span> | ||
</div> | ||
<div id="modalButtonContainer"> | ||
<sw-button | ||
:disabled="!allowCapture" | ||
:square="false" | ||
:block="false" | ||
@click="openModal" | ||
class="sw-button--small"> | ||
{{ $tc('adyen.sendCaptureRequest') }} | ||
</sw-button> | ||
</div> | ||
<sw-modal v-if="showModal" | ||
@modal-close="onCloseModal" | ||
:title="$tc('adyen.captureConfirm') + ': ' + order.orderNumber" | ||
variant="small"> | ||
<template #modal-footer> | ||
<sw-button @click="onCloseModal" size="small"> | ||
{{ $tc('global.default.cancel') }} | ||
</sw-button> | ||
|
||
<sw-button @click="onSubmitCapture" variant="primary" size="small" :isLoading="isLoading"> | ||
{% block adyen_capture %} | ||
<sw-card :isLoading="isLoading" :title="$tc('adyen.adyenPaymentCaptureTitle')" v-if="showWidget" :large="false" :hero="false"> | ||
<div v-if="!errorOccurred"> | ||
<div class="adyen-card-header"> | ||
<div class="adyen-card-header-first"> | ||
<span v-if="!captureRequests.length">{{ $tc('adyen.noCaptureRequests') }}</span> | ||
</div> | ||
<div id="modalButtonContainer"> | ||
<sw-button | ||
:disabled="!allowCapture" | ||
:square="false" | ||
:block="false" | ||
@click="openModal" | ||
class="sw-button--small"> | ||
{{ $tc('adyen.sendCaptureRequest') }} | ||
</sw-button> | ||
</template> | ||
</sw-modal> | ||
</div> | ||
<sw-modal v-if="showModal" | ||
@modal-close="onCloseModal" | ||
:title="$tc('adyen.captureConfirm') + ': ' + order.orderNumber" | ||
variant="small"> | ||
<template #modal-footer> | ||
<sw-button @click="onCloseModal" size="small"> | ||
{{ $tc('global.default.cancel') }} | ||
</sw-button> | ||
|
||
<sw-button @click="onSubmitCapture" variant="primary" size="small" :isLoading="isLoading"> | ||
{{ $tc('adyen.sendCaptureRequest') }} | ||
</sw-button> | ||
</template> | ||
</sw-modal> | ||
</div> | ||
<sw-data-grid | ||
v-if="captureRequests.length" | ||
:dataSource="captureRequests" | ||
:columns="columns" | ||
:showSelection="false" | ||
:showActions="false" | ||
:isLoading="isLoading"> | ||
</sw-data-grid> | ||
</div> | ||
<div v-else> | ||
{{ $tc('adyen.error') }} | ||
</div> | ||
<sw-data-grid | ||
v-if="captureRequests.length" | ||
:dataSource="captureRequests" | ||
:columns="columns" | ||
:showSelection="false" | ||
:showActions="false" | ||
:isLoading="isLoading"> | ||
</sw-data-grid> | ||
</div> | ||
<div v-else> | ||
{{ $tc('adyen.error') }} | ||
</div> | ||
</sw-card> | ||
</sw-card> | ||
{% endblock %} |
44 changes: 44 additions & 0 deletions
44
src/Resources/app/administration/src/helper/versionHelper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* ###### | ||
* ###### | ||
* ############ ####( ###### #####. ###### ############ ############ | ||
* ############# #####( ###### #####. ###### ############# ############# | ||
* ###### #####( ###### #####. ###### ##### ###### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ###### | ||
* ############# ############# ############# ############# ##### ###### | ||
* ############ ############ ############# ############ ##### ###### | ||
* ###### | ||
* ############# | ||
* ############ | ||
* | ||
* Adyen plugin for Shopware 6 | ||
* | ||
* Copyright (c) 2023 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
*/ | ||
let exports = {}; | ||
|
||
exports.isVersionOlderThan65 = () => { | ||
function semverCompare(a, b) { | ||
if (a.startsWith(b + "-")) { | ||
return -1 | ||
} else if (b.startsWith(a + "-")) { | ||
return 1 | ||
} | ||
|
||
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "case", caseFirst: "upper" }) | ||
}; | ||
|
||
const version = Shopware.Context.app.config.version; | ||
|
||
if (semverCompare(version, "6.5.0.0") === -1) { | ||
return true | ||
} else { | ||
return false; | ||
} | ||
}; | ||
|
||
export default exports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/Resources/app/administration/src/sw-order-detail-details-override/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import template from './sw-order-detail-details.html.twig'; | ||
|
||
Shopware.Component.override('sw-order-detail-details', { | ||
template | ||
}); |
5 changes: 5 additions & 0 deletions
5
...app/administration/src/sw-order-detail-details-override/sw-order-detail-details.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% block sw_order_detail_details_payment_method_select %} | ||
{% parent %} | ||
|
||
<adyen-partial-payments :order="order"></adyen-partial-payments> | ||
{% endblock %} |
5 changes: 5 additions & 0 deletions
5
src/Resources/app/administration/src/sw-order-detail-general-override/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import template from './sw-order-detail-general.html.twig'; | ||
|
||
Shopware.Component.override('sw-order-detail-general', { | ||
template | ||
}); |
6 changes: 6 additions & 0 deletions
6
...app/administration/src/sw-order-detail-general-override/sw-order-detail-general.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% block sw_order_detail_general_line_items_card %} | ||
{% parent %} | ||
<adyen-payment-capture :order="order"></adyen-payment-capture> | ||
<adyen-refund :order="order"></adyen-refund> | ||
<adyen-notifications :order="order"></adyen-notifications> | ||
{% endblock %} |
4 changes: 0 additions & 4 deletions
4
src/Resources/app/administration/src/sw-order-detail-override/sw-order-detail.html.twig
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware64.js.dist
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware65.js.dist
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Resources/public/administration/js/adyen-payment-shopware6.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Resources/public/administration/js/adyen-payment-shopware64.js.dist
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Resources/public/administration/js/adyen-payment-shopware65.js.dist
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.