Skip to content

Commit

Permalink
Merge pull request #283 from alma/release/v5.7.0
Browse files Browse the repository at this point in the history
Release v5.7.0
  • Loading branch information
Benjamin-Freoua-Alma authored Oct 8, 2024
2 parents 310d927 + dafda63 commit bc1ea7a
Show file tree
Hide file tree
Showing 23 changed files with 456 additions and 39 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## v5.7.0 - 2024-10-07

### Changes

### 🚀 New Features

- Integrate credit on in page (#282)
- Add hmac verification on ipn (#281)

#### Contributors

@Francois-Gomis, @alma-create-pr-with-team-review and @joyet-simon

## v5.6.0 - 2024-09-16

### Changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Tested up to Wordpress: 6.6.1
- Tested up to Woocommerce: 9.2.3
- Requires PHP: 5.6
- Stable tag: 5.6.0
- Stable tag: 5.7.0
- License: GPLv3
- License URI: https://www.gnu.org/licenses/gpl-3.0.html
- Support: [email protected]
Expand Down
15 changes: 14 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: payments, BNPL, woocommerce, ecommerce, e-commerce, payment gateway, sell,
Requires at least: 4.4
Tested up to: 6.3
Requires PHP: 5.6
Stable tag: 5.6.0
Stable tag: 5.7.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -51,6 +51,19 @@ You can find more documentation on our [website](https://docs.almapay.com/docs/w

== Changelog ==

## v5.7.0 - 2024-10-07

### Changes

### 🚀 New Features

- Integrate credit on in page (#282)
- Add hmac verification on ipn (#281)

#### Contributors

@Francois-Gomis, @alma-create-pr-with-team-review and @joyet-simon

## v5.6.0 - 2024-09-16

### Changes
Expand Down
4 changes: 2 additions & 2 deletions src/alma-gateway-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Alma - Pay in installments or later for WooCommerce
* Plugin URI: https://docs.almapay.com/docs/woocommerce
* Description: Install Alma and boost your sales! It's simple and guaranteed, your cash flow is secured. 0 commitment, 0 subscription, 0 risk.
* Version: 5.6.0
* Version: 5.7.0
* Author: Alma
* Author URI: https://almapay.com
* License: GNU General Public License v3.0
Expand Down Expand Up @@ -38,7 +38,7 @@
}

if ( ! defined( 'ALMA_VERSION' ) ) {
define( 'ALMA_VERSION', '5.6.0' );
define( 'ALMA_VERSION', '5.7.0' );
}
if ( ! defined( 'ALMA_PLUGIN_FILE' ) ) {
define( 'ALMA_PLUGIN_FILE', __FILE__ );
Expand Down
3 changes: 2 additions & 1 deletion src/assets/js/alma-checkout-in-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
function isAlmaInPageChecked() {
return $( '#payment_method_alma_in_page' ).is( ':checked' )
|| $( '#payment_method_alma_in_page_pay_now' ).is( ':checked' )
|| $( '#payment_method_alma_in_page_pay_later' ).is( ':checked' );
|| $( '#payment_method_alma_in_page_pay_later' ).is( ':checked' )
|| $( '#payment_method_alma_in_page_pnx_plus_4' ).is( ':checked' );
}

$( 'body' ).on(
Expand Down
2 changes: 1 addition & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"php": "^5.6 || ~7.0 || ~7.1 || ~7.2 || ~7.3 || ~7.4 || ~8.0 || ~8.1",
"alma/alma-php-client": "2.*",
"alma/alma-php-client": ">=2.2.0",
"ext-openssl": "*"
},
"require-dev": {
Expand Down
5 changes: 5 additions & 0 deletions src/includes/Admin/Helpers/FormFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ public function init_general_settings_fields( array $default_settings ) {
$title_gateway_in_page = array();
$fields_title_gateway_in_page = array();
$fields_description_gateway_in_page = array();
$fields_in_page_pnx_plus_4 = array();

$general_settings_fields = array(
'general_section' => array(
Expand All @@ -540,6 +541,9 @@ public function init_general_settings_fields( array $default_settings ) {
if ( $this->settings_helper->has_pay_later() ) {
$fields_in_page_pay_later = $this->get_custom_fields_payment_method( ConstantsHelper::GATEWAY_ID_IN_PAGE_PAY_LATER, __( 'Deferred Payments:', 'alma-gateway-for-woocommerce' ), $default_settings );
}
if ( $this->settings_helper->has_pnx_plus_4() ) {
$fields_in_page_pnx_plus_4 = $this->get_custom_fields_payment_method( ConstantsHelper::GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR, __( 'Payments in more than 4 installments:', 'alma-gateway-for-woocommerce' ), $default_settings );
}
}

if (
Expand Down Expand Up @@ -606,6 +610,7 @@ public function init_general_settings_fields( array $default_settings ) {
$fields_pay_later,
$fields_in_page_pay_later,
$fields_pnx_plus_4,
$fields_in_page_pnx_plus_4,
$general_settings_fields_end,
$field_cart_not_eligible_message_gift_cards
);
Expand Down
10 changes: 7 additions & 3 deletions src/includes/AlmaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
use Alma\Woocommerce\Exceptions\VersionDeprecated;
use Alma\Woocommerce\Factories\VersionFactory;
use Alma\Woocommerce\Gateways\Inpage\InPageGateway;
use Alma\Woocommerce\Gateways\Inpage\PayLaterGateway;
use Alma\Woocommerce\Gateways\Inpage\PayLaterGateway as InPagePayLaterGateway;
use Alma\Woocommerce\Gateways\Inpage\PayMoreThanFourGateway as InPagePayMoreThanFourGateway;
use Alma\Woocommerce\Gateways\Inpage\PayNowGateway as InPagePayNowGateway;
use Alma\Woocommerce\Gateways\Standard\PayLaterGateway;
use Alma\Woocommerce\Gateways\Standard\PayMoreThanFourGateway;
use Alma\Woocommerce\Gateways\Standard\PayNowGateway;
use Alma\Woocommerce\Gateways\Standard\StandardGateway;
Expand Down Expand Up @@ -194,12 +197,13 @@ public static function get_instance() {
*/
public function add_gateways( $gateways ) {
if ( ! is_admin() ) {
$gateways[] = \Alma\Woocommerce\Gateways\Inpage\PayNowGateway::class;
$gateways[] = InPagePayNowGateway::class;
$gateways[] = PayNowGateway::class;
$gateways[] = InPageGateway::class;
$gateways[] = PayMoreThanFourGateway::class;
$gateways[] = InPagePayLaterGateway::class;
$gateways[] = InPagePayMoreThanFourGateway::class;
$gateways[] = PayLaterGateway::class;
$gateways[] = \Alma\Woocommerce\Gateways\Standard\PayLaterGateway::class;
}

$gateways[] = StandardGateway::class;
Expand Down
1 change: 1 addition & 0 deletions src/includes/AlmaSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ public function should_display_plan( $plan_key, $gateway_id ) {
$this->get_installments_count( $plan_key ) === 1
&& ( $this->get_deferred_days( $plan_key ) !== 0 || $this->get_deferred_months( $plan_key ) !== 0 )
);
case ConstantsHelper::GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR:
case ConstantsHelper::GATEWAY_ID_MORE_THAN_FOUR:
return ( $this->get_installments_count( $plan_key ) > 4 );
default:
Expand Down
38 changes: 38 additions & 0 deletions src/includes/Builders/Helpers/SecurityHelperBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* SecurityHelperBuilder
*
* @package Alma\Woocommerce\Builders\Helpers
*/

namespace Alma\Woocommerce\Builders\Helpers;

use Alma\Woocommerce\Helpers\ProductHelper;
use Alma\Woocommerce\Helpers\SecurityHelper;
use Alma\Woocommerce\Traits\BuilderTrait;

if ( ! defined( 'ABSPATH' ) ) {
die( 'Not allowed' ); // Exit if accessed directly.
}

/**
* Class SecurityHelperBuilder
*
* @package Alma\Woocommerce\Builders\Helpers
*/
class SecurityHelperBuilder {

use BuilderTrait;

/**
* Get the instance of the SecurityHelper class
*
* @return SecurityHelper
*/
public function get_instance() {
return new SecurityHelper(
$this->get_alma_logger(),
$this->get_payment_validator()
);
}
}
20 changes: 20 additions & 0 deletions src/includes/Exceptions/AlmaInvalidSignatureException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* AlmaInvalidSignatureException.
*
* @since 5.7.0
*
* @package Alma_Gateway_For_Woocommerce
* @subpackage Alma_Gateway_For_Woocommerce/includes/Exceptions
* @namespace Alma\Woocommerce\Exceptions
*/

namespace Alma\Woocommerce\Exceptions;

/**
* Class AlmaInvalidSignatureException.
*/
class AlmaInvalidSignatureException extends AlmaException {


}
38 changes: 38 additions & 0 deletions src/includes/Gateways/Inpage/PayMoreThanFourGateway.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* PayMoreThanFourGateway.
*
* @since 5.0.0
*
* @package Alma_Gateway_For_Woocommerce
* @subpackage Alma_Gateway_For_Woocommerce//includes/Gateways/Standard
* @namespace Alma\Woocommerce\Gateways\StandardGateway
*/

namespace Alma\Woocommerce\Gateways\Inpage;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

use Alma\Woocommerce\Gateways\AlmaPaymentGateway;
use Alma\Woocommerce\Helpers\ConstantsHelper;
use Alma\Woocommerce\Traits\InPageGatewayTrait;

/**
* PayMoreThanFourGateway
*/
class PayMoreThanFourGateway extends AlmaPaymentGateway {

use InPageGatewayTrait;

/**
* Get the gateway id.
*
* @return string
*/
public function get_gateway_id() {
return ConstantsHelper::GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR;
}

}
17 changes: 10 additions & 7 deletions src/includes/Helpers/ConstantsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
*/
class ConstantsHelper {

const GATEWAY_ID = 'alma';
const GATEWAY_ID_PAY_NOW = 'alma_pay_now';
const GATEWAY_ID_PAY_LATER = 'alma_pay_later';
const GATEWAY_ID_MORE_THAN_FOUR = 'alma_pnx_plus_4';
const GATEWAY_ID_IN_PAGE = 'alma_in_page';
const GATEWAY_ID_IN_PAGE_PAY_NOW = 'alma_in_page_pay_now';
const GATEWAY_ID_IN_PAGE_PAY_LATER = 'alma_in_page_pay_later';
const GATEWAY_ID = 'alma';
const GATEWAY_ID_PAY_NOW = 'alma_pay_now';
const GATEWAY_ID_PAY_LATER = 'alma_pay_later';
const GATEWAY_ID_MORE_THAN_FOUR = 'alma_pnx_plus_4';
const GATEWAY_ID_IN_PAGE = 'alma_in_page';
const GATEWAY_ID_IN_PAGE_PAY_NOW = 'alma_in_page_pay_now';
const GATEWAY_ID_IN_PAGE_PAY_LATER = 'alma_in_page_pay_later';
const GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR = 'alma_in_page_pnx_plus_4';

const JQUERY_CART_UPDATE_EVENT = 'updated_cart_totals';

Expand Down Expand Up @@ -97,6 +98,7 @@ class ConstantsHelper {
self::GATEWAY_ID_PAY_LATER,
self::GATEWAY_ID_IN_PAGE_PAY_LATER,
self::GATEWAY_ID_MORE_THAN_FOUR,
self::GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR,
);

/**
Expand All @@ -108,5 +110,6 @@ class ConstantsHelper {
self::GATEWAY_ID_IN_PAGE,
self::GATEWAY_ID_IN_PAGE_PAY_NOW,
self::GATEWAY_ID_IN_PAGE_PAY_LATER,
self::GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR,
);
}
Loading

0 comments on commit bc1ea7a

Please sign in to comment.