Example #1
0
 /**  
  * singleton function used to manage this object  
  *  
  * @param string $mode the mode of operation: live or test
  *  
  * @return object  
  * @static  
  */
 static function &singleton($mode, $component, &$paymentProcessor)
 {
     if (self::$_singleton === null) {
         self::$_singleton = new CRM_Core_Payment_PaymentExpressIPN($mode, $paymentProcessor);
     }
     return self::$_singleton;
 }
Example #2
0
 * Grateful acknowledgements go to Donald Lobo for invaluable assistance
 * in creating this payment processor module
 */
session_start();
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
$log = new CRM_Utils_SystemLogger();
$log->alert('payment_notification processor_name=Payment_Express', $_REQUEST);
/*
 * Get the password from the Payment Processor's table based on the DPS user id
 * being passed back from the server
 */
$query = "\nSELECT    url_site, password, user_name, signature\nFROM      civicrm_payment_processor\nLEFT JOIN civicrm_payment_processor_type ON civicrm_payment_processor_type.id = civicrm_payment_processor.payment_processor_type_id\nWHERE     civicrm_payment_processor_type.name = 'Payment_Express'\nAND       user_name = %1\n";
$params = array(1 => array($_GET['userid'], 'String'));
$dpsSettings = CRM_Core_DAO::executeQuery($query, $params);
while ($dpsSettings->fetch()) {
    $dpsUrl = $dpsSettings->url_site;
    $dpsUser = $dpsSettings->user_name;
    $dpsKey = $dpsSettings->password;
    $dpsMacKey = $dpsSettings->signature;
}
if ($dpsMacKey) {
    $method = "pxaccess";
} else {
    $method = "pxpay";
}
require_once 'CRM/Core/Payment/PaymentExpressIPN.php';
$rawPostData = $_GET['result'];
CRM_Core_Payment_PaymentExpressIPN::main($method, $rawPostData, $dpsUrl, $dpsUser, $dpsKey, $dpsMacKey);
 /**
  * singleton function used to manage this object
  *
  * @param string $mode the mode of operation: live or test
  *
  * @param $paymentProcessor
  * @param null $paymentForm
  * @param bool $force
  *
  * @return object
  * @static
  */
 static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE)
 {
     if (self::$_singleton === NULL) {
         self::$_singleton = new CRM_Core_Payment_PaymentExpressIPN($mode, $paymentProcessor);
     }
     return self::$_singleton;
 }