Skip to content

Commit

Permalink
Merge pull request #672 from mollie/release/2.29.1
Browse files Browse the repository at this point in the history
Release/2.29.1
  • Loading branch information
Marvin-Magmodules committed Jul 28, 2023
2 parents 5104662 + 186203f commit 5636a71
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/end-2-end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
env:
MOLLIE_API_KEY_TEST: ${{ secrets.MOLLIE_API_KEY_TEST }}
if: "${{ env.MOLLIE_API_KEY_TEST != '' }}"
run: echo "is_mollie_api_key_test_set=true" >> $GITHUB_OUTPUT
# Disabled for now. Change to =true to re-enable.
run: echo "is_mollie_api_key_test_set=false" >> $GITHUB_OUTPUT

# Remove flag used to trigger the e2e tests
remove_flag:
Expand Down
2 changes: 1 addition & 1 deletion Model/Client/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function startTransaction(Order $order, $mollieApi)
$orderId = $order->getEntityId();

$transactionId = $order->getMollieTransactionId();
if (!empty($transactionId) && !preg_match('/^ord_\w+$/', $transactionId)) {
if (!empty($transactionId) && substr($transactionId, 0, 4) != 'ord_') {
$payment = $mollieApi->payments->get($transactionId);
return $payment->getCheckoutUrl();
}
Expand Down
4 changes: 2 additions & 2 deletions Model/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public function processTransactionForOrder(OrderInterface $order, $type = 'webho
$type,
$paymentToken
) {
if (preg_match('/^ord_\w+$/', $transactionId)) {
if (substr($transactionId, 0, 4) == 'ord_') {
$result = $this->ordersProcessTraction->execute($order, $type)->toArray();
} else {
$mollieApi = $this->mollieApiClient->loadByStore($order->getStoreId());
Expand Down Expand Up @@ -398,7 +398,7 @@ public function orderHasUpdate($orderId)

$mollieApi = $this->mollieApiClient->loadByStore($order->getStoreId());

if (preg_match('/^ord_\w+$/', $transactionId)) {
if (substr($transactionId, 0, 4) == 'ord_') {
return $this->ordersApi->orderHasUpdate($order, $mollieApi);
} else {
return $this->paymentsApi->orderHasUpdate($order, $mollieApi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function execute(Observer $observer)
$order = $shipment->getOrder();

$transactionId = $order->getMollieTransactionId() ?? '';
$useOrdersApi = preg_match('/^ord_\w+$/', $transactionId);
$useOrdersApi = substr($transactionId, 0, 4) == 'ord_';
if ($useOrdersApi) {
$this->ordersApi->createShipment($shipment, $order);
}
Expand Down
2 changes: 1 addition & 1 deletion Service/Mollie/Order/CreateInvoiceOnShipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function execute(OrderInterface $order): bool
}

$transactionId = $order->getMollieTransactionId() ?? '';
$api = preg_match('/^ord_\w+$/', $transactionId) ? 'orders' : 'payments';
$api = substr($transactionId, 0, 4) == 'ord_' ? 'orders' : 'payments';
if ($methodCode == 'mollie_methods_creditcard' &&
$this->config->useManualCapture($order->getStoreId()) &&
$api == 'payments'
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": "mollie/magento2",
"description": "Mollie Payment Module for Magento 2",
"version": "2.29.0",
"version": "2.29.1",
"keywords": [
"mollie",
"payment",
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<default>
<payment>
<mollie_general>
<version>v2.29.0</version>
<version>v2.29.1</version>
<active>0</active>
<enabled>0</enabled>
<type>test</type>
Expand Down

0 comments on commit 5636a71

Please sign in to comment.