Skip to content

Commit b89f27a

Browse files
Release v4.0.0
* [ADD] Checkout v4 as primary version. * [DEL] Developer options for previous checkout versions.
2 parents 9df0d9e + 02ef3e7 commit b89f27a

File tree

6 files changed

+22
-27
lines changed

6 files changed

+22
-27
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+
#### [v4.0.0](https://github.com/aplazame/woocommerce/tree/v4.0.0) (2024-02-26)
4+
5+
* [ADD] Checkout v4 as primary version.
6+
* [DEL] Developer options for previous checkout versions.
7+
38
#### [v3.9.0](https://github.com/aplazame/woocommerce/tree/v3.9.0) (2024-01-23)
49

510
* [ADD] HPOS compatibility.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugin_path ?= plugin
22
i18n_path ?= i18n/languages
33
i18n_name ?= aplazame-es_ES
4-
version ?= v3.9.0
4+
version ?= v4.0.0
55
errors = $(shell find . -type f -name "*.php" -exec php -l "{}" \;| grep "Errors parsing ";)
66

77
clean:

plugin/README.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: aplazame
33
Tags: aplazame,woocommerce,ecommerce,payment,checkout,credit,aplazar,financiar,financiera,financiación,pago aplazado,método de pago
44
Requires at least: 4.0.1
5-
Tested up to: 6.4.2
5+
Tested up to: 6.4.3
66
Requires PHP: 5.3.0
77
Stable tag: 3.9.0
88
License: BSD-3-Clause
@@ -77,6 +77,11 @@ Of course, simply select an *"Aplazame refund"* in the product detail.
7777

7878
== Changelog ==
7979

80+
#### [v4.0.0](https://github.com/aplazame/woocommerce/tree/v4.0.0) (2024-02-26)
81+
82+
* [ADD] Checkout v4 as primary version.
83+
* [DEL] Developer options for previous checkout versions.
84+
8085
#### [v3.9.0](https://github.com/aplazame/woocommerce/tree/v3.9.0) (2024-01-23)
8186

8287
* [ADD] HPOS compatibility.

plugin/aplazame.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Plugin Name: Aplazame
44
* Plugin URI: https://github.com/aplazame/woocommerce
5-
* Version: 3.9.0
5+
* Version: 4.0.0
66
* Description: Aplazame offers a payment method to receive funding for the purchases.
77
* Author: Aplazame
88
* Author URI: https://aplazame.com
@@ -11,7 +11,7 @@
1111
* Domain Path: /i18n/languages/
1212
*
1313
* WC requires at least: 3.0.0
14-
* WC tested up to: 8.5.1
14+
* WC tested up to: 8.6.1
1515
*
1616
* License: GNU General Public License v3.0
1717
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -25,7 +25,7 @@
2525
require_once 'lib/Aplazame/Aplazame/autoload.php';
2626

2727
class WC_Aplazame {
28-
const VERSION = '3.9.0';
28+
const VERSION = '4.0.0';
2929
const METHOD_ID = 'aplazame';
3030
const METHOD_TITLE = 'Aplazame';
3131

@@ -357,7 +357,6 @@ class WC_Aplazame_Install {
357357
'cart_downpayment_info' => 'yes',
358358
'product_widget_max_desired' => 'no',
359359
'cart_widget_max_desired' => 'no',
360-
'checkout_v4' => 'no',
361360
);
362361

363362
public static function upgrade() {

plugin/classes/sdk/Client.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,8 @@ public function refund( $order_id, $amount ) {
7878
* @throws Aplazame_Sdk_Api_ApiClientException if an I/O error occurs.
7979
* @throws Aplazame_Sdk_Api_ApiServerException if request is invalid.
8080
*/
81-
public function create_checkout( $payload, $checkout_v4 ) {
82-
return $this->request(
83-
'POST',
84-
'/checkout',
85-
$payload,
86-
$checkout_v4 === 'yes' ? 4 : 3
87-
);
81+
public function create_checkout( $payload, $apiVersion ) {
82+
return $this->request( 'POST', '/checkout', $payload, $apiVersion );
8883
}
8984

9085
/**

plugin/classes/wc-aplazame-gateway.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ public function checkout( $order_id ) {
101101

102102
$client = $aplazame->get_client();
103103
try {
104-
$aplazame_payload = $client->create_checkout( $payload, $aplazame->settings['checkout_v4'] );
104+
try {
105+
$aplazame_payload = $client->create_checkout( $payload, 4 );
106+
} catch ( Exception $e ) {
107+
$aplazame_payload = $client->create_checkout( $payload, 3 );
108+
}
105109
} catch ( Aplazame_Sdk_Api_AplazameExceptionInterface $e ) {
106110
$message = $e->getMessage();
107111
$aOrder = $client->fetch( $payload->order->id );
@@ -464,19 +468,6 @@ public function init_form_fields() {
464468
'description' => __( 'Aplazame Button Image that you want to show', 'aplazame' ),
465469
'placeholder' => WC_Aplazame_Install::$defaultSettings['button_image'],
466470
),
467-
468-
// Developer settings
469-
'dev_section' => array(
470-
'title' => __( 'Developer Settings (WARNING: DO NOT TOUCH IF NOT NECESSARY)', 'aplazame' ),
471-
'type' => 'title',
472-
'description' => '',
473-
),
474-
'checkout_v4' => array(
475-
'type' => 'checkbox',
476-
'title' => __( 'Checkout v4', 'aplazame' ),
477-
'description' => __( 'Use v4 checkout API', 'aplazame' ),
478-
'label' => __( 'Turn on v4 checkout API', 'aplazame' ),
479-
),
480471
);
481472
}
482473

0 commit comments

Comments
 (0)