* die der Empf�nger erhalten soll. $PayDescription ist eine von Ihnen
* festgelegte kurze Beschreibung. Die L�nge dieses Textes darf 100 Zeichen
* nicht �berschreiten. Beispiel:
- * $status = $Interface->payPrimera("garbage", 10000, "Auszahlung IhreSeite.de - ID: 12345");
+ * $status = $Interface->payPrimera("garbage", 10000, "Auszahlung IhreSeite.de - id: 12345");
* 3. �berpr�fung des Status (R�ckgabecode):
* CODE:
* if (!$status) {
* @version 1.0 - beta
* @copyright (c) 2007 by Primusportal.de
* @copyright (c) 2008 by Roland Haeder
+ * @copyright 2009, 2010 by Mailer Developer Team
*/
class PrimeraApi {
/**
var $host = "http://www.primusportal.de";
var $path = "/transfer.interface.2.0.php";
- var $errno = 0;
+ var $errno = '0';
var $err = '';
var $seperator = ':';
function parseContent ( $content ) {
$x = explode("\n", $content);
$return = array();
- foreach($x as $currentLine) {
+ foreach ($x as $currentLine) {
$line_exploded = explode(':', $currentLine,2);
if (count($line_exploded) > 1) {
$return[$line_exploded[0]] = $line_exploded[1];
// is not false the API data is valid, else invalid
function testPrimeraApi () {
// Get new instance
- $api = new PrimeraApi(postRequestElement('primera_api_name'), postRequestElement('primera_api_md5'));
+ $api = new PrimeraApi(postRequestParameter('primera_api_name'), postRequestParameter('primera_api_md5'));
// Was that fine?
return ($api->getPrimera() !== false);
$api = new PrimeraApi($primusNick, $userMd5);
// Prepare purpose
- eval("\$purpose = \"".compileCode(sprintf(getMessage('PRIMERA_API_PURPOSE_WITHDRAW'), getSession('sponsorid')))."\";");
+ eval('$purpose = "' . doFinalCompilation(getMaskedMessage('PRIMERA_API_PURPOSE_WITHDRAW', getSession('sponsorid')), true) . '";');
// Pay the Primera
return $api->payPrimera($primusNick, $amount, $purpose);
$api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5'));
// Prepare purpose
- eval("\$purpose = \"".compileCode(sprintf(getMessage('PRIMERA_API_PURPOSE_PAYOUT'), getUserId()))."\";");
+ eval('$purpose = "' . doFinalCompilation(getMaskedMessage('PRIMERA_API_PURPOSE_PAYOUT', getMemberId()), true) . '";');
// Pay the Primera
return $api->payPrimera($primusNick, $amount, $purpose);