Skip to content

Commit

Permalink
Release 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vttn committed May 31, 2021
1 parent a897297 commit 0c45256
Show file tree
Hide file tree
Showing 37 changed files with 150 additions and 112 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.0
- Support for Shopware 6.4

# 3.1.0
- Support for Custom Products plugin

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.0
- Unterstützung für Shopware 6.4

# 3.1.0
- Unterstützung für Custom Products Plugin

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ The PostFinanceCheckout Payment plugin wraps around the PostFinanceCheckout API.

## Requirements

- PHP 7.2 and above
- Shopware 6.2.3 and above
- PHP 7.4 and above
- Shopware 6.4 and above

## Installation

Expand Down Expand Up @@ -61,7 +61,7 @@ tail -f var/log/postfinancecheckout_payment*.log

## Documentation

[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/3.1.0/docs/en/documentation.html)
[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/shopware-6/4.0.0/docs/en/documentation.html)

## License

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
}
},
"conflict": {
"shopware/administration": "<6,>=7",
"shopware/storefront": "<6,>=7"
"shopware/administration": "<6.4,>=7",
"shopware/storefront": "<6.4,>=7"
},
"description": "PostFinanceCheckout integration for Shopware 6",
"extra": {
Expand Down Expand Up @@ -48,11 +48,11 @@
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=7.2",
"shopware/core": "~6.2.3 || ~6.3",
"shopware/storefront": "~6.2.3 || ~6.3",
"php": ">=7.4",
"shopware/core": "~6.4",
"shopware/storefront": "~6.4",
"postfinancecheckout/sdk": "3.0.0"
},
"type": "shopware-platform-plugin",
"version": "3.1.0"
"version": "4.0.0"
}
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/pfpayments/shopware-6/releases/tag/3.1.0/">
<a href="https://github.com/pfpayments/shopware-6/releases/tag/4.0.0/">
Source
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function setLogger(LoggerInterface $logger): void
* @return \Symfony\Component\HttpFoundation\JsonResponse
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/configuration/set-postfinancecheckout-as-sales-channel-payment-default",
* "/api/_action/postfinancecheckout/configuration/set-postfinancecheckout-as-sales-channel-payment-default",
* name="api.action.postfinancecheckout.configuration.set-postfinancecheckout-as-sales-channel-payment-default",
* methods={"POST"}
* )
Expand All @@ -110,7 +110,7 @@ public function setPostFinanceCheckoutAsSalesChannelPaymentDefault(Request $requ
* @throws \PostFinanceCheckout\Sdk\VersioningException
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/configuration/register-web-hooks",
* "/api/_action/postfinancecheckout/configuration/register-web-hooks",
* name="api.action.postfinancecheckout.configuration.register-web-hooks",
* methods={"POST"}
* )
Expand All @@ -133,7 +133,7 @@ public function registerWebHooks(Request $request): JsonResponse
* @return \Symfony\Component\HttpFoundation\JsonResponse
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/configuration/synchronize-payment-method-configuration",
* "/api/_action/postfinancecheckout/configuration/synchronize-payment-method-configuration",
* name="api.action.postfinancecheckout.configuration.synchronize-payment-method-configuration",
* methods={"POST"}
* )
Expand Down Expand Up @@ -165,7 +165,7 @@ public function synchronizePaymentMethodConfiguration(Request $request, Context
* @return \Symfony\Component\HttpFoundation\JsonResponse
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/configuration/install-order-delivery-states",
* "/api/_action/postfinancecheckout/configuration/install-order-delivery-states",
* name="api.action.postfinancecheckout.configuration.install-order-delivery-states",
* methods={"POST"}
* )
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Api/Refund/Controller/RefundController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function setLogger(LoggerInterface $logger): void
* @throws \PostFinanceCheckout\Sdk\Http\ConnectionException
* @throws \PostFinanceCheckout\Sdk\VersioningException
* @Route(
* "/api/v{version}/_action/postfinancecheckout/refund/create-refund/",
* "/api/_action/postfinancecheckout/refund/create-refund/",
* name="api.action.postfinancecheckout.refund.create-refund",
* methods={"POST"}
* )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function setLogger(LoggerInterface $logger): void
* @throws \PostFinanceCheckout\Sdk\VersioningException
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/transaction-completion/create-transaction-completion/",
* "/api/_action/postfinancecheckout/transaction-completion/create-transaction-completion/",
* name="api.action.postfinancecheckout.transaction-completion.create-transaction-completion",
* methods={"POST"}
* )
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Api/Transaction/Controller/TransactionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function setLogger(LoggerInterface $logger): void
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
* @Route(
* "/api/v{version}/_action/postfinancecheckout/transaction/get-transaction-data/",
* "/api/_action/postfinancecheckout/transaction/get-transaction-data/",
* name="api.action.postfinancecheckout.transaction.get-transaction-data",
* methods={"POST"}
* )
Expand Down Expand Up @@ -104,7 +104,7 @@ public function getTransactionData(Request $request, Context $context): JsonResp
* @throws \PostFinanceCheckout\Sdk\VersioningException
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/transaction/get-invoice-document/{salesChannelId}/{transactionId}",
* "/api/_action/postfinancecheckout/transaction/get-invoice-document/{salesChannelId}/{transactionId}",
* name="api.action.postfinancecheckout.transaction.get-invoice-document",
* methods={"GET"},
* defaults={"csrf_protected"=false, "auth_required"=false}
Expand Down Expand Up @@ -140,7 +140,7 @@ public function getInvoiceDocument(string $salesChannelId, int $transactionId):
* @throws \PostFinanceCheckout\Sdk\VersioningException
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/transaction/get-packing-slip/{salesChannelId}/{transactionId}",
* "/api/_action/postfinancecheckout/transaction/get-packing-slip/{salesChannelId}/{transactionId}",
* name="api.action.postfinancecheckout.transaction.get-packing-slip",
* methods={"GET"},
* defaults={"csrf_protected"=false, "auth_required"=false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function setLogger(LoggerInterface $logger): void
* @throws \PostFinanceCheckout\Sdk\VersioningException
*
* @Route(
* "/api/v{version}/_action/postfinancecheckout/transaction-void/create-transaction-void/",
* "/api/_action/postfinancecheckout/transaction-void/create-transaction-void/",
* name="api.action.postfinancecheckout.transaction-void.create-transaction-void",
* methods={"POST"}
* )
Expand Down
14 changes: 6 additions & 8 deletions src/Core/Api/Transaction/Service/OrderMailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
Checkout\Cart\Exception\OrderNotFoundException,
Checkout\Order\OrderEntity,
Content\MailTemplate\MailTemplateEntity,
Content\MailTemplate\MailTemplateTypes,
Content\MailTemplate\Service\MailServiceInterface,
Content\Mail\Service\AbstractMailService,
Framework\Context,
Framework\DataAbstractionLayer\Search\Criteria,
Framework\DataAbstractionLayer\Search\Filter\EqualsFilter,
Framework\DataAbstractionLayer\Search\Filter\NotFilter,
Framework\DataAbstractionLayer\Search\Filter\OrFilter,
Framework\Event\EventAction\EventActionCollection,
System\SalesChannel\SalesChannelEntity};
Framework\Event\EventAction\EventActionCollection};
use PostFinanceCheckoutPayment\Core\{
Api\Transaction\Entity\TransactionEntity,
Api\Transaction\Entity\TransactionEntityDefinition};
Expand Down Expand Up @@ -46,17 +44,17 @@ class OrderMailService {
protected $mailTemplateRepository;

/**
* @var \Shopware\Core\Content\MailTemplate\Service\MailServiceInterface
* @var \Shopware\Core\Content\Mail\Service\AbstractMailService
*/
protected $mailService;

/**
* MailService constructor.
*
* @param \Psr\Container\ContainerInterface $container
* @param \Shopware\Core\Content\MailTemplate\Service\MailServiceInterface $mailService
* @param \Psr\Container\ContainerInterface $container
* @param \Shopware\Core\Content\Mail\Service\AbstractMailService $mailService
*/
public function __construct(ContainerInterface $container, MailServiceInterface $mailService)
public function __construct(ContainerInterface $container, AbstractMailService $mailService)
{
$this->container = $container;
$this->mailService = $mailService;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Api/WebHooks/Controller/WebHookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function setLogger(LoggerInterface $logger): void
*
* @return \Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\Response
* @Route(
* "/api/v{version}/_action/postfinancecheckout/webHook/callback/{salesChannelId}",
* "/api/_action/postfinancecheckout/webHook/callback/{salesChannelId}",
* name="api.action.postfinancecheckout.webhook.update",
* options={"seo": "false"},
* defaults={"csrf_protected"=false, "XmlHttpRequest"=true, "auth_required"=false},
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Api/WebHooks/Service/WebHooksService.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ protected function getWebHookCallBackUrl(): string
{
return $this->router->generate(
'api.action.postfinancecheckout.webhook.update',
['version' => PlatformRequest::API_VERSION, 'salesChannelId' => $this->getSalesChannelId() ?? 'null',],
['salesChannelId' => $this->getSalesChannelId() ?? 'null',],
UrlGeneratorInterface::ABSOLUTE_URL
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getCreationTimestamp(): int
*/
public function update(Connection $connection): void
{
$connection->executeUpdate('
$connection->executeStatement('
CREATE TABLE IF NOT EXISTS `postfinancecheckout_payment_method_configuration` (
`id` BINARY(16) NOT NULL,
`data` JSON NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Migration1590156974TransactionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getCreationTimestamp(): int
*/
public function update(Connection $connection): void
{
$connection->executeUpdate('
$connection->executeStatement('
CREATE TABLE IF NOT EXISTS `postfinancecheckout_transaction` (
`id` BINARY(16) NOT NULL,
`data` JSON NOT NULL,
Expand Down
3 changes: 1 addition & 2 deletions src/Migration/Migration1590646356OrderEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ public function getCreationTimestamp(): int
* update non-destructive changes
*
* @param \Doctrine\DBAL\Connection $connection
* @throws \Doctrine\DBAL\DBALException
*/
public function update(Connection $connection): void
{
try {
$connection->executeUpdate('ALTER TABLE `order` ADD COLUMN `postfinancecheckout_lock` DATETIME DEFAULT NULL;');
$connection->executeStatement('ALTER TABLE `order` ADD COLUMN `postfinancecheckout_lock` DATETIME DEFAULT NULL;');
}catch (\Exception $exception){
echo $exception->getMessage();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Migration1590646356RefundEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getCreationTimestamp(): int
*/
public function update(Connection $connection): void
{
$connection->executeUpdate('
$connection->executeStatement('
CREATE TABLE IF NOT EXISTS `postfinancecheckout_refund` (
`id` BINARY(16) NOT NULL,
`data` JSON NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Migration1590646356TransactionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getCreationTimestamp(): int
public function update(Connection $connection): void
{
try {
$connection->executeUpdate('ALTER TABLE `postfinancecheckout_transaction` ADD COLUMN `confirmation_email_sent` TINYINT(1) NOT NULL DEFAULT 0 AFTER `id`;');
$connection->executeStatement('ALTER TABLE `postfinancecheckout_transaction` ADD COLUMN `confirmation_email_sent` TINYINT(1) NOT NULL DEFAULT 0 AFTER `id`;');
}catch (\Exception $exception){
// column probably exists
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getCreationTimestamp(): int
*/
public function update(Connection $connection): void
{
$connection->executeUpdate('ALTER TABLE `postfinancecheckout_payment_method_configuration` CHANGE `payment_method_configuration_id` `payment_method_configuration_id` bigint unsigned NOT NULL AFTER `data`;');
$connection->executeStatement('ALTER TABLE `postfinancecheckout_payment_method_configuration` CHANGE `payment_method_configuration_id` `payment_method_configuration_id` bigint unsigned NOT NULL AFTER `data`;');
}

/**
Expand Down
19 changes: 9 additions & 10 deletions src/Migration/Migration1605701048TransactionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,36 @@ public function getCreationTimestamp(): int
return 1605701048;
}

/**
* update non-destructive changes
*
* @param \Doctrine\DBAL\Connection $connection
* @throws \Doctrine\DBAL\DBALException
*/
/**
* update non-destructive changes
*
* @param \Doctrine\DBAL\Connection $connection
*/
public function update(Connection $connection): void
{

try {
$connection->executeUpdate('
$connection->executeStatement('
ALTER TABLE `postfinancecheckout_transaction`
ADD `order_version_id` binary(16) NOT NULL AFTER `transaction_id`;
');

$connection->executeUpdate('
$connection->executeStatement('
UPDATE `postfinancecheckout_transaction` t1
INNER JOIN `order` t2
ON t1.order_id = t2.id
SET t1.order_version_id = t2.version_id;
');

$connection->executeUpdate('
$connection->executeStatement('
ALTER TABLE `postfinancecheckout_transaction`
DROP FOREIGN KEY `fk.pfc_transaction.order_id`,
DROP FOREIGN KEY `fk.pfc_transaction.order_transaction_id`,
DROP FOREIGN KEY `fk.pfc_transaction.payment_method_id`,
DROP FOREIGN KEY `fk.pfc_transaction.sales_channel_id`;
');

$connection->executeUpdate('
$connection->executeStatement('
ALTER TABLE `postfinancecheckout_transaction`
ADD CONSTRAINT `fk.pfc_transaction_order_id` FOREIGN KEY (`order_id`, `order_version_id`)
REFERENCES `order` (`id`, `version_id`) ON DELETE CASCADE ON UPDATE CASCADE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PostFinanceCheckoutConfigurationService extends ApiService {
registerWebHooks(salesChannelId = null) {

const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/configuration/register-web-hooks`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/register-web-hooks`;

return this.httpClient.post(
apiRoute,
Expand All @@ -52,7 +52,7 @@ class PostFinanceCheckoutConfigurationService extends ApiService {
setPostFinanceCheckoutAsSalesChannelPaymentDefault(salesChannelId = null) {

const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/configuration/set-postfinancecheckout-as-sales-channel-payment-default`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/set-postfinancecheckout-as-sales-channel-payment-default`;

return this.httpClient.post(
apiRoute,
Expand All @@ -74,7 +74,7 @@ class PostFinanceCheckoutConfigurationService extends ApiService {
*/
synchronizePaymentMethodConfiguration(salesChannelId = null) {
const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/configuration/synchronize-payment-method-configuration`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/synchronize-payment-method-configuration`;

return this.httpClient.post(
apiRoute,
Expand All @@ -95,7 +95,7 @@ class PostFinanceCheckoutConfigurationService extends ApiService {
*/
installOrderDeliveryStates() {
const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/configuration/install-order-delivery-states`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/install-order-delivery-states`;

return this.httpClient.post(
apiRoute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PostFinanceCheckoutRefundService extends ApiService {
createRefund(salesChannelId, transactionId, refundableAmount) {

const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/refund/create-refund/`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund/`;

return this.httpClient.post(
apiRoute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PostFinanceCheckoutTransactionCompletionService extends ApiService {
createTransactionCompletion(salesChannelId, transactionId) {

const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/transaction-completion/create-transaction-completion/`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-completion/create-transaction-completion/`;

return this.httpClient.post(
apiRoute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PostFinanceCheckoutTransactionVoidService extends ApiService {
createTransactionVoid(salesChannelId, transactionId) {

const headers = this.getBasicHeaders();
const apiRoute = `_action/${this.getApiBasePath()}/transaction-void/create-transaction-void/`;
const apiRoute = `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-void/create-transaction-void/`;

return this.httpClient.post(
apiRoute,
Expand Down
Loading

0 comments on commit 0c45256

Please sign in to comment.