Author Topic: Credit Card Expiration Year Has to Increase  (Read 1419 times)

Srinivas G

  • Beginner
  • *
  • Posts: 48
Credit Card Expiration Year Has to Increase
« on: July 27, 2015, 08:14:57 am »
Dear All,

How to increase the Credit Card Expiration Year from 2022 to 2030??

User wants to pay through credit card and user's credit card expiry year is 2023. But in site while making payment it's displaying till 2022 only. How can i increase till 2030.

I found one thread, there i saw one techinque as specified below.

File Path : Root/plugins/vmpayment/authorizenet/authorizenet.php (Near Line Number : 229)

Quote
$html .= shopfunctions::listYears('cc_expire_year_' . $method->virtuemart_paymentmethod_id, $this->_cc_expire_year, NULL, 2022, " onchange=\"javascript:changeDate(" . $method->virtuemart_paymentmethod_id . ", this);\" ");


If i change 2022 to 2030, in store section it's displaying till 2030. Is it right process or Do we have any other way to do it?

Kindly suggest as soon as possible...


Regards,
Srinivas

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2045
    • alatak.net
Re: Credit Card Expiration Year Has to Increase
« Reply #1 on: July 27, 2015, 12:55:04 pm »
hello
the good fix is this one
Code: [Select]
$html .= shopfunctions::listYears('cc_expire_year_' . $this->_currentMethod->virtuemart_paymentmethod_id, $this->_cc_expire_year, NULL, null, " onchange=\"javascript:changeDate(" . $this->_currentMethod->virtuemart_paymentmethod_id . ", this);\" ");

Srinivas G

  • Beginner
  • *
  • Posts: 48
Re: Credit Card Expiration Year Has to Increase
« Reply #2 on: July 27, 2015, 13:32:13 pm »
Thanks for your response...
We have tried with this, it's displaying till 2022. But we want to display 2023 also. How can we ?

Regards,
Srinivas

Srinivas G

  • Beginner
  • *
  • Posts: 48
Re: Credit Card Expiration Year Has to Increase
« Reply #3 on: July 28, 2015, 09:55:26 am »
Can anyone update on this... It's important and urgent...

Regards,
Srinivas

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2045
    • alatak.net
Re: Credit Card Expiration Year Has to Increase
« Reply #4 on: July 28, 2015, 11:50:58 am »
Hello
It should not. It should add 11 years to the actual year, which is 2026.
I have tested it again

Srinivas G

  • Beginner
  • *
  • Posts: 48
Re: Credit Card Expiration Year Has to Increase
« Reply #5 on: July 28, 2015, 15:59:30 pm »
Hello,

But it's not happening in my case.
Attached screenshots for reference, please check.

I am using old version of virtuemart i.e., 2.0.22b.
Is it applicable for old version of virtuemart?

Regards,
Srinivas

Srinivas G

  • Beginner
  • *
  • Posts: 48
Re: Credit Card Expiration Year Has to Increase
« Reply #6 on: July 29, 2015, 13:52:26 pm »
Hello,

Any updates???

Regards,
Srinivas

Srinivas G

  • Beginner
  • *
  • Posts: 48
Re: Credit Card Expiration Year Has to Increase
« Reply #7 on: July 30, 2015, 09:51:24 am »
Kindly suggest on this???


Regards,
Srinivas

Srinivas G

  • Beginner
  • *
  • Posts: 48
Re: Credit Card Expiration Year Has to Increase
« Reply #8 on: July 30, 2015, 13:13:09 pm »
I got solution for this issue...

1. Open shopfunctions.php file and search for "listYears" static function, replace “$end = $end ? $end : $start + 7;” with “$end = $end ? $end : $start + 11;”.
filepath : Root/administrator/components/com_virtuemart/helpers/shopfunctions.php

2. And updated authorizenet.php plugin file with below line.
Quote
$html .= shopfunctions::listYears('cc_expire_year_' . $method->virtuemart_paymentmethod_id, $this->_cc_expire_year, NULL, null, " onchange=\"javascript:changeDate(" . $method->virtuemart_paymentmethod_id . ", this);\" ");



Regards,
Srinivas

elleclouds

  • Jr. Member
  • **
  • Posts: 69
Re: Credit Card Expiration Year Has to Increase
« Reply #9 on: June 08, 2018, 23:46:41 pm »
Hello
It should not. It should add 11 years to the actual year, which is 2026.
I have tested it again

I tried this method but it did not work for me.  I have the most up to date version of virtue mart 3.2.14

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26995
  • Always on vacation
    • Jenkin Hill Internet
Re: Credit Card Expiration Year Has to Increase
« Reply #10 on: June 09, 2018, 10:31:30 am »
This thread is from 3 years ago, with a very different VM version! 

Configuration for the date picker from released version VM.3.2.14.9808 onwards has configuration options for year start and range in the custom field additional parameters. Have you set those?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12

elleclouds

  • Jr. Member
  • **
  • Posts: 69
Re: Credit Card Expiration Year Has to Increase
« Reply #11 on: June 10, 2018, 17:13:27 pm »
This thread is from 3 years ago, with a very different VM version! 

Configuration for the date picker from released version VM.3.2.14.9808 onwards has configuration options for year start and range in the custom field additional parameters. Have you set those?

I did not know this.  Also, is there a tutorial on how to actually do it.  Where do I start?  One of my customers brought it to my attention that they can only choose 2022 as the date for their CC payments.  I don't know where to begin to alter this using custom fields?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26995
  • Always on vacation
    • Jenkin Hill Internet
Re: Credit Card Expiration Year Has to Increase
« Reply #12 on: June 11, 2018, 11:37:33 am »
My apologies, I have reread this and see you are talking about the Authorizenet plugin?

The latest VM version works just fine in testing, so suggest you check that the file administrator/components/com_virtuemart/helpers/shopfunctions.php has this line for the function listYears (around  line 938)

 $end = $end ? $end : $start + 11;

And that plugins/vmpayment/authorizenet/authorizenet.php  has this line around 243:

$html .= shopfunctions::listYears('cc_expire_year_' . $this->_currentMethod->virtuemart_paymentmethod_id, $this->_cc_expire_year, NULL, null, " onchange=\"javascript:changeDate(" . $this->_currentMethod->virtuemart_paymentmethod_id . ", this);\" ");

Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12