Credit Card Expiration Date incorrect on review page

Created on 24 January 2018, almost 7 years ago
Updated 1 November 2023, about 1 year ago

Using commerce_authnet payments, along with the acceptjs patch and the following other commerce patches:
https://www.drupal.org/files/issues/2790551-3.patch
https://www.drupal.org/files/issues/error_updating_cart_or_removing_item...

When customers get to the review page, the expiration date is showing the current month and year (1/2018), instead of the expiration for the card (which is NOT 1/2018). Payment is still successful, and as far as I can tell it looks like the correct expiration does get stored in the database. I modified the template to output the actual date value, which is a few minutes in the future - I suspect this may be the expiration of the payment token instead of the expiration of the card.

🐛 Bug report
Status

Closed: works as designed

Version

2.0

Component

Payment

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States morbus iff

    This is also happening on user/#/payment-methods/#/edit, where Authorize.net is returning (and Commerce is saving into the database) YY, but the select dropdown for year expects YYYY. The month displays fine, but the year will always be the "first item in the dropdown" (i.e., no selection whatsoever).

  • 🇮🇱Israel jsacksick

    hm... Not sure I understand the change? Could it be that Auth.net isn't calling calculateExpirationTimestamp() so it isn't properly set?

  • 🇺🇸United States morbus iff

    @jsacksick, thanks for the pointer.

    Does Commerce Core always expect YYYY for the payment expiration date?

    I'm not sure calculateExpirationTimestamp() is the _only_ answer, at least, because that also expects a YYYY, but Authorize.net is only asking for (from the user, in Accept.js UI) a YY and also only returns a YY after all is said and done. That then gets saved into commerce_payment_method__card_exp_year.card_exp_year_value. The AcceptJs code DOES call calculateExpirationTimestamp(), but I'm guessing it's only passing in YY.

    We'll be looking into this a little more closely in the next few weeks.

  • Status changed to Closed: works as designed about 1 year ago
  • 🇮🇳India vipin.j

    @Morbus Iff, The issue mentioned with comment #4 was belongs to the patch submitted with issue queue #3019539 Expand Accept.js to include Accept.js UI Needs review

    Since, the patch was developed in context of Authorize.net (Accept.js UI) API, which accepts expiry_year in format of YY, while the Commerce Payment stores that value in YYYY format. which creates conflict on Payment Method edit, that the default year won't get select as expected.

    The bug was fixed with the most recent patch update #38 Expand Accept.js to include Accept.js UI Needs review

    we can close this issue now.

Production build 0.71.5 2024