Skip to content

Commit 454d670

Browse files
Release v3.0.0
* [ADD] Checkout v4 as primary version. * [DEL] Developer options for previous checkout versions.
2 parents 9d0d085 + b4a9cb8 commit 454d670

File tree

7 files changed

+23
-37
lines changed

7 files changed

+23
-37
lines changed

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Change Log
22

3+
#### [v3.0.0](https://github.com/aplazame/magento2/tree/v3.0.0) (2024-02-26)
4+
5+
* [ADD] Checkout v4 as primary version.
6+
* [DEL] Developer options for previous checkout versions.
7+
38
#### [v2.10.2](https://github.com/aplazame/magento2/tree/v2.10.2) (2024-01-31)
49

510
* [FIX] Various settings tweaks.

src/Controller/Payment/Index.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,15 @@ class Index extends Action
2020
*/
2121
private $aplazameClient;
2222

23-
/**
24-
* @var \Aplazame\Payment\Gateway\Config\Config
25-
*/
26-
private $aplazameConfig;
27-
2823
public function __construct(
2924
\Magento\Framework\App\Action\Context $context,
3025
\Magento\Checkout\Model\Session $checkoutSession,
31-
\Aplazame\Payment\Model\Api\AplazameClient $aplazameClient,
32-
\Aplazame\Payment\Gateway\Config\Config $aplazameConfig
26+
\Aplazame\Payment\Model\Api\AplazameClient $aplazameClient
3327
) {
3428
parent::__construct($context);
3529

3630
$this->quote = $checkoutSession->getQuote();
3731
$this->aplazameClient = $aplazameClient;
38-
$this->aplazameConfig = $aplazameConfig;
3932
}
4033

4134
/**
@@ -66,12 +59,21 @@ public function execute()
6659
$payload = json_decode(json_encode(Checkout::createFromQuote($this->quote)), true);
6760

6861
try {
69-
$checkout = $this->aplazameClient->apiClient->request(
70-
'POST',
71-
'/checkout',
72-
$payload,
73-
$this->aplazameConfig->isCheckoutV4() ? 4 : 3
74-
);
62+
try {
63+
$checkout = $this->aplazameClient->apiClient->request(
64+
'POST',
65+
'/checkout',
66+
$payload,
67+
4
68+
);
69+
} catch ( \Exception $e) {
70+
$checkout = $this->aplazameClient->apiClient->request(
71+
'POST',
72+
'/checkout',
73+
$payload,
74+
3
75+
);
76+
}
7577
$response->setBody(json_encode($checkout));
7678
} catch (ApiClientException $e) {
7779
$response->setStatusCode(400);

src/Gateway/Config/Config.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,4 @@ public function shouldAutoInvoice()
260260
{
261261
return (bool) $this->getValue('autoinvoice');
262262
}
263-
264-
/**
265-
* @return bool
266-
*/
267-
public function isCheckoutV4()
268-
{
269-
return (bool) $this->getValue('aplazame_dev/checkout_v4');
270-
}
271263
}

src/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aplazame/magento2",
3-
"version": "2.10.2",
3+
"version": "3.0.0",
44
"description": "Aplazame Magento 2 module",
55
"type": "magento2-module",
66
"homepage": "https://aplazame.com/",

src/etc/adminhtml/system.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,6 @@
194194
<comment>Change Aplazame's internal ID from 'quote' to 'order' when an order is confirmed, the 'order_' prefix will be used to avoid DB problems with duplicate numeric IDs</comment>
195195
</field>
196196
</group>
197-
198-
<group id="aplazame_dev" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
199-
<label>Developer Settings (WARNING: DO NOT TOUCH IF NOT NECESSARY)</label>
200-
201-
<field id="checkout_v4" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
202-
<label>Checkout v4</label>
203-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
204-
<comment>Use v4 checkout API</comment>
205-
</field>
206-
</group>
207197
</group>
208198
</section>
209199
</system>

src/etc/config.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
<payment_button>#aplazame-payment-method</payment_button>
4242
<change_to_order_id>0</change_to_order_id>
4343
</aplazame_misc>
44-
<aplazame_dev>
45-
<checkout_v4>0</checkout_v4>
46-
</aplazame_dev>
4744
</aplazame_payment>
4845
</payment>
4946
</default>

src/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Aplazame_Payment" setup_version="2.10.2">
3+
<module name="Aplazame_Payment" setup_version="3.0.0">
44
<sequence>
55
<module name="Magento_Store"/>
66
<module name="Magento_Catalog"/>

0 commit comments

Comments
 (0)