/** * Test IPN response mails don't leak. */ public function testIPNPaymentMembershipRecurSuccessNoLeakageOnlineThenOffline() { $mut = new CiviMailUtils($this, TRUE); $this->setupMembershipRecurringPaymentProcessorTransaction(array('is_email_receipt' => TRUE)); $this->addProfile('supporter_profile', $this->_contributionPageID); $IPN = new CRM_Core_Payment_AuthorizeNetIPN($this->getRecurTransaction()); $IPN->main(); $mut->checkAllMailLog(array('Membership Type: General', 'Mr. Anthony Anderson II" <*****@*****.**>', 'Amount: $ 200.00', 'Membership Start Date:', 'Supporter Profile', 'First Name: Anthony', 'Last Name: Anderson', 'Email Address: anthony_anderson@civicrm.org', 'This membership will be automatically renewed every', 'Dear Mr. Anthony Anderson II', 'Thanks for your auto renew membership sign-up')); $this->_contactID = $this->individualCreate(array('first_name' => 'Antonia', 'prefix_id' => 'Mrs.', 'email' => '*****@*****.**')); $this->_invoiceID = uniqid(); $this->_contributionPageID = NULL; $this->setupMembershipRecurringPaymentProcessorTransaction(array('is_email_receipt' => TRUE)); $mut->clearMessages(99999); $IPN = new CRM_Core_Payment_AuthorizeNetIPN($this->getRecurTransaction(array('x_trans_id' => 'hers'))); $IPN->main(); $mut->checkAllMailLog(array('Membership Type: General', 'Mrs. Antonia Anderson II', '*****@*****.**', 'Amount: $ 200.00', 'Membership Start Date:', 'Transaction #: hers', 'This membership will be automatically renewed every', 'Dear Mrs. Antonia Anderson II', 'Thanks for your auto renew membership sign-up'), array('First Name: Anthony', 'First Name: Antonia', 'Last Name: Anderson', 'Supporter Profile', 'Email Address: antonia_anderson@civicrm.org')); $mut->stop(); $mut->clearMessages(); }
/** * Test submit with a membership block in place. */ public function testSubmitMembershipBlockIsSeparatePaymentWithEmail() { $mut = new CiviMailUtils($this, TRUE); $this->setUpMembershipContributionPage(TRUE); $this->addProfile('supporter_profile', $this->_ids['contribution_page']); $submitParams = array('price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']), 'id' => (int) $this->_ids['contribution_page'], 'amount' => 10, 'billing_first_name' => 'Billy', 'billing_middle_name' => 'Goat', 'billing_last_name' => 'Gruff', 'selectMembership' => $this->_ids['membership_type'], 'email-Primary' => '*****@*****.**', 'payment_processor_id' => $this->_paymentProcessor['id'], 'credit_card_number' => '4111111111111111', 'credit_card_type' => 'Visa', 'credit_card_exp_date' => array('M' => 9, 'Y' => 2040), 'cvv2' => 123); $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL); $contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page'])); $this->assertCount(2, $contributions['values']); $membershipPayment = $this->callAPISuccess('membership_payment', 'getsingle', array()); $this->assertTrue(in_array($membershipPayment['contribution_id'], array_keys($contributions['values']))); $membership = $this->callAPISuccessGetSingle('membership', array('id' => $membershipPayment['membership_id'])); $this->assertEquals($membership['contact_id'], $contributions['values'][$membershipPayment['contribution_id']]['contact_id']); $mut->checkAllMailLog(array('$ 2.00', 'Membership Fee')); $mut->stop(); $mut->clearMessages(999); }