-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #621 from mollie/release/2.23.0
Release/2.23.0
- Loading branch information
Showing
28 changed files
with
6,863 additions
and
1,315 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Mollie\Payment\GraphQL\Resolver\General; | ||
|
||
use Magento\Framework\GraphQl\Config\Element\Field; | ||
use Magento\Framework\GraphQl\Query\ResolverInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
use Mollie\Payment\Config; | ||
|
||
class MollieStoreConfig implements ResolverInterface | ||
{ | ||
/** | ||
* @var Config | ||
*/ | ||
private $config; | ||
|
||
public function __construct( | ||
Config $config | ||
) { | ||
$this->config = $config; | ||
} | ||
|
||
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) | ||
{ | ||
return [ | ||
'profile_id' => $this->config->getProfileId(), | ||
'live_mode' => $this->config->isProductionMode(), | ||
]; | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
namespace Mollie\Payment\Plugin\Sales\Api; | ||
|
||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Sales\Api\OrderManagementInterface; | ||
use Mollie\Payment\Service\LockService; | ||
|
||
class OrderManagementPlugin | ||
{ | ||
/** | ||
* @var LockService | ||
*/ | ||
private $lockService; | ||
|
||
public function __construct( | ||
LockService $lockService | ||
) { | ||
$this->lockService = $lockService; | ||
} | ||
|
||
public function aroundCancel( | ||
OrderManagementInterface $subject, | ||
callable $proceed, | ||
$orderId | ||
) { | ||
// Lock the order, so we are sure that there are no other operations running on the order at the same time. | ||
$key = 'mollie.order.' . $orderId; | ||
if (!$this->lockService->lock($key)) { | ||
throw new LocalizedException(__('Unable to get lock for %1', $key)); | ||
} | ||
|
||
$result = $proceed($orderId); | ||
|
||
$this->lockService->unlock($key); | ||
|
||
return $result; | ||
} | ||
} |
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.