}
/**
+ * Assign message variables to template but try to break the habit.
+ *
+ * In order to get away from leaky variables it is better to ensure variables are set in values and assign them
+ * from the send function. Otherwise smarty variables can leak if this is called more than once - e.g. processing
+ * multiple recurring payments for processors like IATS that use tokens.
+ *
* Apply variables for message to smarty template - this function is part of analysing what is in the huge
* function & breaking it down into manageable chunks. Eventually it will be refactored into something else
- * Note we send directly from this function in some cases because it is only partly refactored
- * Don't call this function directly as the signature will change
+ * Note we send directly from this function in some cases because it is only partly refactored.
+ *
+ * Don't call this function directly as the signature will change.
*
* @param $values
* @param $input
'billing_last_name' => 'Gruff',
'selectMembership' => $this->_ids['membership_type'],
'email-Primary' => 'billy-goat@the-bridge.net',
+ '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);
)
);
$mut->stop();
- $mut->clearMessages();
+ $mut->clearMessages(999);
}
/**
*/
public function testSubmitMembershipBlockIsSeparatePayment() {
$this->setUpMembershipContributionPage(TRUE);
+ $this->_ids['membership_type'] = array($this->membershipTypeCreate(array('minimum_fee' => 2)));
$submitParams = array(
'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']),
'id' => (int) $this->_ids['contribution_page'],
'billing_last_name' => 'Gruff',
'selectMembership' => $this->_ids['membership_type'],
'email-Primary' => 'billy-goat@the-bridge.net',
+ '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);
$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->checkMailLog(array(
- 'General Membership: $ 2.00',
+ $mut->checkAllMailLog(array(
+ '$ 2.00',
'Membership Fee',
));
$mut->stop();
- $mut->clearMessages();
+ $mut->clearMessages(999);
}
/**