Merge pull request #8119 from eileenmcnaughton/CRM-18303
[civicrm-core.git] / tests / phpunit / CRM / Member / Form / MembershipTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27
28 /**
29 * File for the MembershipTest class
30 *
31 * (PHP 5)
32 *
33 * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
34 */
35
36 /**
37 * Test CRM_Member_Form_Membership functions.
38 *
39 * @package CiviCRM
40 * @group headless
41 */
42 class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
43
44 /**
45 * Assume empty database with just civicrm_data.
46 */
47 protected $_individualId;
48 protected $_contribution;
49 protected $_financialTypeId = 1;
50 protected $_apiversion;
51 protected $_entity = 'Membership';
52 protected $_params;
53 protected $_ids = array();
54 protected $_paymentProcessorID;
55
56 /**
57 * Membership type ID for annual fixed membership.
58 *
59 * @var int
60 */
61 protected $membershipTypeAnnualFixedID;
62
63 /**
64 * Parameters to create payment processor.
65 *
66 * @var array
67 */
68 protected $_processorParams = array();
69
70 /**
71 * ID of created membership.
72 *
73 * @var int
74 */
75 protected $_membershipID;
76
77 /**
78 * Payment instrument mapping.
79 *
80 * @var array
81 */
82 protected $paymentInstruments = array();
83
84 /**
85 * @var CiviMailUtils
86 */
87 protected $mut;
88
89 /**
90 * Test setup for every test.
91 *
92 * Connect to the database, truncate the tables that will be used
93 * and redirect stdin to a temporary file.
94 */
95 public function setUp() {
96 $this->_apiversion = 3;
97 parent::setUp();
98
99 $this->_individualId = $this->individualCreate();
100 $this->_paymentProcessorID = $this->processorCreate();
101 // Insert test data.
102 $op = new PHPUnit_Extensions_Database_Operation_Insert();
103 $op->execute($this->_dbconn,
104 $this->createFlatXMLDataSet(
105 dirname(__FILE__) . '/dataset/data.xml'
106 )
107 );
108 $membershipTypeAnnualFixed = $this->callAPISuccess('membership_type', 'create', array(
109 'domain_id' => 1,
110 'name' => "AnnualFixed",
111 'member_of_contact_id' => 23,
112 'duration_unit' => "year",
113 'duration_interval' => 1,
114 'period_type' => "fixed",
115 'fixed_period_start_day' => "101",
116 'fixed_period_rollover_day' => "1231",
117 'relationship_type_id' => 20,
118 'financial_type_id' => 2,
119 ));
120 $this->membershipTypeAnnualFixedID = $membershipTypeAnnualFixed['id'];
121
122 $instruments = $this->callAPISuccess('contribution', 'getoptions', array('field' => 'payment_instrument_id'));
123 $this->paymentInstruments = $instruments['values'];
124 }
125
126 /**
127 * Clean up after each test.
128 */
129 public function tearDown() {
130 $this->quickCleanUpFinancialEntities();
131 $this->quickCleanup(
132 array(
133 'civicrm_relationship',
134 'civicrm_membership_type',
135 'civicrm_membership',
136 'civicrm_uf_match',
137 )
138 );
139 $this->callAPISuccess('contact', 'delete', array('id' => 17, 'skip_undelete' => TRUE));
140 $this->callAPISuccess('contact', 'delete', array('id' => 23, 'skip_undelete' => TRUE));
141 $this->callAPISuccess('relationship_type', 'delete', array('id' => 20));
142 }
143
144 /**
145 * Test CRM_Member_Form_Membership::buildQuickForm()
146 */
147 //function testCRMMemberFormMembershipBuildQuickForm()
148 //{
149 // throw new PHPUnit_Framework_IncompleteTestError( "not implemented" );
150 //}
151
152 /**
153 * Test CRM_Member_Form_Membership::formRule() with a parameter
154 * that has an empty contact_select_id value
155 */
156 public function testFormRuleEmptyContact() {
157 $params = array(
158 'contact_select_id' => 0,
159 'membership_type_id' => array(1 => NULL),
160 );
161 $files = array();
162 $obj = new CRM_Member_Form_Membership();
163 $rc = $obj->formRule($params, $files, $obj);
164 $this->assertType('array', $rc);
165 $this->assertTrue(array_key_exists('membership_type_id', $rc));
166
167 $params['membership_type_id'] = array(1 => 3);
168 $rc = $obj->formRule($params, $files, $obj);
169 $this->assertType('array', $rc);
170 $this->assertTrue(array_key_exists('join_date', $rc));
171 }
172
173 /**
174 * Test that form rule fails if start date is before join date.
175 *
176 * Test CRM_Member_Form_Membership::formRule() with a parameter
177 * that has an start date before the join date and a rolling
178 * membership type.
179 */
180 public function testFormRuleRollingEarlyStart() {
181 $unixNow = time();
182 $ymdNow = date('m/d/Y', $unixNow);
183 $unixYesterday = $unixNow - (24 * 60 * 60);
184 $ymdYesterday = date('m/d/Y', $unixYesterday);
185 $params = array(
186 'join_date' => $ymdNow,
187 'start_date' => $ymdYesterday,
188 'end_date' => '',
189 'membership_type_id' => array('23', '15'),
190 );
191 $files = array();
192 $obj = new CRM_Member_Form_Membership();
193 $rc = call_user_func(array('CRM_Member_Form_Membership', 'formRule'),
194 $params, $files, $obj
195 );
196 $this->assertType('array', $rc);
197 $this->assertTrue(array_key_exists('start_date', $rc));
198 }
199
200 /**
201 * Test CRM_Member_Form_Membership::formRule() with a parameter
202 * that has an end date before the start date and a rolling
203 * membership type
204 */
205 public function testFormRuleRollingEarlyEnd() {
206 $unixNow = time();
207 $ymdNow = date('m/d/Y', $unixNow);
208 $unixYesterday = $unixNow - (24 * 60 * 60);
209 $ymdYesterday = date('m/d/Y', $unixYesterday);
210 $params = array(
211 'join_date' => $ymdNow,
212 'start_date' => $ymdNow,
213 'end_date' => $ymdYesterday,
214 'membership_type_id' => array('23', '15'),
215 );
216 $files = array();
217 $obj = new CRM_Member_Form_Membership();
218 $rc = $obj->formRule($params, $files, $obj);
219 $this->assertType('array', $rc);
220 $this->assertTrue(array_key_exists('end_date', $rc));
221 }
222
223 /**
224 * Test CRM_Member_Form_Membership::formRule() with end date but no start date and a rolling membership type.
225 */
226 public function testFormRuleRollingEndNoStart() {
227 $unixNow = time();
228 $ymdNow = date('m/d/Y', $unixNow);
229 $unixYearFromNow = $unixNow + (365 * 24 * 60 * 60);
230 $ymdYearFromNow = date('m/d/Y', $unixYearFromNow);
231 $params = array(
232 'join_date' => $ymdNow,
233 'start_date' => '',
234 'end_date' => $ymdYearFromNow,
235 'membership_type_id' => array('23', '15'),
236 );
237 $files = array();
238 $obj = new CRM_Member_Form_Membership();
239 $rc = $obj->formRule($params, $files, $obj);
240 $this->assertType('array', $rc);
241 $this->assertTrue(array_key_exists('start_date', $rc));
242 }
243
244 /**
245 * Test CRM_Member_Form_Membership::formRule() with a parameter
246 * that has an end date and a lifetime membership type
247 */
248 public function testFormRuleRollingLifetimeEnd() {
249 $unixNow = time();
250 $unixYearFromNow = $unixNow + (365 * 24 * 60 * 60);
251 $params = array(
252 'join_date' => date('m/d/Y', $unixNow),
253 'start_date' => date('m/d/Y', $unixNow),
254 'end_date' => date('m/d/Y',
255 $unixYearFromNow
256 ),
257 'membership_type_id' => array('23', '25'),
258 );
259 $files = array();
260 $obj = new CRM_Member_Form_Membership();
261 $rc = $obj->formRule($params, $files, $obj);
262 $this->assertType('array', $rc);
263 $this->assertTrue(array_key_exists('status_id', $rc));
264 }
265
266 /**
267 * Test CRM_Member_Form_Membership::formRule() with a parameter
268 * that has an override and no status
269 */
270 public function testFormRuleOverrideNoStatus() {
271 $unixNow = time();
272 $params = array(
273 'join_date' => date('m/d/Y', $unixNow),
274 'membership_type_id' => array('23', '25'),
275 'is_override' => TRUE,
276 );
277 $files = array();
278 $obj = new CRM_Member_Form_Membership();
279 $rc = $obj->formRule($params, $files, $obj);
280 $this->assertType('array', $rc);
281 $this->assertTrue(array_key_exists('status_id', $rc));
282 }
283
284 /**
285 * Test CRM_Member_Form_Membership::formRule() with a join date
286 * of one month from now and a rolling membership type
287 */
288 public function testFormRuleRollingJoin1MonthFromNow() {
289 $unixNow = time();
290 $unix1MFmNow = $unixNow + (31 * 24 * 60 * 60);
291 $params = array(
292 'join_date' => date('m/d/Y', $unix1MFmNow),
293 'start_date' => '',
294 'end_date' => '',
295 'membership_type_id' => array('23', '15'),
296 );
297 $files = array();
298 $obj = new CRM_Member_Form_Membership();
299 $rc = $obj->formRule($params, $files, $obj);
300
301 // Should have found no valid membership status.
302 $this->assertType('array', $rc);
303 $this->assertTrue(array_key_exists('_qf_default', $rc));
304 }
305
306 /**
307 * Test CRM_Member_Form_Membership::formRule() with a join date of today and a rolling membership type.
308 */
309 public function testFormRuleRollingJoinToday() {
310 $unixNow = time();
311 $params = array(
312 'join_date' => date('m/d/Y', $unixNow),
313 'start_date' => '',
314 'end_date' => '',
315 'membership_type_id' => array('23', '15'),
316 );
317 $files = array();
318 $obj = new CRM_Member_Form_Membership();
319 $rc = $obj->formRule($params, $files, $obj);
320
321 // Should have found New membership status
322 $this->assertTrue($rc);
323 }
324
325 /**
326 * Test CRM_Member_Form_Membership::formRule() with a join date
327 * of one month ago and a rolling membership type
328 */
329 public function testFormRuleRollingJoin1MonthAgo() {
330 $unixNow = time();
331 $unix1MAgo = $unixNow - (31 * 24 * 60 * 60);
332 $params = array(
333 'join_date' => date('m/d/Y', $unix1MAgo),
334 'start_date' => '',
335 'end_date' => '',
336 'membership_type_id' => array('23', '15'),
337 );
338 $files = array();
339 $obj = new CRM_Member_Form_Membership();
340 $rc = $obj->formRule($params, $files, $obj);
341
342 // Should have found New membership status.
343 $this->assertTrue($rc);
344 }
345
346 /**
347 * Test CRM_Member_Form_Membership::formRule() with a join date of six months ago and a rolling membership type.
348 */
349 public function testFormRuleRollingJoin6MonthsAgo() {
350 $unixNow = time();
351 $unix6MAgo = $unixNow - (180 * 24 * 60 * 60);
352 $params = array(
353 'join_date' => date('m/d/Y', $unix6MAgo),
354 'start_date' => '',
355 'end_date' => '',
356 'membership_type_id' => array('23', '15'),
357 );
358 $files = array();
359 $obj = new CRM_Member_Form_Membership();
360 $rc = $obj->formRule($params, $files, $obj);
361
362 // Should have found Current membership status.
363 $this->assertTrue($rc);
364 }
365
366 /**
367 * Test CRM_Member_Form_Membership::formRule() with a join date
368 * of one year+ ago and a rolling membership type
369 */
370 public function testFormRuleRollingJoin1YearAgo() {
371 $unixNow = time();
372 $unix1YAgo = $unixNow - (370 * 24 * 60 * 60);
373 $params = array(
374 'join_date' => date('m/d/Y', $unix1YAgo),
375 'start_date' => '',
376 'end_date' => '',
377 'membership_type_id' => array('23', '15'),
378 );
379 $files = array();
380 $obj = new CRM_Member_Form_Membership();
381 $rc = $obj->formRule($params, $files, $obj);
382
383 // Should have found Grace membership status
384 $this->assertTrue($rc);
385 }
386
387 /**
388 * Test CRM_Member_Form_Membership::formRule() with a join date
389 * of two years ago and a rolling membership type
390 */
391 public function testFormRuleRollingJoin2YearsAgo() {
392 $unixNow = time();
393 $unix2YAgo = $unixNow - (2 * 365 * 24 * 60 * 60);
394 $params = array(
395 'join_date' => date('m/d/Y', $unix2YAgo),
396 'start_date' => '',
397 'end_date' => '',
398 'membership_type_id' => array('23', '15'),
399 );
400 $files = array();
401 $obj = new CRM_Member_Form_Membership();
402 $rc = $obj->formRule($params, $files, $obj);
403
404 // Should have found Expired membership status
405 $this->assertTrue($rc);
406 }
407
408 /**
409 * Test CRM_Member_Form_Membership::formRule() with a join date
410 * of six months ago and a fixed membership type
411 */
412 public function testFormRuleFixedJoin6MonthsAgo() {
413 $unixNow = time();
414 $unix6MAgo = $unixNow - (180 * 24 * 60 * 60);
415 $params = array(
416 'join_date' => date('m/d/Y', $unix6MAgo),
417 'start_date' => '',
418 'end_date' => '',
419 'membership_type_id' => array('23', '7'),
420 );
421 $files = array();
422 $obj = new CRM_Member_Form_Membership();
423 $rc = $obj->formRule($params, $files, $obj);
424
425 // Should have found Current membership status
426 $this->assertTrue($rc);
427 }
428
429 /**
430 * Test the submit function of the membership form.
431 */
432 public function testSubmit() {
433 $form = $this->getForm();
434 $this->mut = new CiviMailUtils($this, TRUE);
435 $form->_mode = 'test';
436 $this->createLoggedInUser();
437 $params = array(
438 'cid' => $this->_individualId,
439 'join_date' => date('m/d/Y', time()),
440 'start_date' => '',
441 'end_date' => '',
442 // This format reflects the 23 being the organisation & the 25 being the type.
443 'membership_type_id' => array(23, $this->membershipTypeAnnualFixedID),
444 'auto_renew' => '0',
445 'max_related' => '',
446 'num_terms' => '1',
447 'source' => '',
448 'total_amount' => '50.00',
449 'financial_type_id' => '2', //Member dues, see data.xml
450 'soft_credit_type_id' => '',
451 'soft_credit_contact_id' => '',
452 'from_email_address' => '"Demonstrators Anonymous" <info@example.org>',
453 'payment_processor_id' => $this->_paymentProcessorID,
454 'credit_card_number' => '4111111111111111',
455 'cvv2' => '123',
456 'credit_card_exp_date' => array(
457 'M' => '9',
458 'Y' => '2024', // TODO: Future proof
459 ),
460 'credit_card_type' => 'Visa',
461 'billing_first_name' => 'Test',
462 'billing_middlename' => 'Last',
463 'billing_street_address-5' => '10 Test St',
464 'billing_city-5' => 'Test',
465 'billing_state_province_id-5' => '1003',
466 'billing_postal_code-5' => '90210',
467 'billing_country_id-5' => '1228',
468 'send_receipt' => TRUE,
469 'receipt_text' => 'Receipt text',
470 );
471 $form->_contactID = $this->_individualId;
472 $form->testSubmit($params);
473 $membership = $this->callAPISuccessGetSingle('Membership', array('contact_id' => $this->_individualId));
474 $this->callAPISuccessGetCount('ContributionRecur', array('contact_id' => $this->_individualId), 0);
475 $contribution = $this->callAPISuccess('Contribution', 'get', array(
476 'contact_id' => $this->_individualId,
477 'is_test' => TRUE,
478 ));
479
480 $this->callAPISuccessGetCount('LineItem', array(
481 'entity_id' => $membership['id'],
482 'entity_table' => 'civicrm_membership',
483 'contribution_id' => $contribution['id'],
484 ), 1);
485 $this->mut->checkMailLog(array(
486 '50',
487 'Receipt text',
488 ));
489 $this->mut->stop();
490 }
491
492 /**
493 * Test the submit function of the membership form.
494 */
495 public function testSubmitRecur() {
496 $form = $this->getForm();
497
498 $this->callAPISuccess('MembershipType', 'create', array(
499 'id' => $this->membershipTypeAnnualFixedID,
500 'duration_unit' => 'month',
501 'duration_interval' => 1,
502 'auto_renew' => TRUE,
503 ));
504 $form->preProcess();
505 $this->createLoggedInUser();
506 $params = $this->getBaseSubmitParams();
507 $form->_mode = 'test';
508 $form->_contactID = $this->_individualId;
509 $form->testSubmit($params);
510 $membership = $this->callAPISuccessGetSingle('Membership', array('contact_id' => $this->_individualId));
511 $this->callAPISuccessGetCount('ContributionRecur', array('contact_id' => $this->_individualId), 1);
512
513 $contribution = $this->callAPISuccess('Contribution', 'get', array(
514 'contact_id' => $this->_individualId,
515 'is_test' => TRUE,
516 ));
517
518 // CRM-16992.
519 $this->callAPISuccessGetCount('LineItem', array(
520 'entity_id' => $membership['id'],
521 'entity_table' => 'civicrm_membership',
522 'contribution_id' => $contribution['id'],
523 ), 1);
524 }
525
526 /**
527 * Test the submit function of the membership form.
528 */
529 public function testSubmitPayLaterWithBilling() {
530 $form = $this->getForm(NULL);
531 $this->createLoggedInUser();
532 $params = array(
533 'cid' => $this->_individualId,
534 'join_date' => date('m/d/Y', time()),
535 'start_date' => '',
536 'end_date' => '',
537 // This format reflects the 23 being the organisation & the 25 being the type.
538 'membership_type_id' => array(23, $this->membershipTypeAnnualFixedID),
539 'auto_renew' => '0',
540 'max_related' => '',
541 'num_terms' => '2',
542 'source' => '',
543 'total_amount' => '50.00',
544 //Member dues, see data.xml
545 'financial_type_id' => '2',
546 'soft_credit_type_id' => '',
547 'soft_credit_contact_id' => '',
548 'payment_instrument_id' => 4,
549 'from_email_address' => '"Demonstrators Anonymous" <info@example.org>',
550 'receipt_text_signup' => 'Thank you text',
551 'payment_processor_id' => $this->_paymentProcessorID,
552 'record_contribution' => TRUE,
553 'trxn_id' => 777,
554 'contribution_status_id' => 2,
555 'billing_first_name' => 'Test',
556 'billing_middlename' => 'Last',
557 'billing_street_address-5' => '10 Test St',
558 'billing_city-5' => 'Test',
559 'billing_state_province_id-5' => '1003',
560 'billing_postal_code-5' => '90210',
561 'billing_country_id-5' => '1228',
562 );
563 $form->_contactID = $this->_individualId;
564
565 $form->testSubmit($params);
566 $membership = $this->callAPISuccessGetSingle('Membership', array('contact_id' => $this->_individualId));
567 $contribution = $this->callAPISuccessGetSingle('Contribution', array(
568 'contact_id' => $this->_individualId,
569 'contribution_status_id' => 2,
570 ));
571 $this->assertEquals($contribution['trxn_id'], 777);
572
573 $this->callAPISuccessGetCount('LineItem', array(
574 'entity_id' => $membership['id'],
575 'entity_table' => 'civicrm_membership',
576 'contribution_id' => $contribution['id'],
577 ), 1);
578 $this->callAPISuccessGetSingle('address', array(
579 'contact_id' => $this->_individualId,
580 'street_address' => '10 Test St',
581 'postal_code' => 90210,
582 ));
583 }
584
585 /**
586 * Test the submit function of the membership form.
587 */
588 public function testSubmitRecurCompleteInstant() {
589 $form = $this->getForm();
590 $mut = new CiviMailUtils($this, TRUE);
591 $processor = Civi\Payment\System::singleton()->getById($this->_paymentProcessorID);
592 $processor->setDoDirectPaymentResult(array(
593 'payment_status_id' => 1,
594 'trxn_id' => 'kettles boil water',
595 'fee_amount' => .14,
596 ));
597 $this->callAPISuccess('MembershipType', 'create', array(
598 'id' => $this->membershipTypeAnnualFixedID,
599 'duration_unit' => 'month',
600 'duration_interval' => 1,
601 'auto_renew' => TRUE,
602 ));
603 $form->preProcess();
604 $this->createLoggedInUser();
605 $params = $this->getBaseSubmitParams();
606 $form->_mode = 'test';
607 $form->_contactID = $this->_individualId;
608 $form->testSubmit($params);
609 $membership = $this->callAPISuccessGetSingle('Membership', array('contact_id' => $this->_individualId));
610 $this->callAPISuccessGetCount('ContributionRecur', array('contact_id' => $this->_individualId), 1);
611
612 $contribution = $this->callAPISuccess('Contribution', 'getsingle', array(
613 'contact_id' => $this->_individualId,
614 'is_test' => TRUE,
615 ));
616
617 $this->assertEquals(.14, $contribution['fee_amount']);
618 $this->assertEquals('kettles boil water', $contribution['trxn_id']);
619
620 $this->callAPISuccessGetCount('LineItem', array(
621 'entity_id' => $membership['id'],
622 'entity_table' => 'civicrm_membership',
623 'contribution_id' => $contribution['id'],
624 ), 1);
625 $mut->checkMailLog(array(
626 '===========================================================
627 Billing Name and Address
628 ===========================================================
629 Test
630 10 Test St
631 Test, AR 90210
632 US',
633 '===========================================================
634 Membership Information
635 ===========================================================
636 Membership Type: AnnualFixed
637 Membership Start Date: ',
638 '===========================================================
639 Credit Card Information
640 ===========================================================
641 Visa
642 ************1111
643 Expires: ',
644 )
645 );
646 $mut->stop();
647
648 }
649
650 /**
651 * Get a membership form object.
652 *
653 * We need to instantiate the form to run preprocess, which means we have to trick it about the request method.
654 *
655 * @return \CRM_Member_Form_Membership
656 */
657 protected function getForm() {
658 $form = new CRM_Member_Form_Membership();
659 $_SERVER['REQUEST_METHOD'] = 'GET';
660 $form->controller = new CRM_Core_Controller();
661 $form->_bltID = 5;
662 return $form;
663 }
664
665 /**
666 * @return array
667 */
668 protected function getBaseSubmitParams() {
669 $params = array(
670 'cid' => $this->_individualId,
671 'price_set_id' => 0,
672 'join_date' => date('m/d/Y', time()),
673 'start_date' => '',
674 'end_date' => '',
675 'campaign_id' => '',
676 // This format reflects the 23 being the organisation & the 25 being the type.
677 'membership_type_id' => array(23, $this->membershipTypeAnnualFixedID),
678 'auto_renew' => '1',
679 'is_recur' => 1,
680 'max_related' => 0,
681 'num_terms' => '1',
682 'source' => '',
683 'total_amount' => '77.00',
684 'financial_type_id' => '2', //Member dues, see data.xml
685 'soft_credit_type_id' => 11,
686 'soft_credit_contact_id' => '',
687 'from_email_address' => '"Demonstrators Anonymous" <info@example.org>',
688 'receipt_text' => 'Thank you text',
689 'payment_processor_id' => $this->_paymentProcessorID,
690 'credit_card_number' => '4111111111111111',
691 'cvv2' => '123',
692 'credit_card_exp_date' => array(
693 'M' => '9',
694 'Y' => '2019', // TODO: Future proof
695 ),
696 'credit_card_type' => 'Visa',
697 'billing_first_name' => 'Test',
698 'billing_middlename' => 'Last',
699 'billing_street_address-5' => '10 Test St',
700 'billing_city-5' => 'Test',
701 'billing_state_province_id-5' => '1003',
702 'billing_postal_code-5' => '90210',
703 'billing_country_id-5' => '1228',
704 'send_receipt' => 1,
705 );
706 return $params;
707 }
708
709 }