Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 6.5.2
* Fehler behoben, bei dem die AGB nicht bis zum Akzeptieren-Häkchen gescrollt wurden
* Falsche UI-Komponente für B2B-Rechnung korrigiert
* Fehlerhafte Kundendaten für UPL behoben
* Fehlerbehebung für Apple Pay in Nicht-Safari-Browsern
* Apple-Pay-Button wird nun immer angezeigt, wenn Apple Pay aktiv ist
* Buchungsmodus-Fix für Wero

# 6.5.1
* Minor Fix am Customer-Objekt für besseren PayPal-B2B-Support

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 6.5.2
* Fix for Terms and Conditions no scroll to accept checkmark
* Fix incorrect UI Comp. for B2B invoice
* Fix for incorrect customer data for UPL
* Fix for Apple Pay in Non-Safari browsers
* Fix to always show Apple Pay button when Apple Pay is active
* Booking mode fix for Wero

# 6.5.1
* Minor fix to customer object for better Paypal B2B support

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "unzerdev/shopware6",
"description": "Unzer payment integration for Shopware 6",
"version": "6.5.1",
"version": "6.5.2",
"type": "shopware-platform-plugin",
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand Down
14 changes: 8 additions & 6 deletions src/Components/CancelService/CancelService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class CancelService implements CancelServiceInterface
{
private const PAYLATER_PAYMENT_METHODS = [
public const PAYLATER_PAYMENT_METHODS = [
PaymentInstaller::PAYMENT_ID_PAYLATER_INVOICE,
PaymentInstaller::PAYMENT_ID_PAYLATER_INSTALLMENT,
PaymentInstaller::PAYMENT_ID_PAYLATER_DIRECT_DEBIT_SECURED,
Expand All @@ -41,7 +41,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function cancelChargeById(string $orderTransactionId, string $chargeId, float $amountGross, ?string $reasonCode, Context $context): void
public function cancelChargeById(string $orderTransactionId, string $chargeId, float $amountGross, ?string $reasonCode, Context $context, string $referenceText = ''): Cancellation
{
$decimalPrecision = UnzerPayment6::MAX_DECIMAL_PRECISION;

Expand Down Expand Up @@ -76,24 +76,26 @@ public function cancelChargeById(string $orderTransactionId, string $chargeId, f
$payment = UnzerTransactionUtil::fetchPaymentFromOrderTransaction($transaction, $client);
if ($this->isPaylaterPaymentMethod($transaction->getPaymentMethodId())) {
$cancellation = new Cancellation($amountGross);
$cancellation->setPaymentReference($referenceText);

$client->cancelChargedPayment(
$responseCancellation = $client->cancelChargedPayment(
$payment,
$cancellation
);
} else {
$client->cancelChargeById(
$responseCancellation = $client->cancelChargeById(
$payment,
$chargeId,
$amountGross,
$this->getCancelReasonCode($reasonCode),
'',
$referenceText,
$amountNet,
$amountVat
);
}

$this->updateOrderStatus($client, $transaction, $context);
return $responseCancellation;
}

/**
Expand Down Expand Up @@ -139,7 +141,7 @@ protected function getCancelReasonCode(?string $reasonCode): string
return $reasonCode ?? CancelReasonCodes::REASON_CODE_CANCEL;
}

protected function isPaylaterPaymentMethod(string $paymentMethodId): bool
public function isPaylaterPaymentMethod(string $paymentMethodId): bool
{
return \in_array($paymentMethodId, self::PAYLATER_PAYMENT_METHODS, true);
}
Expand Down
8 changes: 6 additions & 2 deletions src/Components/CancelService/CancelServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Shopware\Core\Framework\Context;
use UnzerSDK\Exceptions\UnzerApiException;
use UnzerSDK\Resources\TransactionTypes\Cancellation;

interface CancelServiceInterface
{
Expand All @@ -18,8 +19,9 @@ public function cancelChargeById(
string $chargeId,
float $amountGross,
?string $reasonCode,
Context $context
): void;
Context $context,
string $referenceText = ''
): Cancellation;

/**
* @throws UnzerApiException
Expand All @@ -31,4 +33,6 @@ public function cancelAuthorizationById(
float $amountGross,
Context $context
): void;

public function isPaylaterPaymentMethod(string $paymentMethodId): bool;
}
1 change: 1 addition & 0 deletions src/Components/ConfigReader/ConfigReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ConfigReader implements ConfigReaderInterface
public const CONFIG_KEY_PAYPAL_SHOW_SAVE_ACCOUNT = 'paypalShowSaveAccount';
public const CONFIG_KEY_DELIVERY_STATUS_FOR_CAPTURE = 'deliveryStatusForAutomaticCapture';
public const CONFIG_KEY_DELIVERY_STATUS_FOR_REFUND = 'deliveryStatusForAutomaticRefund';
public const CONFIG_KEY_DELIVERY_STATUS_FOR_RETURNS_REFUND = 'deliveryStatusForAutomaticReturnsRefund';

public const CONFIG_KEY_USE_EXPRESS_PAYPAL = 'usePaypalExpress';
public const CONFIG_KEY_USE_EXPRESS_GOOGLE = 'useGooglePayExpress';
Expand Down
Loading