Page 1 of 1

paypal express opening 2 orders ...

Posted: Tue Jul 19, 2022 5:58 pm
by loop
hi All

I have a strange thing. I installed paypal express (and other payment methods) and everything works, beside i had in the last 4 days, multiple time, whenn paypal orders (i have installed paypal express module) opens 2 orders_id in 2 to 6 seconds difference. i have only 1 payment, but 2 orders, one time it was 2 secodes difference and once 6 second.

I made a testorder, i also "double clicked" on the confirmation button, but i t always makes correct 1 order. but something strange must happen, to make 2 orders out of 1.

Does somebody has a idea whenn this could happend, how i can fix that?

Re: paypal express opening 2 orders ...

Posted: Thu Jul 21, 2022 9:20 pm
by loop
Nobody gas this issue with double orders on paypal express module?
I wonderschöne if the reason / fix is to disable the confirm button after first click, but im not sure if the reason are 2 requests from confirmation page....

Re: paypal express opening 2 orders ...

Posted: Tue Aug 09, 2022 9:44 am
by loop
I have now seen that in the paypal logfile there is in every case that i have double orders twice the enty for "doexpresscheckoutpayment" ...most time 0 to 3 seconds difference.

On the second entry i can view:

L_SHORTMESSAGE0Duplicate RequestL_LONGMESSAGE0A successful transaction has already been completed for this token.L_SEVERITYCODE0Warning

So the plugin notice that its a double order but still create 2 orders. Is this not a bug? Can anybody helps me to solve this issue? 90% of paypal express orders works just fine....only a couples i have double orders ( 1 time tripple order). Strange thing is that ib thr phoenix paypal log its written clearly thats already submited but still create a order..
Thanks for every help / hint

Re: paypal express opening 2 orders ...

Posted: Wed Aug 17, 2022 3:22 pm
by loop
I'm really stuck with this, does really nobody have the same issue?

I use Paypal Express and most orders are just fine, only once every 1-2 days i have a double order (1 payment, 2 orders_id) and in the logfile i see 2 DoExpressCheckoutPayment

and on the second i also see in the response, that

Code: Select all

TIMESTAMP 	2022-08-17T14:54:37Z
CORRELATIONID 	b814134bbd822
ACK 	SuccessWithWarning
VERSION 	204
BUILD 	57439687
L_ERRORCODE0 	11607
L_SHORTMESSAGE0 	Duplicate Request
L_LONGMESSAGE0 	A successful transaction has already been completed for this token.
L_SEVERITYCODE0 	Warning
i really would appriciate any hints / tips or maybe tell me who did the paypal plugin, maybe this person can help me out.

Re: paypal express opening 2 orders ...

Posted: Mon Aug 22, 2022 3:21 pm
by ecartz
Harald did the PayPal App as far as I know.

Of people here, @BrockleyJohn probably knows the most about it. Please note that he has no responsibility for the current PayPal Express module, so he would expect payment for diagnosing someone else's app.

Re: paypal express opening 2 orders ...

Posted: Mon Aug 22, 2022 3:40 pm
by BrockleyJohn
My guess is that an occasional muppet on your site is going clickety-click (double, triple) on the checkout confirmation button.

I have a basic hook that will put a stop to it - uploading to addons as soon as I can zip it.

Probably not the paypal app's fault at all (this time)

Re: paypal express opening 2 orders ...

Posted: Mon Aug 22, 2022 3:41 pm
by BrockleyJohn
...just cos you can't reproduce it, doesn't mean they can't manage it!

Re: paypal express opening 2 orders ...

Posted: Mon Aug 22, 2022 4:04 pm
by BrockleyJohn

Re: paypal express opening 2 orders ...

Posted: Tue Aug 23, 2022 7:19 am
by loop
Thank you BrockleyJohn!

i integrated it now and we will see if it's because of that ....

i had to modify a bit the code, as 1. i wanted / needed it only on the paypal module, as i have other paymentmodules which do not need to submit the form (lightboxes) and somehow i had a error about the formname, so i hardcoded the formname of the checkout, now it works for me

Code: Select all

function listen_injectBodyEnd() // straight after footer scripts
  {
    Global $payment_modules, $formname;
      //Bei Paypal only singleclick
     if ($payment_modules->selected_module == "paypal_express") {

      return <<<EOS
<script>
const cbtn = document.querySelector(".btn-success");
const icn = document.querySelector(".btn-success span");
const frm = document.querySelector('form[name="checkout_confirmation"]');
let press = 0;
cbtn.addEventListener('click', (e) => {
  e.preventDefault();
  if (frm.checkValidity()) {
    if (press == 0) {
      icn.classList.remove('fa-check-circle');
      icn.classList.add('fa-spinner');
      frm.submit();
    }
    press++;
  } else {
    frm.reportValidity();
  }
});
</script>
EOS;
    }
  }

Re: paypal express opening 2 orders ...

Posted: Fri Sep 09, 2022 12:51 pm
by loop
@BrockleyJohn it worked, since i made the "single click Workarround" i have no double orders from Paypal. - thank you!

One strange thing still happends:
if a customer use paypal express for account creating and he has special character in the adresse or name, something strange happends:

- customer account is correct with the special character "ä ö ü" for example but delivery and billing adress the character is not correct (the ääö is replaced with strange utf8 strange characters)

so the question is, why it's correct saved to the customer DB with the correct encoding but not in the orders table in the billing / shipping fields

any ideas how to fix that?

this problems only happends with paypal so it has to be something with this module....
thanks in advance!