Skip to content

Commit e3bc988

Browse files
Release v3.7.0
2 parents 964c9a2 + b3e8e72 commit e3bc988

File tree

12 files changed

+168
-131
lines changed

12 files changed

+168
-131
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.7.0](https://github.com/aplazame/woocommerce/tree/v3.7.0) (2023-02-13)
4+
5+
* [ADD] Downpayment info option for widgets.
6+
* [FIX] Minor error at update and various tweaks.
7+
38
#### [v3.6.3](https://github.com/aplazame/woocommerce/tree/v3.6.3) (2022-10-25)
49

510
* [CHANGE] Checkout header.

Jenkinsfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ pipeline {
211211
branch 'master'
212212
}
213213
}
214+
environment {
215+
WORDPRESS_USERNAME = credentials('WORDPRESS_USERNAME')
216+
WORDPRESS_PASSWORD = credentials('WORDPRESS_PASSWORD')
217+
}
214218
steps {
215219
container('php') {
216220
sh """

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2022, Aplazame
3+
Copyright (c) 2023, Aplazame
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

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.6.3
4+
version ?= v3.7.0
55
errors = $(shell find . -type f -name "*.php" -exec php -l "{}" \;| grep "Errors parsing ";)
66

77
clean:

plugin/README.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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.0.3
5+
Tested up to: 6.1.1
66
Requires PHP: 5.3.0
7-
Stable tag: 3.6.3
7+
Stable tag: 3.7.0
88
License: BSD-3-Clause
99
License URI: https://github.com/aplazame/woocommerce/blob/master/LICENSE
1010

@@ -77,6 +77,11 @@ Of course, simply select an *"Aplazame refund"* in the product detail.
7777

7878
== Changelog ==
7979

80+
#### [v3.7.0](https://github.com/aplazame/woocommerce/tree/v3.7.0) (2023-02-13)
81+
82+
* [ADD] Downpayment info option for widgets.
83+
* [FIX] Minor error at update and various tweaks.
84+
8085
#### [v3.6.3](https://github.com/aplazame/woocommerce/tree/v3.6.3) (2022-10-25)
8186

8287
* [CHANGE] Checkout header.

plugin/aplazame.php

Lines changed: 5 additions & 29 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.6.3
5+
* Version: 3.7.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: 2.3
14-
* WC tested up to: 7.0.0
14+
* WC tested up to: 7.3.0
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.6.2';
28+
const VERSION = '3.7.0';
2929
const METHOD_ID = 'aplazame';
3030
const METHOD_TITLE = 'Aplazame';
3131

@@ -338,11 +338,12 @@ class WC_Aplazame_Install {
338338
'product_pay_in_4' => 'no',
339339
'cart_pay_in_4' => 'no',
340340
'widget_out_of_limits' => 'show',
341+
'product_downpayment_info' => 'yes',
342+
'cart_downpayment_info' => 'yes',
341343
);
342344

343345
public static function upgrade() {
344346
if ( version_compare( get_option( self::VERSION_KEY ), WC_Aplazame::VERSION, '<' ) ) {
345-
self::set_aplazame_profile();
346347
self::remove_redirect_page();
347348
/**
348349
*
@@ -408,31 +409,6 @@ private static function remove_aplazame_version() {
408409
delete_option( self::VERSION_KEY );
409410
}
410411

411-
private static function set_aplazame_profile() {
412-
/**
413-
*
414-
* @var WC_Aplazame $aplazame
415-
*/
416-
global $aplazame;
417-
418-
if ( ! $aplazame->private_api_key ) {
419-
return;
420-
}
421-
422-
$client = $aplazame->get_client()->apiClient;
423-
try {
424-
$client->patch(
425-
'/me',
426-
array(
427-
'confirmation_url' => '',
428-
)
429-
);
430-
} catch ( Exception $e ) {
431-
$aplazame->private_api_key = null;
432-
$aplazame->settings['private_api_key'] = null;
433-
}
434-
}
435-
436412
private static function remove_redirect_page() {
437413
include_once 'classes/lib/Redirect.php';
438414
$redirect = new Aplazame_Redirect();

plugin/classes/wc-aplazame-gateway.php

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ public function init_form_fields() {
276276
'description' => __( 'Number of default instalments in product widget', 'aplazame' ),
277277
'placeholder' => __( 'Optional (only numbers)', 'aplazame' ),
278278
),
279+
'product_downpayment_info' => array(
280+
'type' => 'checkbox',
281+
'title' => __( 'Downpayment info', 'aplazame' ),
282+
'description' => __( 'Show downpayment info in product widget', 'aplazame' ),
283+
'label' => __( 'Show downpayment info', 'aplazame' ),
284+
),
279285
'product_legal_advice' => array(
280286
'type' => 'checkbox',
281287
'title' => __( 'Legal notice', 'aplazame' ),
@@ -369,6 +375,12 @@ public function init_form_fields() {
369375
'description' => __( 'Number of default instalments in cart widget', 'aplazame' ),
370376
'placeholder' => __( 'Optional (only numbers)', 'aplazame' ),
371377
),
378+
'cart_downpayment_info' => array(
379+
'type' => 'checkbox',
380+
'title' => __( 'Downpayment info', 'aplazame' ),
381+
'description' => __( 'Show downpayment info in cart widget', 'aplazame' ),
382+
'label' => __( 'Show downpayment info', 'aplazame' ),
383+
),
372384
'cart_legal_advice' => array(
373385
'type' => 'checkbox',
374386
'title' => __( 'Legal notice', 'aplazame' ),
@@ -435,17 +447,18 @@ public function init_form_fields() {
435447
}
436448

437449
protected function validate_private_api_key_field( $key, $value ) {
438-
try {
439-
$response = WC_Aplazame::configure_aplazame_profile( $this->settings['sandbox'], $value );
440-
} catch ( Exception $e ) {
441-
// Workaround https://github.com/woocommerce/woocommerce/issues/11952
442-
WC_Admin_Settings::add_error( $e->getMessage() );
450+
if ( $value != $this->settings['private_api_key'] ) {
451+
try {
452+
$response = WC_Aplazame::configure_aplazame_profile( $this->settings['sandbox'], $value );
453+
} catch ( Exception $e ) {
454+
// Workaround https://github.com/woocommerce/woocommerce/issues/11952
455+
WC_Admin_Settings::add_error( $e->getMessage() );
456+
457+
throw $e;
458+
}
443459

444-
throw $e;
460+
$this->settings['public_api_key'] = $response['public_api_key'];
445461
}
446-
447-
$this->settings['public_api_key'] = $response['public_api_key'];
448-
449462
return $value;
450463
}
451464
}
331 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)