From 171ce8fb2a11933f3844a0c46a14b7b6f14aedc8 Mon Sep 17 00:00:00 2001 From: "Atchuthan, Sodexis" Date: Wed, 17 Jan 2018 14:47:37 +0530 Subject: [PATCH] [FIX] payment_authorize: Credit cards expiration date - Fixes the validation for credit cards expiration date. In the courtesy of @SodexisTeam --- addons/payment_authorize/models/payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py index 01f7fc3f9b9..2f5e8027f91 100644 --- a/addons/payment_authorize/models/payment.py +++ b/addons/payment_authorize/models/payment.py @@ -126,7 +126,7 @@ class PaymentAcquirerAuthorize(models.Model): for field_name in mandatory_fields: if not data.get(field_name): error[field_name] = 'missing' - if data['cc_expiry'] and datetime.now().strftime('%y%M') > datetime.strptime(data['cc_expiry'], '%M / %y').strftime('%y%M'): + if data['cc_expiry'] and datetime.now().strftime('%y%m') > datetime.strptime(data['cc_expiry'], '%m / %y').strftime('%y%m'): return False return False if error else True