3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 require_once 'CiviTest/CiviUnitTestCase.php';
30 class CRM_Core_Payment_BaseIPNTest
extends CiviUnitTestCase
{
32 protected $_contributionTypeId;
33 protected $_contributionParams;
34 protected $_contactId;
35 protected $_contributionId;
36 protected $_participantId;
39 protected $_processorId;
40 protected $_contributionRecurParams;
41 protected $_paymentProcessor;
44 protected $_membershipId;
48 public $DBResetRequired = FALSE;
52 'name' => 'BaseIPN test',
53 'description' => 'Test BaseIPN methods (via subclass A.net).',
54 'group' => 'Payment Processor Tests',
60 $this->input
= $this->ids
= $this->objects
= array();
61 $this->IPN
= new CRM_Core_Payment_AuthorizeNetIPN();
63 $this->_contactId
= $this->individualCreate();
64 $this->ids
['contact'] = $this->_contactId
;
65 $this->paymentProcessor
= new CRM_Financial_BAO_PaymentProcessor();
67 $paymentProcessorParams = array(
68 'user_name' => 'user_name',
69 'password' => 'password',
70 'url_recur' => 'url_recur',
71 //@todo - if we used the api then we could pass in 'AuthNet & the api will resolve
72 // (as least it will once the pseudoconstant s in the schema)
73 'payment_processor_type_id' => $this->callAPISuccess('payment_processor_type', 'getvalue', array(
79 $paymentProcessorParams['domain_id'] = 1;
80 $paymentProcessorParams['is_active'] = 1;
81 $paymentProcessorParams['is_test'] = 1;
82 $paymentProcessorParams['billing_mode'] = 1;
83 $paymentProcessorParams['class_name'] = "Payment_AuthorizeNet";
84 $processorEntity = $this->paymentProcessor
->create($paymentProcessorParams);
86 $this->_processorId
= $processorEntity->id
;
87 $this->_contributionTypeId
= 1;
89 $this->_contributionParams
= array(
90 'contact_id' => $this->_contactId
,
92 'financial_type_id' => $this->_contributionTypeId
,
93 'recieve_date' => date('Ymd'),
94 'total_amount' => 150.00,
95 'invoice_id' => 'c8acb91e080ad7bd8a2adc119c192885',
97 'contribution_recur_id' => $this->_recurId
,
99 'contribution_status_id' => 2,
101 $contribution = civicrm_api('contribution', 'create', $this->_contributionParams
);
102 $this->assertAPISuccess($contribution, 'line ' . __LINE__
. ' set-up of contribution ');
103 $this->_contributionId
= $contribution['id'];
105 $contribution = new CRM_Contribute_BAO_Contribution();
106 $contribution->id
= $this->_contributionId
;
107 $contribution->find(true);
108 $this->objects
['contribution'] = $contribution;
111 function tearDown() {
112 $this->quickCleanUpFinancialEntities();
113 CRM_Member_PseudoConstant
::membershipType(NULL, TRUE);
114 CRM_Member_PseudoConstant
::membershipStatus(NULL, NULL, 'name', TRUE);
118 * Test the LoadObjects function with recurring membership data
121 function testLoadMembershipObjects() {
122 $this->_setUpMembershipObjects();
123 $this->_setUpRecurringContribution();
124 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
125 $this->assertFalse(empty($this->objects
['membership']), 'in line ' . __LINE__
);
126 $this->assertArrayHasKey($this->_membershipTypeID
, $this->objects
['membership'], 'in line ' . __LINE__
);
127 $this->assertTrue(is_a($this->objects
['membership'][$this->_membershipTypeID
], 'CRM_Member_BAO_Membership'));
128 $this->assertTrue(is_a( $this->objects
['contributionType'],'CRM_Financial_BAO_FinancialType'));
129 $this->assertFalse(empty($this->objects
['contributionRecur']), __LINE__
);
130 $this->assertFalse(empty($this->objects
['paymentProcessor']), __LINE__
);
133 * Test the LoadObjects function with recurring membership data
136 function testLoadMembershipObjectsLoadAll() {
137 $this->_setUpMembershipObjects();
138 $this->_setUpRecurringContribution();
139 unset($this->ids
['membership']);
140 $contribution = new CRM_Contribute_BAO_Contribution();
141 $contribution->id
= $this->_contributionId
;
142 $contribution->find(true);
143 $contribution->loadRelatedObjects($this->input
, $this->ids
, FALSE, true);
144 $this->assertFalse(empty($contribution->_relatedObjects
['membership']), 'in line ' . __LINE__
);
145 $this->assertArrayHasKey($this->_membershipTypeID
, $contribution->_relatedObjects
['membership'], 'in line ' . __LINE__
);
146 $this->assertTrue(is_a($contribution->_relatedObjects
['membership'][$this->_membershipTypeID
], 'CRM_Member_BAO_Membership'));
147 $this->assertTrue(is_a($contribution->_relatedObjects
['contributionType'], 'CRM_Financial_BAO_FinancialType'));
148 $this->assertFalse(empty($contribution->_relatedObjects
['contributionRecur']), __LINE__
);
149 $this->assertFalse(empty($contribution->_relatedObjects
['paymentProcessor']), __LINE__
);
152 * Test the LoadObjects function with recurring membership data
155 function testsendMailMembershipObjects() {
156 $this->_setUpMembershipObjects();
158 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
159 $msg = $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, FALSE, TRUE);
160 $this->assertTrue(is_array($msg), "Message returned as an array in line" . __LINE__
);
161 $this->assertEquals('Mr. Anthony Anderson II', $msg['to']);
162 $this->assertContains('<p>Please print this confirmation for your records.</p>', $msg['html']);
163 $this->assertContains('Membership Type: General', $msg['body']);
167 * Test the LoadObjects function with recurring membership data
170 function testsendMailMembershipWithoutLoadObjects() {
171 $this->_setUpMembershipObjects();
173 $msg = $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, FALSE, TRUE);
174 $this->assertTrue(is_array($msg), "Message returned as an array in line" . __LINE__
);
175 $this->assertEquals('Mr. Anthony Anderson II', $msg['to']);
176 $this->assertContains('<p>Please print this confirmation for your records.</p>', $msg['html']);
177 $this->assertContains('Membership Type: General', $msg['body']);
180 * Test that loadObjects works with participant values
182 function testLoadParticipantObjects() {
183 $this->_setUpParticipantObjects();
184 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
185 $this->assertFalse(empty($this->objects
['participant']), 'in line ' . __LINE__
);
186 $this->assertTrue(is_a($this->objects
['participant'], 'CRM_Event_BAO_Participant'));
187 $this->assertTrue(is_a( $this->objects
['contributionType'],'CRM_Financial_BAO_FinancialType'));
188 $this->assertFalse(empty($this->objects
['event']));
189 $this->assertTrue(is_a($this->objects
['event'], 'CRM_Event_BAO_Event'));
190 $this->assertTrue(is_a($this->objects
['contribution'], 'CRM_Contribute_BAO_Contribution'));
191 $this->assertFalse(empty($this->objects
['event']->id
));
195 * Test the LoadObjects function with a participant
198 function testComposeMailParticipant() {
199 $this->_setUpParticipantObjects();
200 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
202 $this->assertFalse(empty($this->objects
['event']));
203 $msg = $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, False,True);
204 $this->assertContains('registration has been received and your status has been updated to Attended.', $msg['body']);
205 $this->assertContains('Annual CiviCRM meet', $msg['html']);
212 function testComposeMailParticipantObjects() {
213 $this->_setUpParticipantObjects();
215 $msg = $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, FALSE, TRUE);
216 $this->assertTrue(is_array($msg), "Message returned as an array in line" . __LINE__
);
217 $this->assertEquals('Mr. Anthony Anderson II', $msg['to']);
218 $this->assertContains('<p>Please print this confirmation for your records.</p>', $msg['html']);
219 $this->assertContains('Thank you for your participation', $msg['body']);
223 * Test the LoadObjects function with recurring membership data
226 function testsendMailParticipantObjectsCheckLog() {
227 $this->_setUpParticipantObjects();
229 require_once 'CiviTest/CiviMailUtils.php';
230 $mut = new CiviMailUtils( $this, true );
231 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
232 $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, FALSE, FALSE);
233 $mut->checkMailLog(array(
234 'Thank you for your participation',
235 'Annual CiviCRM meet',
236 'Mr. Anthony Anderson II')
241 * Test the LoadObjects function with recurring membership data
244 function testsendMailParticipantObjectsNoMail() {
245 $this->_setUpParticipantObjects();
246 $event = new CRM_Event_BAO_Event();
247 $event->id
= $this->_eventId
;
248 $event->is_email_confirm
= FALSE;
251 $tablesToTruncate = array(
252 'civicrm_mailing_spool',
254 $this->quickCleanup($tablesToTruncate, FALSE);
255 require_once 'CiviTest/CiviMailUtils.php';
256 $mut = new CiviMailUtils( $this, true );
257 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
258 $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, FALSE, FALSE);
259 $mut->assertMailLogEmpty('no mail should have been send as event set to no confirm');
264 * Test that loadObjects works with participant values
266 function testLoadPledgeObjects() {
267 $this->_setUpPledgeObjects();
268 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, $this->_processorId
);
269 $this->assertFalse(empty($this->objects
['pledge_payment'][0]), 'in line ' . __LINE__
);
270 $this->assertTrue(is_a( $this->objects
['contributionType'],'CRM_Financial_BAO_FinancialType'));
271 $this->assertTrue(is_a($this->objects
['contribution'], 'CRM_Contribute_BAO_Contribution'));
272 $this->assertTrue(is_a($this->objects
['pledge_payment'][0], 'CRM_Pledge_BAO_PledgePayment'));
273 $this->assertFalse(empty($this->objects
['pledge_payment'][0]->id
));
274 $this->assertEquals($this->_contributionTypeId
, $this->objects
['contributionType']->id
);
275 $this->assertEquals($this->_processorId
, $this->objects
['paymentProcessor']['id']);
276 $this->assertEquals($this->_contributionId
, $this->objects
['contribution']->id
);
277 $this->assertEquals($this->_contactId
, $this->objects
['contact']->id
);
278 $this->assertEquals($this->_pledgeId
, $this->objects
['pledge_payment'][0]->pledge_id
);
282 * Test that loadObjects works with participant values
284 function testLoadPledgeObjectsInvalidPledgeID() {
285 $this->_setUpPledgeObjects();
286 $this->ids
['pledge_payment'][0] = 0;
287 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('return_error' => 1));
288 $this->assertArrayHasKey('error_message', $result);
289 $this->assertArrayNotHasKey('pledge_payment', $this->objects
);
290 $this->assertEquals('Could not find payment processor for contribution record: 1', $result['error_message']);
291 $this->ids
['pledge_payment'][0] = NULL;
292 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('return_error' => 1));
293 $this->assertArrayHasKey('error_message', $result);
294 $this->assertArrayNotHasKey('pledge_payment', $this->objects
);
295 $this->assertEquals('Could not find payment processor for contribution record: 1', $result['error_message']);
296 $this->ids
['pledge_payment'][0] = '';
297 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('return_error' => 1));
298 $this->assertArrayHasKey('error_message', $result);
299 $this->assertArrayNotHasKey('pledge_payment', $this->objects
);
300 $this->assertEquals('Could not find payment processor for contribution record: 1', $result['error_message']);
303 $this->ids
['pledge_payment'][0] = 999;
304 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, $this->_processorId
, array('return_error' => 1));
305 $this->assertArrayHasKey('error_message', $result);
306 $this->assertEquals('Could not find pledge payment record: 999', $result['error_message']);
310 * Test the LoadObjects function with a pledge
313 function testsendMailPledge() {
314 $this->_setUpPledgeObjects();
316 $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, NULL);
317 $msg = $this->IPN
->sendMail($this->input
, $this->ids
, $this->objects
, $values, FALSE, TRUE);
318 $this->assertContains('Contribution Information', $msg['html']);
322 * Test that an error is returned if required set & no contribution page
325 function testRequiredWithoutProcessorID() {
326 $this->_setUpPledgeObjects();
328 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('return_error' => 1));
329 $this->assertArrayHasKey('error_message', $result);
330 $this->assertEquals('Could not find payment processor for contribution record: 1', $result['error_message']);
331 // error is only returned if $required set to True
332 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, NULL, array('return_error' => 1));
333 $this->assertFalse(is_array($result));
334 //check that error is not returned if error checking not set
335 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('log_error' => 1));
336 $this->assertFalse(is_array($result));
341 * Test that an error is not if required set & no processor ID
343 function testRequiredWithContributionPage() {
344 $this->_setUpContributionObjects(TRUE);
346 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('return_error' => 1));
347 $this->assertFalse(is_array($result), $result['error_message']);
351 * Test that an error is returned if required set & contribution page exists
354 function testRequiredWithContributionPageError() {
355 $this->_setUpContributionObjects();
357 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('return_error' => 1));
358 $this->assertArrayHasKey('error_message', $result);
359 $this->assertEquals('Could not find contribution page for contribution record: 1', $result['error_message']);
360 // error is only returned if $required set to True
361 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, FALSE, NULL, array('return_error' => 1));
362 $this->assertFalse(is_array($result));
363 //check that error is not returned if error checking not set
364 $result = $this->IPN
->loadObjects($this->input
, $this->ids
, $this->objects
, TRUE, NULL, array('log_error' => 1));
365 $this->assertFalse(is_array($result));
369 * Test calls main functions in sequence per 'main' - I had hoped to test the functions more
370 * fully but the calls to the POST happen in more than one function
371 * keeping this as good example of data to bring back to life later
373 function testMainFunctionActions(){
374 $ids = $objects = array( );
375 $input['component'] = 'Contribute';
376 $postedParams = array(
377 'x_response_code' => 1,
378 'x_response_reason_code' => 1,
379 'x_response_reason_text' => 'This transaction has been approved.',
381 'x_auth_code' => 140454,
382 'x_trans_id' => 4353599599,
384 'x_card_type' => 'American Express',
385 'x_account_number' => 'XXXX2701',
386 'x_first_name' => 'Arthur',
387 'x_last_name' => 'Jacobs',
389 'x_address' => '866 2166th St SN',
390 'x_city' => 'Edwardstown',
397 'x_invoice_num' => 'a9fb56c24576lk4c9490f6',
398 'x_description' => 'my desc',
399 'x_type' => 'auth_capture',
401 'x_ship_to_first_name' => null,
402 'x_ship_to_last_name' => null,
403 'x_ship_to_company' => null,
404 'x_ship_to_address' => null,
405 'x_ship_to_city' => null,
406 'x_ship_to_state' => null,
407 'x_ship_to_zip' => null,
408 'x_ship_to_country' => null,
413 'x_tax_exempt' => FALSE,
415 'x_MD5_Hash' => '069ECAD13C8E15AC205CDF92B8B58CC7',
416 'x_cvv2_resp_code' => null,
417 'x_cavv_response' => null,
418 'x_test_request' => false,
419 'description' => 'my description'
421 $this->IPN->getInput( $input, $ids );
422 $this->IPN->getIDs( $ids, $input );
424 CRM_Core_Error::debug_var( '$ids', $ids );
425 CRM_Core_Error::debug_var( '$input', $input );
427 $paymentProcessorID = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_PaymentProcessorType',
428 'AuthNet', 'id', 'name' );
430 if ( ! $this->IPN->validateData( $input, $ids, $objects, true, $paymentProcessorID ) ) {
434 if ( $component == 'contribute' && $ids['contributionRecur'] ) {
435 // check if first contribution is completed, else complete first contribution
437 if ( $objects['contribution']->contribution_status_id == 1 ) {
440 return $this->IPN->recur( $input, $ids, $objects, $first );
445 * Prepare for contribution Test - involving only contribution objects
447 function _setUpContributionObjects($contributionPage = FALSE) {
450 $contribution = new CRM_Contribute_BAO_Contribution();
451 $contribution->id
= $this->_contributionId
;
452 $contribution->find(TRUE);
453 $contributionPageID = NULL;
454 if (!empty($contributionPage)) {
455 $dao = new CRM_Core_DAO();
456 $contribution_page = $dao->createTestObject('CRM_Contribute_DAO_ContributionPage');
457 $contribution->contribution_page_id
= $contributionPageID = $contribution_page->id
;
458 //for unknown reasons trying to do a find & save on a contribution with a receive_date set
459 // doesn't work. This seems of minimal relevance to this test so ignoring
460 // note that in tests it worked sometimes & not others - dependent on which other tests run.
461 // running all CRM_Core tests caused failure as did just the single failing test. But running
462 // just this class succeeds - because it actually doesn't do a mysql update on the following save
464 unset($contribution->receive_date
);
465 $contribution->save();
468 $this->objects
['contribution'] = $contribution;
469 $this->input
= array(
470 'component' => 'contribute',
471 'contribution_page_id' => $contributionPageID,
472 'total_amount' => 110.00,
473 'invoiceID' => "c8acb91e080ad7777a2adc119c192885",
474 'contactID' => $this->_contactId
,
475 'contributionID' => $this->objects
['contribution']->id
,
480 * Prepare for membership test
482 function _setUpMembershipObjects() {
484 $this->_membershipTypeID
= $this->membershipTypeCreate();
485 $this->_membershipStatusID
= $this->membershipStatusCreate('test status');
488 echo $e->getMessage();
490 CRM_Member_PseudoConstant
::membershipType($this->_membershipTypeID
, TRUE);
491 CRM_Member_PseudoConstant
::membershipStatus(NULL, NULL, 'name', TRUE);
492 $this->_membershipParams
= array(
493 'contact_id' => $this->_contactId
,
494 'membership_type_id' => $this->_membershipTypeID
,
495 'join_date' => '2009-01-21',
496 'start_date' => '2009-01-21',
497 'end_date' => '2009-12-21',
498 'source' => 'Payment',
500 'status_id' => $this->_membershipStatusID
,
504 $membership = $this->callAPISuccess('membership', 'create', $this->_membershipParams
);
506 $this->_membershipId
= $membership['id'];
507 //we'll create membership payment here because to make setup more re-usable
508 civicrm_api('membership_payment', 'create', array(
510 'contribution_id' => $this->_contributionId
,
511 'membership_id' => $this->_membershipId
,
514 $contribution = new CRM_Contribute_BAO_Contribution();
515 $contribution->id
= $this->_contributionId
;
516 $contribution->find();
517 $this->objects
['contribution'] = $contribution;
518 $this->input
= array(
519 'component' => 'contribute',
520 'total_amount' => 150.00,
521 'invoiceID' => "c8acb91e080ad7bd8a2adc119c192885",
522 'contactID' => $this->_contactId
,
523 'contributionID' => $this->objects
['contribution']->id
,
524 'membershipID' => $this->_membershipId
,
527 $this->ids
['membership'] = $this->_membershipId
;
530 function _setUpRecurringContribution() {
531 $this->_contributionRecurParams
= array(
532 'contact_id' => $this->_contactId
,
535 'frequency_unit' => 'week',
536 'frequency_interval' => 1,
538 'start_date' => date('Ymd'),
539 'create_date' => date('Ymd'),
540 'invoice_id' => 'c8acb91e080ad7bd8a2adc119c192885',
541 'contribution_status_id' => 2,
543 'financial_type_id' => $this->_contributionTypeId
,
545 'payment_processor_id' => $this->_processorId
,
547 $this->_recurId
= civicrm_api('contribution_recur', 'create', $this->_contributionRecurParams
);
548 $this->assertAPISuccess($this->_recurId
, 'line ' . __LINE__
. ' set-up of recurring contrib');
549 $this->_recurId
= $this->_recurId
['id'];
550 $this->input
['contributionRecurId'] = $this->_recurId
;
551 $this->ids
['contributionRecur'] = $this->_recurId
;
555 * Set up participant requirements for test
557 function _setUpParticipantObjects() {
558 $event = $this->eventCreate(array('is_email_confirm' => 1));
559 $this->assertAPISuccess($event, 'line ' . __LINE__
. ' set-up of event');
560 $this->_eventId
= $event['id'];
561 $this->_participantId
= $this->participantCreate(array(
562 'event_id' => $this->_eventId
,
563 'contact_id' => $this->_contactId
,
565 //we'll create membership payment here because to make setup more re-usable
566 $participantPayment = civicrm_api('participant_payment', 'create', array(
568 'contribution_id' => $this->_contributionId
,
569 'participant_id' => $this->_participantId
,
571 $this->assertAPISuccess($participantPayment, 'line ' . __LINE__
. ' set-up of event');
572 $contribution = new CRM_Contribute_BAO_Contribution();
573 $contribution->id
= $this->_contributionId
;
574 $contribution->find();
575 $this->objects
['contribution'] = $contribution;
576 $this->input
= array(
577 'component' => 'event',
578 'total_amount' => 150.00,
579 'invoiceID' => "c8acb91e080ad7bd8a2adc119c192885",
580 'contactID' => $this->_contactId
,
581 'contributionID' => $contribution->id
,
582 'participantID' => $this->_participantId
,
585 $this->ids
['participant'] = $this->_participantId
;
586 $this->ids
['event'] = $this->_eventId
;
590 * Set up participant requirements for test
592 function _setUpPledgeObjects() {
593 $this->_pledgeId
= $this->pledgeCreate($this->_contactId
);
594 //we'll create membership payment here because to make setup more re-usable
595 $pledgePayment = civicrm_api('pledge_payment', 'create', array(
597 'pledge_id' => $this->_pledgeId
,
598 'contribution_id' => $this->_contributionId
,
600 'actual_amount' => 50,
602 $this->assertAPISuccess($pledgePayment, 'line ' . __LINE__
. ' set-up of pledge payment');
603 $this->input
= array(
604 'component' => 'contribute',
605 'total_amount' => 150.00,
606 'invoiceID' => "c8acb91e080ad7bd8a2adc119c192885",
607 'contactID' => $this->_contactId
,
608 'contributionID' => $this->_contributionId
,
609 'pledgeID' => $this->_pledgeId
,
612 $this->ids
['pledge_payment'][] = $pledgePayment['id'];