This type id has been changed in core & the tests are now failing - but since the
affected tests were excluded from CI it wasn't picked up at the time
parent::setUp();
$this->_individualId = $this->individualCreate();
- $processor = $this->processorCreate();
- $this->_paymentProcessorID = $processor->id;
+ $this->_paymentProcessorID = $this->processorCreate();
// Insert test data.
$op = new PHPUnit_Extensions_Database_Operation_Insert();
$op->execute($this->_dbconn,
parent::setUp();
$this->_individualId = $this->individualCreate();
- $processor = $this->processorCreate();
- $this->_paymentProcessorID = $processor->id;
+ $this->_paymentProcessorID = $this->processorCreate();
// Insert test data.
$op = new PHPUnit_Extensions_Database_Operation_Insert();
$op->execute($this->_dbconn,
/**
* Create Payment Processor.
*
- * @return CRM_Financial_DAO_PaymentProcessor
- * instance of Payment Processor
+ * @return int
+ * Id Payment Processor
*/
public function processorCreate() {
$processorParams = array(
'domain_id' => 1,
'name' => 'Dummy',
- 'payment_processor_type_id' => 10,
+ 'payment_processor_type_id' => 'Dummy',
'financial_account_id' => 12,
'is_test' => TRUE,
'is_active' => 1,
'url_site' => 'http://dummy.com',
'url_recur' => 'http://dummy.com',
'billing_mode' => 1,
+ 'sequential' => 1,
);
- return CRM_Financial_BAO_PaymentProcessor::create($processorParams);
+ $processor = $this->callAPISuccess('PaymentProcessor', 'create', $processorParams);
+ return $processor['id'];
}
/**
* Instance of Dummy Payment Processor
*/
public function dummyProcessorCreate($processorParams = array()) {
- $paymentProcessor = $this->processorCreate($processorParams);
- return Civi\Payment\System::singleton()->getById($paymentProcessor->id);
+ $paymentProcessorID = $this->processorCreate($processorParams);
+ return Civi\Payment\System::singleton()->getById($paymentProcessorID);
}
/**
public function testCreateContributionRecurWithToken() {
// create token
$this->createLoggedInUser();
- $paymentProcessor = $this->processorCreate();
$token = $this->callAPISuccess('PaymentToken', 'create', array(
- 'payment_processor_id' => $paymentProcessor->id,
+ 'payment_processor_id' => $this->processorCreate(),
'token' => 'hhh',
'contact_id' => $this->individualCreate(),
));
$this->_softIndividual2Id = $this->individualCreate();
$this->_contributionId = $this->contributionCreate(array('contact_id' => $this->_individualId));
- $paymentProcessor = $this->processorCreate();
+ $this->processorCreate();
$this->_params = array(
'contact_id' => $this->_individualId,
'receive_date' => '20120511',
$this->_apiversion = 3;
$this->_individualId = $this->individualCreate();
- $paymentProcessor = $this->processorCreate();
$this->_params = array(
'contact_id' => $this->_individualId,
'receive_date' => '20120511',
'financial_type_id' => 1,
'currency' => 'USD',
'financial_account_id' => 1,
- 'payment_processor' => $paymentProcessor->id,
+ 'payment_processor' => $this->processorCreate(),
'is_active' => 1,
'is_allow_other_amount' => 1,
'min_amount' => 10,
*/
public function testPaymentOnline() {
- $paymentProcessor = $this->processorCreate();
- $pageParams['processor_id'] = $paymentProcessor->id;
+ $pageParams['processor_id'] = $this->processorCreate();
$contributionPage = $this->contributionPageCreate($pageParams);
$contributionParams = array(
'contact_id' => $this->_contactID,
'contribution_page_id' => $contributionPage['id'],
- 'payment_processor' => $paymentProcessor->id,
+ 'payment_processor' => $pageParams['processor_id'],
'financial_type_id' => 1,
);
$contributionID = $this->contributionCreate($contributionParams);
* Check financial records for online Participant pay later scenario.
*/
public function testPaymentPayLaterOnline() {
-
- $paymentProcessor = $this->processorCreate();
- $pageParams['processor_id'] = $paymentProcessor->id;
+ $pageParams['processor_id'] = $this->processorCreate();
$pageParams['is_pay_later'] = 1;
$contributionPage = $this->contributionPageCreate($pageParams);
$contributionParams = array(
$this->useTransaction(TRUE);
parent::setUp();
$contactID = $this->individualCreate();
- $paymentProcessor = $this->processorCreate();
$this->params = array(
'token' => "fancy-token-xxxx",
'contact_id' => $contactID,
'created_id' => $contactID,
- 'payment_processor_id' => $paymentProcessor->id,
+ 'payment_processor_id' => $this->processorCreate(),
);
}