Skip to content

Commit

Permalink
1.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dyd committed Aug 13, 2024
1 parent 61bfeb2 commit 7231438
Show file tree
Hide file tree
Showing 421 changed files with 7,662 additions and 7,576 deletions.
2 changes: 2 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<rule ref="OpenCart" />

<exclude-pattern>*/genesis/*</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<exclude-pattern>*.min.css</exclude-pattern>
</ruleset>
6 changes: 6 additions & 0 deletions .phpmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<exclude name="StaticAccess" />
<exclude name="BooleanArgumentFlag" />
<exclude name="ElseExpression" />
<exclude name="MissingImport" />
</rule>
<rule ref="rulesets/cleancode.xml/MissingImport">
<properties>
<property name="ignore-global" value="true"/>
</properties>
</rule>
<!--End of CleanCode RuleSets-->

Expand Down
6 changes: 0 additions & 6 deletions Gemfile

This file was deleted.

53 changes: 0 additions & 53 deletions Gemfile.lock

This file was deleted.

19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Requirements
------------

* OpenCart 3.0.X - 3.0.3.X (due to architectural changes, this module is __incompatible__ with OpenCart 1.X and 2.0.X)
* [GenesisPHP v1.24.0](https://github.com/GenesisGateway/genesis_php/tree/1.24.0) - (Integrated in Module)
* [GenesisPHP v2.0.2](https://github.com/GenesisGateway/genesis_php/tree/2.0.2) - (Integrated in Module)

GenesisPHP Requirements
------------
Expand Down Expand Up @@ -79,12 +79,10 @@ Supported Transactions & Payment Methods
* __eps__
* __eZeeWallet__
* __Fashioncheque__
* __GiroPay__
* __Google Pay__
* __iDeal__
* __iDebit__
* __InstaDebit__
* __InstantTransfer__
* __InitRecurringSale__
* __InitRecurringSale (3D-Secure)__
* __Intersolve__
Expand All @@ -99,7 +97,9 @@ Supported Transactions & Payment Methods
* __Online Banking__
* __Interac Combined Pay-in (CPI)__
* __Bancontact__
* __Blik One Click (BLK)__
* __BLIK__
* __SPEI__
* __LatiPay__
* __OXXO__
* __P24__
* __Pago Facil__
Expand All @@ -109,15 +109,6 @@ Supported Transactions & Payment Methods
* __Pix__
* __POLi__
* __Post Finance__
* __PPRO__
* __eps__
* __GiroPay__
* __Ideal__
* __Przelewy24__
* __SafetyPay__
* __TrustPay__
* __BCMC__
* __MyBank__
* __PSE__
* __RapiPago__
* __Redpagos__
Expand All @@ -140,4 +131,4 @@ _Note_: If you have trouble with your credentials or terminal configuration, get

You're now ready to process payments through our gateway.

[support]: mailto:tech-support@e-comprocessing.com
[support]: mailto:tech-support@e-comprocessing.net
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPL-2.0)
*/

use Genesis\API\Constants\Transaction\Parameters\ScaExemptions;
use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\Control\ChallengeIndicators;
use Genesis\Api\Constants\Transaction\Parameters\ScaExemptions;
use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\Control\ChallengeIndicators;
use Genesis\Api\Constants\Transaction\States;

if (!class_exists('\Genesis\Genesis', false)) {
include DIR_APPLICATION . '/../admin/model/extension/payment/ecomprocessing/genesis/vendor/autoload.php';
Expand All @@ -32,6 +33,13 @@
* Base Abstract Class for Method Admin Controllers
*
* Class ControllerExtensionPaymentEcomprocessingBase
*
* @SuppressWarnings(PHPMD.ExcessiveClassLength)
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.TooManyMethods)
* @SuppressWarnings(PHPMD.LongClassName)
*/
abstract class ControllerExtensionPaymentEcomprocessingBase extends Controller
{
Expand Down Expand Up @@ -294,6 +302,7 @@ protected function processPostIndexAction()
* Processes HTTP GET Index action
*
* @return void
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function processGetIndexAction()
{
Expand Down Expand Up @@ -534,6 +543,7 @@ public function order()
* Get transactions list
*
* @return mixed
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function orderAction()
{
Expand All @@ -559,7 +569,7 @@ public function orderAction()
// Process individual fields
foreach ($transactions as &$transaction) {
/* OpenCart 2.2.x Fix (Cart\Currency does not check if the given currency code exists */
if (($has_currency_method && $this->currency->has($transaction['currency'])) || (!$has_currency_method && !@empty($transaction['currency'])))
if (($has_currency_method && $this->currency->has($transaction['currency'])) || (!$has_currency_method && !empty($transaction['currency'])))
$transaction['amount'] = $this->currency->format($transaction['amount'], $transaction['currency']);
else /* No Currency Code is stored on Void Transaction */
$transaction['amount'] = "";
Expand All @@ -579,10 +589,13 @@ public function orderAction()
// Ascending Date/Timestamp sorting
uasort($transactions, function ($element1, $element2) {
// sort by timestamp (date) first
if (@$element1["timestamp"] == @$element2["timestamp"]) {
return 0;
if (isset($element1['timestamp']) && isset($element2['timestamp'])) {
if ($element1['timestamp'] == $element2['timestamp']) {
return 0;
}
return ($element1["timestamp"] > $element2["timestamp"]) ? 1 : -1;
}
return (@$element1["timestamp"] > @$element2["timestamp"]) ? 1 : -1;
return -1;
});

// Create the parent/child relations from a flat array
Expand Down Expand Up @@ -672,13 +685,13 @@ public function getModalForm()
$order_id,
$transaction['reference_id'],
array(
\Genesis\API\Constants\Transaction\Types::AUTHORIZE,
\Genesis\API\Constants\Transaction\Types::AUTHORIZE_3D,
\Genesis\API\Constants\Transaction\Types::GOOGLE_PAY,
\Genesis\API\Constants\Transaction\Types::PAY_PAL,
\Genesis\API\Constants\Transaction\Types::APPLE_PAY,
\Genesis\Api\Constants\Transaction\Types::AUTHORIZE,
\Genesis\Api\Constants\Transaction\Types::AUTHORIZE_3D,
\Genesis\Api\Constants\Transaction\Types::GOOGLE_PAY,
\Genesis\Api\Constants\Transaction\Types::PAY_PAL,
\Genesis\Api\Constants\Transaction\Types::APPLE_PAY,
),
\Genesis\API\Constants\Transaction\States::APPROVED
\Genesis\Api\Constants\Transaction\States::APPROVED
);
$total_captured_amount = $this->getModelInstance()->getTransactionsSumAmount($order_id, $transaction['unique_id'], 'capture', 'approved');
$transaction['available_amount'] = $total_authorized_amount - $total_captured_amount;
Expand Down Expand Up @@ -829,6 +842,7 @@ public function capture()
* Perform a Refund transaction
*
* @return void
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function refund()
{
Expand Down Expand Up @@ -1107,15 +1121,15 @@ protected function validate()
$this->error['warning'] = $this->language->get('error_permission');
}

if (@empty($this->request->post["{$this->module_name}_username"])) {
if (empty($this->request->post["{$this->module_name}_username"])) {
$this->error['username'] = $this->language->get('error_username');
}

if (@empty($this->request->post["{$this->module_name}_password"])) {
if (empty($this->request->post["{$this->module_name}_password"])) {
$this->error['password'] = $this->language->get('error_password');
}

if (@empty($this->request->post["{$this->module_name}_transaction_type"])) {
if (empty($this->request->post["{$this->module_name}_transaction_type"])) {
$this->error['transaction_type'] = $this->language->get('error_transaction_type');
}

Expand Down Expand Up @@ -1362,8 +1376,8 @@ public function getOrderRecurringId($order_id)
public function isInitialRecurringTransaction($transaction_type)
{
return in_array($transaction_type, array(
\Genesis\API\Constants\Transaction\Types::INIT_RECURRING_SALE,
\Genesis\API\Constants\Transaction\Types::INIT_RECURRING_SALE_3D
\Genesis\Api\Constants\Transaction\Types::INIT_RECURRING_SALE,
\Genesis\Api\Constants\Transaction\Types::INIT_RECURRING_SALE_3D
));
}

Expand Down Expand Up @@ -1424,7 +1438,7 @@ public function canCaptureTransaction($transaction)
);
}

return \Genesis\API\Constants\Transaction\Types::canCapture($transaction['type']);
return \Genesis\Api\Constants\Transaction\Types::canCapture($transaction['type']);
}

/**
Expand All @@ -1446,7 +1460,7 @@ public function canRefundTransaction($transaction)
);
}

return \Genesis\API\Constants\Transaction\Types::canRefund($transaction['type']);
return \Genesis\Api\Constants\Transaction\Types::canRefund($transaction['type']);
}

/**
Expand All @@ -1457,7 +1471,7 @@ public function canRefundTransaction($transaction)
*/
public function canVoidTransaction($transaction)
{
return \Genesis\API\Constants\Transaction\Types::canVoid($transaction['type']) &&
return \Genesis\Api\Constants\Transaction\Types::canVoid($transaction['type']) &&
$this->hasApprovedState($transaction['status']);
}

Expand All @@ -1473,8 +1487,8 @@ public function isVoidTransactionExist($order_id, $transaction)
return $this->getModelInstance()->getTransactionsByTypeAndStatus(
$order_id,
$transaction['unique_id'],
\Genesis\API\Constants\Transaction\Types::VOID,
\Genesis\API\Constants\Transaction\States::APPROVED
\Genesis\Api\Constants\Transaction\Types::VOID,
\Genesis\Api\Constants\Transaction\States::APPROVED
) !== false;
}

Expand Down Expand Up @@ -1798,9 +1812,9 @@ protected function getServerAddress()
protected function isTransactionWithCustomAttribute($transaction_type)
{
$transaction_types = [
\Genesis\API\Constants\Transaction\Types::GOOGLE_PAY,
\Genesis\API\Constants\Transaction\Types::PAY_PAL,
\Genesis\API\Constants\Transaction\Types::APPLE_PAY,
\Genesis\Api\Constants\Transaction\Types::GOOGLE_PAY,
\Genesis\Api\Constants\Transaction\Types::PAY_PAL,
\Genesis\Api\Constants\Transaction\Types::APPLE_PAY,
];

return in_array($transaction_type, $transaction_types);
Expand All @@ -1822,7 +1836,7 @@ protected function checkReferenceActionByCustomAttr($action, $transaction_type)
}

switch ($transaction_type) {
case \Genesis\API\Constants\Transaction\Types::GOOGLE_PAY:
case \Genesis\Api\Constants\Transaction\Types::GOOGLE_PAY:
if (EcomprocessingHelper::REFERENCE_ACTION_CAPTURE === $action) {
return in_array(
EcomprocessingHelper::GOOGLE_PAY_TRANSACTION_PREFIX .
Expand All @@ -1839,7 +1853,7 @@ protected function checkReferenceActionByCustomAttr($action, $transaction_type)
);
}
break;
case \Genesis\API\Constants\Transaction\Types::PAY_PAL:
case \Genesis\Api\Constants\Transaction\Types::PAY_PAL:
if (EcomprocessingHelper::REFERENCE_ACTION_CAPTURE === $action) {
return in_array(
EcomprocessingHelper::PAYPAL_TRANSACTION_PREFIX .
Expand All @@ -1859,7 +1873,7 @@ protected function checkReferenceActionByCustomAttr($action, $transaction_type)
return (count(array_intersect($refundable_types, $selected_types)) > 0);
}
break;
case \Genesis\API\Constants\Transaction\Types::APPLE_PAY:
case \Genesis\Api\Constants\Transaction\Types::APPLE_PAY:
if (EcomprocessingHelper::REFERENCE_ACTION_CAPTURE === $action) {
return in_array(
EcomprocessingHelper::APPLE_PAY_TRANSACTION_PREFIX .
Expand Down Expand Up @@ -1895,7 +1909,7 @@ protected function hasApprovedState($transaction_type)
return false;
}

$state = new \Genesis\API\Constants\Transaction\States($transaction_type);
$state = new States($transaction_type);

return $state->isApproved();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Backend controller for the "ecomprocessing Checkout" module
*
* @package EcomprocessingCheckout
* @SuppressWarnings(PHPMD.LongClassName)
*/
class ControllerExtensionPaymentEcomprocessingCheckout extends ControllerExtensionPaymentEcomprocessingBase
{
Expand Down
Loading

0 comments on commit 7231438

Please sign in to comment.