/** * Process incoming payment notification (we have called it 'create' so that it will be forced to be transactional * * @param $params * * @return array */ function civicrm_api3_payment_notification_create($params) { if (!empty($params['system_log_id'])) { // lets replace params with this rather than allow altering $params = json_decode(civicrm_api3('system_log', 'getvalue', array('id' => $params['system_log_id'], 'return' => 'context')), TRUE); } return civicrm_api3_create_success(CRM_Core_Payment_OmnipayMultiProcessor::processPaymentResponse($params)); }
/** * Static wrapper for IPN / Payment response handling - this allows us to re-call from the api. * * @param array $params * * @return bool * @throws CiviCRM_API3_Exception */ public static function processPaymentResponse($params) { $processor = civicrm_api3('payment_processor', 'getsingle', array('id' => $params['processor_id'])); $responder = new CRM_Core_Payment_OmnipayMultiProcessor('live', $processor); $responder->processPaymentNotification($params); return TRUE; }