Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dyd committed Aug 3, 2023
1 parent 4bc5058 commit ff2fd1c
Show file tree
Hide file tree
Showing 37 changed files with 1,441 additions and 151 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Requirements
------------

* OpenCart 4.0.2.X (due to architectural changes, this module is __incompatible__ with older OpenCart versions)
* [GenesisPHP v1.21.7](https://github.com/GenesisGateway/genesis_php/tree/1.21.7) - (Integrated in Module)
* [GenesisPHP v1.21.11](https://github.com/GenesisGateway/genesis_php/tree/1.21.11) - (Integrated in Module)
* PCI-certified server in order to use ```emerchantpay Direct```

GenesisPHP Requirements
Expand Down
2 changes: 1 addition & 1 deletion admin/model/payment/emerchantpay_checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EmerchantpayCheckout extends Model
*
* @var string
*/
protected $module_version = '1.1.0';
protected $module_version = '1.1.1';

/**
* Perform installation logic
Expand Down
2 changes: 1 addition & 1 deletion admin/model/payment/emerchantpay_direct.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EmerchantpayDirect extends Model
*
* @var string
*/
protected $module_version = '1.1.0';
protected $module_version = '1.1.1';

/**
* Perform installation logic
Expand Down
2 changes: 1 addition & 1 deletion catalog/view/javascript/emerchantpay/card.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "emerchantpay Gateway Module for OpenCart",
"type": "opencart-module",
"license": "GPL-2.0",
"version": "1.1.0",
"version": "1.1.1",
"authors": [
{
"name": "emerchantpay",
Expand Down
2 changes: 1 addition & 1 deletion install.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emerchantpay Payments",
"version": "1.1.0",
"version": "1.1.1",
"author": "emerchantpay Ltd.",
"link": "https://emerchantpay.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,11 @@ class Banks
*/
const SCB = 'ENETS-D_SCB';

/**
* BL
*/
const BLK = 'BLK';

/**
* Retrieve list of all Bank Codes
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ final class Errors
*/
const IBAN_BLACKLIST_ERROR = 696;

/**
* Terminal card brand limitation!
*/
const CARD_BRAND_VELOCITY_RESTRICTION_ERROR = 697;

/**
* Consumer with this consumer_id, email combination already exists!
*/
Expand Down Expand Up @@ -627,6 +632,8 @@ public static function getErrorDescription($errorCode)
return 'Please contact the risk team!';
case self::IBAN_BLACKLIST_ERROR:
return 'Transaction declined by risk management, iban blacklisted!';
case self::CARD_BRAND_VELOCITY_RESTRICTION_ERROR:
return 'Terminal card brand limitation!';
case self::REMOTE_ERROR:
return 'Some error occurred on the issuer.';
case self::REMOTE_SYSTEM_ERROR:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

namespace Genesis\API\Constants\NonFinancial;

use Genesis\API\Constants\Transaction\Types;

/**
* Class Services
*
Expand Down Expand Up @@ -55,8 +57,9 @@ class Services
public static function getServiceDeprecatedRequests()
{
return [
self::AVS => 'NonFinancial\AVS',
self::ABNI_DEAL_BANKS => 'NonFinancial\Retrieve\AbniDealBanks'
self::AVS => 'NonFinancial\AVS',
self::ABNI_DEAL_BANKS => 'NonFinancial\Retrieve\AbniDealBanks',
Types::ACCOUNT_VERIFICATION => 'NonFinancial\AccountVerification'
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ class BankCodeParameters
Banks::VTCP_SACOMBANK, Banks::VTCP_SAIGON_BANK, Banks::VTCP_SEAABANK, Banks::VTCP_TECHCOMBANK,
Banks::VTCP_TIENPHONGBANK, Banks::VTCP_VIB, Banks::VTCP_VIETABANK, Banks::VTCP_VIETCOMBANK,
Banks::VTCP_VIETINBANK
],
'PLN' => [
Banks::BLK
]
];

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
* @method bool isChargebacked()
* @method bool isChargebackReversed()
* @method bool isPreArbitrated()
* @method bool isActive()
* @method bool isInvalidated()
* @method bool isChargebackReversal()
* @method bool isPendingReview()
* @method bool isCancelled()
* @method bool isAccepted()
* @method bool isChanged()
* @method bool isDeleted()
* @method bool isReceived()
*/
class States
{
Expand Down Expand Up @@ -178,6 +187,66 @@ class States
*/
const REPRESENTED = 'represented';

/**
* Active token status
*
* Used in Tokenization API
*/
const ACTIVE = 'active';

/**
* Invalidated token status
*
* Used in Tokenization API
*/
const INVALIDATED = 'invalidated';

/**
* Once a chargebacked transaction has been charged, the state changes to chargeback_reversal.
* The chargeback has been cancelled.
*/
const CHARGEBACK_REVERSAL = 'chargeback_reversal';

/**
* The transaction is on hold, a manual review needs to be performed.
*/
const PENDING_REVIEW = 'pending_review';

/**
* Cancelled status
*
* Used in KYC services
*/
const CANCELLED = 'cancelled';

/**
* Accepted status
*
* Used in KYC services
*/
const ACCEPTED = 'accepted';

/**
* Changed status
*
* Used in KYC services
*/
const CHANGED = 'changed';

/**
* Deleted status
*
* Used in KYC services
*/
const DELETED = 'deleted';

/**
* Received status
*
* Used in KYC services
*/
const RECEIVED = 'received';

/**
* Store the state of transaction for comparison
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Types
{
/**
* Account Verification
*
* @deprecated Since 1.21.9 Payment method is deprecated and will be removed
*/
const ACCOUNT_VERIFICATION = 'account_verification';

Expand Down Expand Up @@ -918,7 +920,6 @@ public static function isValidTransactionType($type)
public static function getWPFTransactionTypes()
{
return [
self::ACCOUNT_VERIFICATION,
self::ARGENCARD,
self::APPLE_PAY,
self::AURA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ class i18n
*/
public static function isValidLanguageCode($languageCode)
{
if (@constant('self::' . strtoupper($languageCode))) {
$languageConstant = 'self::' . strtoupper($languageCode);

if (defined($languageConstant) && constant($languageConstant)) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public function isAuthentic()
case 40:
$hashType = 'sha1';
break;
case 64:
$hashType = 'sha256';
break;
case 128:
$hashType = 'sha512';
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
/**
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author emerchantpay
* @copyright Copyright (C) 2015-2023 emerchantpay Ltd.
* @license http://opensource.org/licenses/MIT The MIT License
*/

namespace Genesis\API\Request\Base\NonFinancial\TokenizationApi;

use Genesis\API\Request\Base\BaseVersionedRequest;
use Genesis\Builder;
use Genesis\Utils\Common as CommonUtils;

/**
* Class BaseRequest
*
* Tokenization is the process of replacing sensitive cardholder data with a surrogate value ("token").
* The data to be tokenized must include at least the primary account number (PAN).
*
* Tokenization greatly reduces the sensitive data that businesses need to store, thus improving security of
* credit card transactions and minimizing the costs related to PCI DSS compliance.
*
* We issue reversible non-cryptographic tokens to merchants via our Tokenization API and take care to store
* safely the tokenized cardholder data. Merchants are able to use the issued tokens instead of the cardholder
* data when creating credit card transactions via our Processing API. PCI DSS compliant merchants have also the
* possibility to exchange the token for the original cardholder data via our Tokenization API ("detokenization").
*
* @package Genesis\API\Request\Base\NonFinancial\Tokenization
*/
abstract class BaseRequest extends BaseVersionedRequest
{
/**
* Tokenization constructor.
*
* @param string $requestPath
*/
public function __construct($requestPath)
{
parent::__construct($requestPath, Builder::XML, ['v1']);
}

/**
* Create the request's Tree structure
*
* @return void
*/
protected function populateStructure()
{
$treeStructure = [
$this->getRequestPath() . '_request' => $this->getRequestStructure()
];

$this->treeStructure = CommonUtils::createArrayObject($treeStructure);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Genesis\API\Traits\Request\Financial\GamingAttributes;
use Genesis\API\Traits\Request\Financial\PreauthorizationAttributes;
use Genesis\API\Traits\Request\Financial\ScaAttributes;
use Genesis\API\Traits\Request\Financial\ReferenceAttributes;
use Genesis\API\Traits\Request\MotoAttributes;
use Genesis\API\Traits\Request\AddressInfoAttributes;
use Genesis\API\Traits\Request\RiskAttributes;
Expand All @@ -55,7 +56,7 @@ class Authorize extends \Genesis\API\Request\Base\Financial\Cards\CreditCard
use GamingAttributes, MotoAttributes, AddressInfoAttributes, RiskAttributes, DescriptorAttributes,
PreauthorizationAttributes, TravelDataAttributes, FxRateAttributes,
CryptoAttributes, BusinessAttributes, RestrictedSetter, ScaAttributes, UcofAttributes, RecurringTypeAttributes,
ManagedRecurringAttributes, RecurringCategoryAttributes;
ManagedRecurringAttributes, RecurringCategoryAttributes, ReferenceAttributes;

/**
* Returns the Request transaction type
Expand Down Expand Up @@ -91,9 +92,13 @@ protected function setRequiredFields()
{
parent::setRequiredFields();

$requiredFieldsConditional = $this->requiredTokenizationFieldsConditional() +
$this->requiredCCFieldsConditional() + $this->requiredManagedRecurringFieldsConditional() +
$this->requiredRecurringManagedTypeFieldConditional();
$requiredFieldsConditional = array_merge_recursive(
$this->requiredTokenizationFieldsConditional(),
$this->requiredCCFieldsConditional(),
$this->requiredManagedRecurringFieldsConditional(),
$this->requiredRecurringManagedTypeFieldConditional(),
$this->requiredRecurringSubsequentTypeFieldConditional()
);

$this->requiredFieldsConditional = CommonUtils::createArrayObject($requiredFieldsConditional);
}
Expand All @@ -108,7 +113,7 @@ protected function setRequiredFields()
*/
protected function checkRequirements()
{
$requiredFieldValuesConditional = $this->requiredRecurringInitialTypesFieldValuesConditional();
$requiredFieldValuesConditional = $this->requiredRecurringAllTypesFieldValuesConditional();

$this->requiredFieldValuesConditional = CommonUtils::createArrayObject(
$requiredFieldValuesConditional
Expand Down Expand Up @@ -141,7 +146,8 @@ protected function getTransactionAttributes()
'business_attributes' => $this->getBusinessAttributesStructure(),
'recurring_type' => $this->getRecurringType(),
'managed_recurring' => $this->getManagedRecurringAttributesStructure(),
'recurring_category' => $this->recurring_category
'recurring_category' => $this->recurring_category,
'reference_id' => $this->reference_id
],
$this->getScaAttributesStructure(),
$this->getUcofAttributesStructure()
Expand Down
Loading

0 comments on commit ff2fd1c

Please sign in to comment.