| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/*
- * PxPay Functionality Copyright (C) 2008 Lucas Baker, Logistic Information Systems Limited (Logis)
- * PxAccess Functionality Copyright (C) 2008 Eileen McNaughton
- * Licensed to CiviCRM under the Academic Free License version 3.0.
- *
- * Grateful acknowledgements go to Donald Lobo for invaluable assistance
- * in creating this payment processor module
- */
+ * PxPay Functionality Copyright (C) 2008 Lucas Baker, Logistic Information Systems Limited (Logis)
+ * PxAccess Functionality Copyright (C) 2008 Eileen McNaughton
+ * Licensed to CiviCRM under the Academic Free License version 3.0.
+ *
+ * Grateful acknowledgements go to Donald Lobo for invaluable assistance
+ * in creating this payment processor module
+ */
/**
* Class CRM_Core_Payment_PaymentExpressIPN
* pattern and cache the instance in this variable
*
* @var object
- * @static
*/
static private $_singleton = NULL;
$ids['contribution'] = self::retrieve('contributionID', 'Integer', $privateData, TRUE);
if ($input['component'] == "event") {
- $ids['event'] = self::retrieve('eventID', 'Integer', $privateData, TRUE);
+ $ids['event'] = self::retrieve('eventID', 'Integer', $privateData, TRUE);
$ids['participant'] = self::retrieve('participantID', 'Integer', $privateData, TRUE);
- $ids['membership'] = NULL;
+ $ids['membership'] = NULL;
}
else {
$ids['membership'] = self::retrieve('membershipID', 'Integer', $privateData, FALSE);
}
// make sure the invoice is valid and matches what we have in the contribution record
- $input['invoice'] = $privateData['invoiceID'];
+ $input['invoice'] = $privateData['invoiceID'];
$input['newInvoice'] = $transactionReference;
- $contribution = &$objects['contribution'];
- $input['trxn_id'] = $transactionReference;
+ $contribution = &$objects['contribution'];
+ $input['trxn_id'] = $transactionReference;
if ($contribution->invoice_id != $input['invoice']) {
CRM_Core_Error::debug_log_message("Invoice values dont match between database and IPN request");
}
else {
/* Since trxn_id hasn't got any use here,
- * lets make use of it by passing the eventID/membershipTypeID to next level.
- * And change trxn_id to the payment processor reference before finishing db update */
+ * lets make use of it by passing the eventID/membershipTypeID to next level.
+ * And change trxn_id to the payment processor reference before finishing db update */
if ($ids['event']) {
$contribution->trxn_id = $ids['event'] . CRM_Core_DAO::VALUE_SEPARATOR . $ids['participant'];
}
/**
-
- /**
+ *
+ * /**
* The function returns the component(Event/Contribute..)and whether it is Test or not
*
* @param array $privateData
* @param int $orderNo
* <order-total> send by google.
*
- * @return array context of this call (test, component, payment processor id)
- * @static
+ * @return array
+ * context of this call (test, component, payment processor id)
*/
public static function getContext($privateData, $orderNo) {
$component = NULL;
$isTest = NULL;
- $contributionID = $privateData['contributionID'];
- $contribution = new CRM_Contribute_DAO_Contribution();
+ $contributionID = $privateData['contributionID'];
+ $contribution = new CRM_Contribute_DAO_Contribution();
$contribution->id = $contributionID;
if (!$contribution->find(TRUE)) {
if ($dps_method == "pxpay") {
$processResponse = CRM_Core_Payment_PaymentExpressUtils::_valueXml(array(
- 'PxPayUserId' => $dps_user,
- 'PxPayKey' => $dps_key,
- 'Response' => $_GET['result'],
- ));
+ 'PxPayUserId' => $dps_user,
+ 'PxPayKey' => $dps_key,
+ 'Response' => $_GET['result'],
+ ));
$processResponse = CRM_Core_Payment_PaymentExpressUtils::_valueXml('ProcessResponse', $processResponse);
fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"),
- $processResponse
- ));
+ $processResponse
+ ));
// Send the XML-formatted validation request to DPS so that we can receive a decrypted XML response which contains the transaction results
$curl = CRM_Core_Payment_PaymentExpressUtils::_initCURL($processResponse, $dps_url);
fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"),
- $curl
- ));
+ $curl
+ ));
$success = FALSE;
if ($response = curl_exec($curl)) {
fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"),
- $response
- ));
+ $response
+ ));
curl_close($curl);
// Assign the returned XML values to variables
- $valid = CRM_Core_Payment_PaymentExpressUtils::_xmlAttribute($response, 'valid');
- $success = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'Success');
- $txnId = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'TxnId');
- $responseText = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'ResponseText');
- $authCode = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'AuthCode');
- $DPStxnRef = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'DpsTxnRef');
- $qfKey = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData1");
- $privateData = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData2");
- list($component, $paymentProcessorID,) = explode(',', CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData3"));
- $amount = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "AmountSettlement");
+ $valid = CRM_Core_Payment_PaymentExpressUtils::_xmlAttribute($response, 'valid');
+ $success = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'Success');
+ $txnId = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'TxnId');
+ $responseText = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'ResponseText');
+ $authCode = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'AuthCode');
+ $DPStxnRef = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'DpsTxnRef');
+ $qfKey = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData1");
+ $privateData = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData2");
+ list($component, $paymentProcessorID,) = explode(',', CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData3"));
+ $amount = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "AmountSettlement");
$merchantReference = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "MerchantReference");
}
else {
#which encapsulates all the response data
$rsp = $pxaccess->getResponse($rawPostData);
- $qfKey = $rsp->getTxnData1();
- $privateData = $rsp->getTxnData2();
- list($component, $paymentProcessorID) = explode(',', $rsp->getTxnData3());
- $success = $rsp->getSuccess();
- $authCode = $rsp->getAuthCode();
- $DPStxnRef = $rsp->getDpsTxnRef();
- $amount = $rsp->getAmountSettlement();
+ $qfKey = $rsp->getTxnData1();
+ $privateData = $rsp->getTxnData2();
+ list($component, $paymentProcessorID) = explode(',', $rsp->getTxnData3());
+ $success = $rsp->getSuccess();
+ $authCode = $rsp->getAuthCode();
+ $DPStxnRef = $rsp->getDpsTxnRef();
+ $amount = $rsp->getAmountSettlement();
$MerchantReference = $rsp->getMerchantReference();
}
}
return $vars;
}
+
}