Skip to content

Commit 0b8731e

Browse files
committed
Switch to year/month params as credit_card_exp_date can be inconsistent
1 parent 3fb34df commit 0b8731e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

CRM/Core/Payment/OmnipayMultiProcessor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ private function getSensitiveCreditCardObjectOptions($params) {
588588
$cardFields[$cardField] = isset($params[$civicrmField]) ? $params[$civicrmField] : '';
589589
}
590590
if (!empty($params['credit_card_exp_date'])) {
591-
$cardFields['expiryMonth'] = $params['credit_card_exp_date']['M'];
592-
$cardFields['expiryYear'] = $params['credit_card_exp_date']['Y'];
591+
$cardFields['expiryMonth'] = $params['month'];
592+
$cardFields['expiryYear'] = $params['year'];
593593
}
594594
return $cardFields;
595595
}
@@ -1530,10 +1530,10 @@ protected function doPreApproveForRecurring($params) {
15301530
* @return false|string
15311531
*/
15321532
protected function getCreditCardExpiry($params) {
1533-
if (empty($params['credit_card_exp_date'])) {
1533+
if (empty($params['year']) || empty($params['month'])) {
15341534
return FALSE;
15351535
}
1536-
return date("Y-m-t", strtotime($params['credit_card_exp_date']['Y'] . '-' . $params['credit_card_exp_date']['M']));
1536+
return date("Y-m-t", strtotime($params['year'] . '-' . $params['month']));
15371537
}
15381538

15391539
/**

0 commit comments

Comments
 (0)