Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20264: handle submission of CC type and number during 'record payment' #10228

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions CRM/Contribute/Form/AdditionalPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ public function submit($submittedValues) {
if ($this->_mode) {
// process credit card
$this->assign('contributeMode', 'direct');
$this->processCreditCard($submittedValues);
$submittedValues = $this->_params;
$this->processCreditCard($this->_params);
}

$defaults = array();
Expand All @@ -366,20 +365,20 @@ public function submit($submittedValues) {
'id' => $this->_contributionId,
));
$contributionStatusId = CRM_Utils_Array::value('contribution_status_id', $contribution);
$result = CRM_Contribute_BAO_Contribution::recordAdditionalPayment($this->_contributionId, $submittedValues, $this->_paymentType, $participantId);
$result = CRM_Contribute_BAO_Contribution::recordAdditionalPayment($this->_contributionId, $this->_params, $this->_paymentType, $participantId);
// Fetch the contribution & do proportional line item assignment
$params = array('id' => $this->_contributionId);
$contribution = CRM_Contribute_BAO_Contribution::retrieve($params, $defaults, $params);
CRM_Contribute_BAO_Contribution::addPayments(array($contribution), $contributionStatusId);

$statusMsg = ts('The payment record has been processed.');
// send email
if (!empty($result) && !empty($submittedValues['is_email_receipt'])) {
$submittedValues['contact_id'] = $this->_contactId;
$submittedValues['contribution_id'] = $this->_contributionId;
if (!empty($result) && !empty($this->_params['is_email_receipt'])) {
$this->_params['contact_id'] = $this->_contactId;
$this->_params['contribution_id'] = $this->_contributionId;
// to get 'from email id' for send receipt
$this->fromEmailId = $submittedValues['from_email_address'];
$sendReceipt = $this->emailReceipt($submittedValues);
$this->fromEmailId = $this->_params['from_email_address'];
$sendReceipt = $this->emailReceipt($this->_params);
if ($sendReceipt) {
$statusMsg .= ' ' . ts('A receipt has been emailed to the contributor.');
}
Expand Down