VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: rvbgnu on February 19, 2021, 13:53:24 PM

Title: Payment method: card details removed when ticking Terms of Service radio box
Post by: rvbgnu on February 19, 2021, 13:53:24 PM
Hi fellows VirtueMart supporters!

I hope you are all well in this difficult time.

In the one page checkout, login or not, you enter your card details, and then click the terms of services box, and after the short javascript process, the card details are empty.

This has been reported by a client of mine, with Joomla 3.9.22 and VirtueMart 3.8.6.
I could reproduce it with the same versions and recent ones too.
- Authorize.net
- PayPal Payment Pro (showing the card details form)

Is there anyone else with this issue ?

Have a great day!
Title: Re: Payment merhod: card details removed when ticking Terms of Service radio box
Post by: jenkinhill on February 19, 2021, 14:00:45 PM
I have never seen that and nobody else has reported it.  Are you using a third party OPC or template overrides?
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: rvbgnu on February 19, 2021, 14:10:14 PM
Thank you jenkinhill for your super fast reply, as usual !

No, no other third party OPC or override. Just a standard Joomla + VirtueMart installs, with the protostar template.
I cannot tell you since which VM version it is happening, but I can reproduce it on several different website, live or dev.
Title: Re: Payment merhod: card details removed when ticking Terms of Service radio box
Post by: jenkinhill on February 19, 2021, 16:02:21 PM
Is the payment successfully made on confirming purchase?
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: rvbgnu on February 19, 2021, 16:34:13 PM
yes, it is. But one needs to re-enter the credit card details to validate it.
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: rvbgnu on February 24, 2021, 19:03:47 PM
Does anyone can try to reproduce it on a dev or test website ?
You may try with Paypal Payment Pro, without any sandbox credentials: you do not need to confirm the order and payment to reproduce the issue ;-)
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: Jörgen on February 25, 2021, 08:07:10 AM
When are you reentering the credit Card details? Has there been an update to PHP 8?
Jörgen @ Kreativ Fotografi
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: rvbgnu on March 01, 2021, 11:56:55 AM
Thank you Jörgen for your reply.

There is no PHP 8 or any fancy stuff. It is on several sites and a "vanilla" test website, updated regularly.

Would you try on a test website, or a live/copy one?
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: ssc3 on March 03, 2021, 11:46:23 AM
Old problem effecting shipping/payment methods with fields.

http://forum.virtuemart.net/index.php?topic=145136.0
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: GJC Web Design on March 03, 2021, 15:04:06 PM
The Authorize plugin seems to me to have multiple problems

clean install on vm 3.8.8 .. std checkout

when a CC number is entered and the field looses focus  onchange="javascript:checkAuthorizeNet(2, this);" is triggered

function checkAuthorizeNet(id, el)
               {
                 ccError=razCCerror(id);
               CheckCreditCardNumber(el.value, id);
               if (!ccError) {
               el.value=\'\';}
               }

but the js file components/com_virtuemart/assets/js/vmcreditcard.js isn't loaded afaik and these throw errors

adding  $html .= '<script src="/components/com_virtuemart/assets/js/vmcreditcard.js"></script>'; loads the above functions but this again fails on

if (cardname.toLowerCase () == cards.name.toLowerCase()) {

in the checkCreditCard() function as cardname is 0

...

just returning true for checkAuthorizeNet(2, this)  doesn't help the disappearing fields though, when you click T&Cs and on this particular install passing the cc details ( without VM OPC selected) is very flaky  ..
the majority of the time no details are stored in the $cart and as reported cleared when any other function is called.

:(

Jenks .. do u have any clients with a  working Authorize on the stand checkout on 3.8.8. ?

My two clients with Authorize both report that it is broken but aren't sure from when...  the method isn't used often.
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: jenkinhill on March 03, 2021, 16:16:28 PM
Quote from: GJC Web Design on March 03, 2021, 15:04:06 PM
Jenks .. do u have any clients with a  working Authorize on the stand checkout on 3.8.8. ?

My two clients with Authorize both report that it is broken but aren't sure from when...  the method isn't used often.

John, I have one active client using Auth - he is still on 3.8.6 and has reported no problems with that.

In case it makes a difference this site uses Abishek's OPC.
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: GJC Web Design on March 03, 2021, 17:15:48 PM
Ta .. will test with alternate checkouts to see if i can get to the bottom of this.. :)
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: GJC Web Design on March 06, 2021, 17:43:00 PM
Ok .. as ssc3 pointed out there has been a change of function for the cart update

So in my testing anyway if the payment edit is not displayed in the cart ( i.e. VM cart std OPC )  - so edit payment is shown as a separate page  the card details do not get saved to the session when the updateCartNoMethods() function  is used.

my hack in the VM cart controller

   public function updateCartNoMethods($html=true,$force = null){
      //return $this->updatecart($html, $force, false);
      return $this->updatecart($html, $force, true);
   }

fixed the problem immediately

works for me anyway
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: AH on March 07, 2021, 12:48:02 PM
Yes I got trapped by this new "updatecartnomethods" function just the other day called in the cart view

I decided to leave the nomethods in the controller and "adjust" the cart view.html.php

static public function addCheckRequiredJs(){

Remove

      $(\'input[name="task"]\').val("updateCartNoMethods");




Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: rvbgnu on May 25, 2021, 18:38:14 PM
Thank you very much AH and GJC.

But how do we fix it for the regular "user" ?
I cannot decently ship a payment plugin with a core hack  ;D
Title: Re: Payment method: card details removed when ticking Terms of Service radio box
Post by: GJC Web Design on May 25, 2021, 18:39:40 PM
Beg Max to either revert or add a hidden config to allow this to be switched