* Die Einbindung des Interfaces geschieht folgendermaßen:
* 1. Einbindung der Klasse in Ihr PHP-Auszahlungsskript:
* CODE:
- * require_once( "PFAD/ZU/DER/KLASSE/PrimusInterface.class.php" );
+ * require( "PFAD/ZU/DER/KLASSE/PrimusInterface.class.php" );
* $PPUsername = "username"; // Ihr Username bei Primusportal
* $PPPassword = "passwort"; // Ihr Passwort bei Primusportal
*
*
* Die komplette Rückgabe des Interfaces wird als assoziatives Array in der Klassen-
* variable __data gespeichert:
- * __data => array("status" => Rückgabecode (PI_DONE, PI_SENDER_ERROR, ...),
+ * __data => array('status' => Rückgabecode (PI_DONE, PI_SENDER_ERROR, ...),
* "statustext" => Status in Worten (z.B.: "Transaktion erfolgreich durchgeführt"),
* ")
*
* @copyright (c) 2007 by Primusportal.de
* @copyright (c) 2008 by Roland Haeder
*/
-class PrimeraApi {
+class PrimeraApi extends BaseFrameworkSystem {
/**
* Fehler - Interfacebenutzer
*/
private $path = "/transfer.interface.2.0.php";
private $errno = 0;
- private $err = "";
+ private $err = '';
- private $seperator = ":";
+ private $seperator = ':';
- private $username = "";
- private $password = "";
+ private $username = '';
+ private $password = '';
private $data = array();
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
- $return = "";
+ $return = '';
while (!feof($fp)) {
$return.=fgets($fp,128);
}
$x = explode("\n", $content);
$return = array();
foreach($x as $currentLine) {
- $line_exploded = explode(":", $currentLine,2);
+ $line_exploded = explode($this->seperator, $currentLine,2);
if (count($line_exploded) > 1) {
$return[$line_exploded[0]] = $line_exploded[1];
}
* @param int$Amount Betrag in ganzzahligen Primera
* @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
*/
- public function payPrimera ($Receiver, $Amount, $Description = "") {
+ public function payPrimera ($Receiver, $Amount, $Description = '') {
$valid = false;
- $PostData = array("PrimusInterface_Action" => "Pay",
- "PrimusInterface_Receiver" => base64_encode($Receiver),
- "PrimusInterface_Amount" => base64_encode($Amount),
- "PrimusInterface_Description" => base64_encode($Description) );
+ $PostData = array(
+ 'PrimusInterface_Action' => 'Pay',
+ 'PrimusInterface_Receiver' => base64_encode($Receiver),
+ 'PrimusInterface_Amount' => base64_encode($Amount),
+ 'PrimusInterface_Description' => base64_encode($Description) );
$PostReturn = $this->parseContent( $this->queryApi($PostData) );
$this->data = $PostReturn;
- if ($PostReturn["status"] == "200") {
+ if ($PostReturn['status'] == '200') {
$valid = true;
}
return $valid;
* - ist er aktiv
* @param string/int $User Userid / Username
*/
- function CheckPrimusUser($User) {
+ function CheckPrimusUser ($User) {
$valid = false;
- $PostData = array("PrimusInterface_Action"=> "CheckPrimusUser",
- "PrimusInterface_CheckPrimusUser" => $User);
+ $PostData = array(
+ 'PrimusInterface_Action' => 'CheckPrimusUser',
+ 'PrimusInterface_CheckPrimusUser' => $User);
$PostReturn = $this->parseContent( $this->queryApi($PostData) );
$this->data = $PostReturn;
- if ($PostReturn["status"] == self::PI_USER_CHECK_OK) {
+ if ($PostReturn['status'] == self::PI_USER_CHECK_OK) {
$valid = true;
}
return $valid;
$PostReturn = $this->parseContent( $this->queryApi($PostData) );
$this->data = $PostReturn;
- if ($PostReturn["status"] == self::PI_GET_PRIMERA_DONE) {
+ if ($PostReturn['status'] == self::PI_GET_PRIMERA_DONE) {
$primera = $PostReturn["primera"];
}
return $primera;