mpay24/mpay24-php

Configuration with a Configuration Object

Closed this issue · 0 comments

I have to use the MPAY24 Class quit a lot, so its very inconvenient to put always up to 10 variables if you want to set $enableCurlLog = true;

$mpay24 = new MAP24($merchantID, $soapPassword, $test , $debug, $proxyHost, $proxyPort, $proxyUser, $proxyPass, $verfiyPeer, $enableCurlLog);

Can you just Create another Class e.g. MPay24Config where we can set only the parameter we need and hand over just this one variable?

Very Important is also that the Log Path can be configured with this Object. At the Moment this is done in the configuration file but if a new version comes out this file will be overwritten!!!

A Configuration Object is reusable and I only have to create it once!!!
Example:

$mpay24config = new MPay24Config();
$mpay24config->setUser(98765);
$mpay24config->setPassword(12345);
$mpay24config->setCurlLog(true);
.
.
.
$mpay24 = new MAP24($mpay24config);

If no Object is given the default config.php file could be used es well,
and if you want to have backward compatibility support than,
just make a check if $merchantID is a instance of MPay24Config.