VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Srinivas G on July 27, 2015, 08:14:57 AM

Title: Credit Card Expiration Year Has to Increase
Post by: Srinivas G 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
Title: Re: Credit Card Expiration Year Has to Increase
Post by: alatak on July 27, 2015, 12:55:04 PM
hello
the good fix is this one
$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);\" ");
Title: Re: Credit Card Expiration Year Has to Increase
Post by: Srinivas G 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
Title: Re: Credit Card Expiration Year Has to Increase
Post by: Srinivas G on July 28, 2015, 09:55:26 AM
Can anyone update on this... It's important and urgent...

Regards,
Srinivas
Title: Re: Credit Card Expiration Year Has to Increase
Post by: alatak 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
Title: Re: Credit Card Expiration Year Has to Increase
Post by: Srinivas G 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
Title: Re: Credit Card Expiration Year Has to Increase
Post by: Srinivas G on July 29, 2015, 13:52:26 PM
Hello,

Any updates???

Regards,
Srinivas
Title: Re: Credit Card Expiration Year Has to Increase
Post by: Srinivas G on July 30, 2015, 09:51:24 AM
Kindly suggest on this???


Regards,
Srinivas
Title: Re: Credit Card Expiration Year Has to Increase
Post by: Srinivas G 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
Title: Re: Credit Card Expiration Year Has to Increase
Post by: elleclouds on June 08, 2018, 23:46:41 PM
Quote from: alatak 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

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
Title: Re: Credit Card Expiration Year Has to Increase
Post by: jenkinhill 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?
Title: Re: Credit Card Expiration Year Has to Increase
Post by: elleclouds on June 10, 2018, 17:13:27 PM
Quote from: jenkinhill 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?

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?
Title: Re: Credit Card Expiration Year Has to Increase
Post by: jenkinhill 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);\" ");