Skip to content

Commit

Permalink
[Feat] Refactor config form
Browse files Browse the repository at this point in the history
* Unify config var
* Separate form validation
* Add class to create the webhooks
* Remove unnecessary validations
* Remove duplicate code
  • Loading branch information
ElvisHeredia committed May 30, 2023
1 parent 078e1f8 commit ac12853
Show file tree
Hide file tree
Showing 42 changed files with 133 additions and 2,805 deletions.
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@
'single_line' => true,
'space_before_parenthesis' => true,
'inline_constructor_arguments' => true
]
],
'ordered_imports' => ['sort_algorithm' => 'alpha']

//'not_operator_with_successor_space' => false,
//'no_superfluous_elseif' => true,
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
[Full Changelog](https://github.com/conekta/conekta_prestashop/compare/2.3.5...2.3.6)
- Add MSI feature by @ElvisHeredia [#115](https://github.com/conekta/conekta_prestashop/pull/115)
- Fix Coding standards to get approval from Prestashop Validator by @ElvisHeredia [#116](https://github.com/conekta/conekta_prestashop/pull/116)

- Unify config var by @ElvisHeredia [#117](https://github.com/conekta/conekta_prestashop/pull/117)
- Separate form validation by @ElvisHeredia [#117](https://github.com/conekta/conekta_prestashop/pull/117)
- Add class to create the webhooks by @ElvisHeredia [#117](https://github.com/conekta/conekta_prestashop/pull/117)
- Remove unnecessary validations by @ElvisHeredia [#117](https://github.com/conekta/conekta_prestashop/pull/117)
- Remove duplicate code by @ElvisHeredia [#117](https://github.com/conekta/conekta_prestashop/pull/117)

## [v2.3.5] - 2022-11-04
[Full Changelog](https://github.com/conekta/conekta_prestashop/compare/2.3.4...2.3.5)
Expand Down
168 changes: 55 additions & 113 deletions conekta.php

Large diffs are not rendered by default.

28 changes: 25 additions & 3 deletions controllers/front/notifications.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
<?php

/**
* NOTICE OF LICENSE
* Title : Conekta Card Payment Gateway for Prestashop
* Author : Conekta.io
* URL : https://www.conekta.io/es/docs/plugins/prestashop.
* PHP Version 7.0.0
* Conekta File Doc Comment
*
* @author Conekta <[email protected]>
* @copyright 2012-2023 Conekta
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*
* @category Conekta
*
* @version GIT: @2.3.6@
*
* @see https://conekta.com/
*/
require_once dirname(__FILE__) . '/../../model/Database.php';
class ConektaNotificationsModuleFrontController extends ModuleFrontController
{
public const ORDER_CANCELED = 6;

public const ORDER_REFUNDED = 7;

public $auth = false;

public $ajax;
Expand Down Expand Up @@ -99,7 +121,7 @@ private function orderCanceled($orderID)
{
Db::getInstance()->Execute(
'UPDATE ' . _DB_PREFIX_
. 'orders SET current_state = ' . ORDER_CANCELED . ' WHERE id_order = '
. 'orders SET current_state = ' . self::ORDER_CANCELED . ' WHERE id_order = '
. pSQL($orderID)
);
}
Expand All @@ -113,7 +135,7 @@ private function orderRefunded($orderID)
{
Db::getInstance()->Execute(
'UPDATE ' . _DB_PREFIX_
. 'orders SET current_state = ' . ORDER_REFUNDED . ' WHERE id_order = '
. 'orders SET current_state = ' . self::ORDER_REFUNDED . ' WHERE id_order = '
. pSQL($orderID)
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/conekta-php/lib/Conekta/ConektaObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function __toString()
return $this->__toJSON();
}

public function offsetGet($offset)
public function offsetGet(mixed $offset): mixed
{
return isset($this->_values[$offset]) ? $this->_values[$offset] : null;
}
Expand Down
41 changes: 0 additions & 41 deletions lib/conekta-php/test/BaseTest.php

This file was deleted.

153 changes: 0 additions & 153 deletions lib/conekta-php/test/Conekta-1.0/ChargeTest.php

This file was deleted.

27 changes: 0 additions & 27 deletions lib/conekta-php/test/Conekta-1.0/ConektaTest.php

This file was deleted.

Loading

0 comments on commit ac12853

Please sign in to comment.