kount / kount-ris-php-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Kount version installed: 7.5.0
PHP 8.1
Laravel 9.47.0
I am unable to override the Logger settings from what is default in src/settings.ini
. I have installed Kount via Composer, with Kount living in vendor/kount/kount-ris-php-sdk
. When the Request object is created, it creates the logger using the default settings.ini, then loads the settings provided. At no point does it reload the logger, and there are no functions to do so:
/vendor/kount/kount-ris-php-sdk/src/Kount/Ris/Request.php:
public function __construct($settings = null)
{
// Logger is created from the default settings
$loggerFactory = Kount_Log_Factory_LogFactory::getLoggerFactory();
$this->logger = $loggerFactory->getLogger(__CLASS__);
// Settings are loaded from the settings.ini provided or from the ArraySettings passed in
if ($settings instanceof Kount_Ris_ArraySettings) {
$this->settings = $settings;
Kount_Util_Khash::createKhash($this->settings);
} else {
$configReader = Kount_Util_ConfigFileReader::instance($settings);
$this->settings = new Kount_Ris_ArraySettings($configReader->getSettings());
Kount_Util_Khash::createKhash($this->settings);
}
Kount_Util_Khash::setConfigKey($this->settings->getConfigKey());
$this->setMerchantId($this->settings->getMerchantId());
$this->setVersion($this->settings->getVERS());
$this->setUrl($this->settings->getRisUrl());
if ($this->settings->getApiKey()) {
$this->setApiKey($this->settings->getApiKey());
} else {
$this->setCertificate(
$this->settings->getX509CertPath(),
$this->settings->getX509KeyPath(),
$this->settings->getX509Passphrase()
);
}
$this->setConnectionTimeout($this->settings->getConnectionTimeout());
// KHASH payment encoding is enabled by default.
$this->setKhashPaymentEncoding(true);
}
Since modifying vendor files is not at all recommended, I cannot actually enable logging.
Because of the addition of the SALT_PHRASE parameter, composer installs of the SDK will not work when needing the Kount_Util_Khash class. This is because the Khash class does not allow you to pass in custom settings values in the constructor, while other classes, such as Kount_Ris_Request, do.
Thus, when you use the Kount_Util_Khash::hash function, it always loads the SALT_PHRASE from the settings.ini file. However, the settings.ini file is going to be overwritten any time you update the composer package (nor will it, of course, preserve this setting across different composer installs). This makes using this file to set settings unfeasible.
The Kount_Util_Khash class needs to be able to accept custom settings.
Hi Community, thanks in advance for all the support.
We are updating our servers to PHP 8.1 and we are reviewing all the versions of our projects.
We are using Kount SDK for PHP version 7.2, because we encounter that versions 7.3 and above fails while instantiating the kount Khash. We are using it this way.
$inquiry = new \Kount_Ris_Request_Inquiry(\Kount_Util_Khash::createKhash($myFilePath));
We receive the error:
"Argument #1 ($filename) must be of type string, Kount_Util_Khash given"
Do you have any idea why this happens? Is there a different way to prepare the Inquiry?
Thanks in Advance for all the help!
Warm Regards,
Ignacio.
Adding Code and Error Screenshots:
https://freeimage.host/i/HTPpgrQ
https://freeimage.host/i/HTPp42V
Has this been tested with php8 yet? We're trying to use it but have run into a few errors:
curl_setopt(): Argument #2 ($option) is not a valid cURL option at Kount/Ris/Request.php:318
Also, when trying to upgrade from 7.2 to 7.3 it's complaining that you're using an incompatible version of sebastian/version
Let me know if you need more details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.