Skip to content

Commit

Permalink
Merge pull request #588 from Adyen/develop-3
Browse files Browse the repository at this point in the history
Release version 3.17.2
  • Loading branch information
goran-stamenkovski-logeecom authored Dec 19, 2024
2 parents 80a00c8 + 739fdd1 commit 1c39c4c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
}
],
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
"version": "3.17.1",
"version": "3.17.2",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
"shopware/core": "~6.4.11 || ~6.5.0",
"shopware/storefront": "~6.4.11 || ~6.5.0",
"adyen/php-api-library": "^17.5.0",
"adyen/php-api-library": "^20.2.0",
"adyen/php-webhook-module": "0.8.0",
"ext-json": "*"
},
Expand Down

Large diffs are not rendered by default.

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 @@ -664,3 +670,4 @@ export default class ConfirmOrderPlugin extends Plugin {
return extra;
}
}

4 changes: 3 additions & 1 deletion src/Service/CaptureService.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,13 @@ private function getLineItemsObjectArray(
continue;
}

$highestTaxRate = $lineItem->getPrice()->getTaxRules()->highestRate();

$lineItemData = [
'amountIncludingTax' => ceil($lineItem->getPrice()->getTotalPrice() * 100),
'description' => $lineItem->getLabel(),
'taxAmount' => intval($lineItem->getPrice()->getCalculatedTaxes()->getAmount() * 100),
'taxPercentage' => $lineItem->getPrice()->getTaxRules()->highestRate()->getPercentage() * 10,
'taxPercentage' => $highestTaxRate !== null ? ($highestTaxRate->getPercentage() * 10) : 0,
'quantity' => $lineItem->getQuantity(),
'id' => $lineItem->getId()
];
Expand Down

0 comments on commit 1c39c4c

Please sign in to comment.