コード例 #1
0
 /**
  * test the payment method is adequately logged - we don't expect the processing to succeed
  */
 function testHandlePaymentMethodLogging()
 {
     $params = array('processor_name' => 'Paypal', 'data' => 'blah');
     try {
         CRM_Core_Payment::handlePaymentMethod('method', $params);
     } catch (Exception $e) {
     }
     $log = $this->callAPISuccess('SystemLog', 'get', array());
     $this->assertEquals('payment_notification processor_name=Paypal', $log['values'][$log['id']]['message']);
 }
コード例 #2
0
ファイル: Job.php プロジェクト: hyebahi/civicrm-core
/**
 * Runs handlePaymentCron method in the specified payment processor.
 *
 * @param array $params
 *   Input parameters.
 *
 * Expected @params array keys are: INCORRECTLY DOCUMENTED AND SHOULD BE IN THE _spec function
 * for retrieval via getfields.
 * {string  'processor_name' - the name of the payment processor, eg: Sagepay}
 */
function civicrm_api3_job_run_payment_cron($params)
{
    // live mode
    CRM_Core_Payment::handlePaymentMethod('PaymentCron', array_merge($params, array('caller' => 'api')));
    // test mode
    CRM_Core_Payment::handlePaymentMethod('PaymentCron', array_merge($params, array('mode' => 'test')));
}