-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vitalij Mik
committed
Mar 28, 2024
1 parent
5647685
commit 91ceee9
Showing
22 changed files
with
307 additions
and
49 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
polyfill/Shopware/Core/Checkout/Payment/Exception/PaymentProcessException.php
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,36 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Shopware\Core\Checkout\Payment\Exception; | ||
if (class_exists(__NAMESPACE__ . '/PaymentProcessException')) { | ||
return; | ||
} | ||
use Shopware\Core\Framework\Log\Package; | ||
use Shopware\Core\Framework\ShopwareHttpException; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
#[Package('checkout')] | ||
abstract class PaymentProcessException extends ShopwareHttpException | ||
{ | ||
private string $orderTransactionId; | ||
|
||
public function __construct( | ||
string $orderTransactionId, | ||
string $message, | ||
array $parameters = [], | ||
?\Throwable $e = null | ||
) { | ||
$this->orderTransactionId = $orderTransactionId; | ||
|
||
parent::__construct($message, $parameters, $e); | ||
} | ||
|
||
public function getStatusCode(): int | ||
{ | ||
return Response::HTTP_BAD_REQUEST; | ||
} | ||
|
||
public function getOrderTransactionId(): string | ||
{ | ||
return $this->orderTransactionId; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Components/Subscription/DAL/Currency/CurrencyExtension.php
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,24 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Kiener\MolliePayments\Components\Subscription\DAL\Currency; | ||
|
||
use Kiener\MolliePayments\Components\Subscription\DAL\Subscription\SubscriptionDefinition; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension; | ||
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\CascadeDelete; | ||
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField; | ||
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection; | ||
use Shopware\Core\System\Currency\CurrencyDefinition; | ||
|
||
class CurrencyExtension extends EntityExtension | ||
{ | ||
public function getDefinitionClass(): string | ||
{ | ||
return CurrencyDefinition::class; | ||
} | ||
|
||
public function extendFields(FieldCollection $collection): void | ||
{ | ||
$collection->add((new OneToManyAssociationField('subscriptions', SubscriptionDefinition::class, 'currency_id'))->addFlags(new CascadeDelete())); | ||
} | ||
} |
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
Oops, something went wrong.