Skip to content
Snippets Groups Projects
Commit 760eb2b1 authored by Sascha Grossenbacher's avatar Sascha Grossenbacher Committed by Sascha Grossenbacher
Browse files

Issue #3119674 by Berdir: Payment methods without expiration date like twint...

Issue #3119674 by Berdir: Payment methods without expiration date like twint result in an error when saving alias
parent 126e4ac2
Branches
Tags
No related merge requests found
......@@ -402,9 +402,11 @@ class Datatrans extends OffsitePaymentGatewayBase {
'expy' => $payment_details['expy'],
]);
$expires = CreditCard::calculateExpirationTimestamp($payment_details['expm'], $payment_details['expy']);
$payment_method->setRemoteId($payment_details['aliasCC']);
$payment_method->setExpiresTime($expires);
if (!empty($payment_details['expm']) && !empty($payment_details['expy'])) {
$expires = CreditCard::calculateExpirationTimestamp($payment_details['expm'], $payment_details['expy']);
$payment_method->setExpiresTime($expires);
}
$payment_method->save();
return $payment_method;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment