Skip to content

Commit

Permalink
Merge pull request #584 from Adyen/prepare-release
Browse files Browse the repository at this point in the history
Release version 4.2.2
  • Loading branch information
teodoratimoti authored Dec 19, 2024
2 parents 9ad6eaa + 772fcd7 commit 808972f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 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": "4.2.1",
"version": "4.2.2",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
Expand Down

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions src/Resources/app/storefront/src/checkout/confirm-order.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,17 @@ export default class ConfirmOrderPlugin extends Plugin {
componentConfig.onCancel(data, component, this);
},
onError: (error, component) => {
if (component.props.name === 'PayPal' && error.name === 'CANCEL') {
if (component.props.name === 'PayPal') {
this._client.post(
`${adyenCheckoutOptions.cancelOrderTransactionUrl}`,
JSON.stringify({orderId: this.orderId})
JSON.stringify({orderId: this.orderId}),
() => {
ElementLoadingIndicatorUtil.remove(document.body);
componentConfig.onError(error, component, this);
}
);

return;
}

ElementLoadingIndicatorUtil.remove(document.body);
Expand Down Expand Up @@ -547,8 +553,8 @@ export default class ConfirmOrderPlugin extends Plugin {
getSelectedPaymentMethodKey() {
return Object.keys(
adyenConfiguration.paymentMethodTypeHandlers).find(
key => adyenConfiguration.paymentMethodTypeHandlers[key] ===
adyenCheckoutOptions.selectedPaymentMethodHandler);
key => adyenConfiguration.paymentMethodTypeHandlers[key] ===
adyenCheckoutOptions.selectedPaymentMethodHandler);
}

mountCustomPayButton(paymentMethodInstance) {
Expand Down Expand Up @@ -625,16 +631,16 @@ export default class ConfirmOrderPlugin extends Plugin {

let shoppingCartSummaryDetails =
'<dt class="col-7 checkout-aside-summary-label checkout-aside-summary-total adyen-giftcard-summary">' +
adyenCheckoutOptions.translationAdyenGiftcardDiscount +
adyenCheckoutOptions.translationAdyenGiftcardDiscount +
'</dt>' +
'<dd class="col-5 checkout-aside-summary-value checkout-aside-summary-total adyen-giftcard-summary">' +
adyenCheckoutOptions.currencySymbol + giftcardDiscount +
adyenCheckoutOptions.currencySymbol + giftcardDiscount +
'</dd>' +
'<dt class="col-7 checkout-aside-summary-label checkout-aside-summary-total adyen-giftcard-summary">' +
adyenCheckoutOptions.translationAdyenGiftcardRemainingAmount +
adyenCheckoutOptions.translationAdyenGiftcardRemainingAmount +
'</dt>' +
'<dd class="col-5 checkout-aside-summary-value checkout-aside-summary-total adyen-giftcard-summary">' +
adyenCheckoutOptions.currencySymbol + remainingAmount +
adyenCheckoutOptions.currencySymbol + remainingAmount +
'</dd>';

this.shoppingCartSummaryBlock[0].innerHTML += shoppingCartSummaryDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default class AdyenGivingPlugin extends Plugin {
init() {
this._client = new HttpClient();
this.adyenCheckout = Promise;
this.initializeCheckoutComponent().bind(this);
let boundInitializeCheckout = this.initializeCheckoutComponent.bind(this);
boundInitializeCheckout();
}

async initializeCheckoutComponent () {
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CaptureService.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private function getLineItemsObjectArray(
'amountIncludingTax' => ceil($lineItem->getPrice()->getTotalPrice() * 100),
'description' => $lineItem->getLabel(),
'taxAmount' => intval($lineItem->getPrice()->getCalculatedTaxes()->getAmount() * 100),
'taxPercentage' => $lineItem->getPrice()->getTaxRules()->highestRate()->getPercentage() * 10,
'taxPercentage' => ($lineItem->getPrice()->getTaxRules()->highestRate()?->getPercentage() ?? 0) * 10,
'quantity' => $lineItem->getQuantity(),
'id' => $lineItem->getId()
];
Expand Down

0 comments on commit 808972f

Please sign in to comment.