0

I have two products on my Drupal (9.4.2) Commerce site. I can complete the checkout process for one of the products, and the order shows up in the view at /admin/commerce/orders. The other one, however, gets hung up after I click the "Pay and Complete Purchase" button. After a while, the screen goes white and there's no error message at all. Nothing shows up in the log file, either. The payment gateway (Stripe) does show the payment going through, but there is no record of the order on my site. I can't figure out what the difference is between the two products that would cause this behavior. They are virtually the same, the only difference being the name of the products. In fact, I deleted the problem product and then replaced it by duplicating the product that works. Unfortunately, the problem remains.

The output of the console during the checkout process for both products is the same:

Loading failed for the <script> with source “https://www.googletagmanager.com/gtag/js?id=UA-68402666-1”. 23785:17:1
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. modernizr.min.js:3:5914

Cookie “SSESS881388a882e9883aafd6264d030b0353” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite 23785

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ jquery.min.js:2:81867

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). moz-extension:71:797851
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). moz-extension:71:797851

Partitioned cookie or storage access was provided to “https://m.stripe.network/inner.html#url=https%3A%2F%2Fnew.classicalstudies.org%2Fcheckout%2F8715%2Forder_information&title=Checkout%20%7C%20Society%20for%20Classical%20Studies%20Test&referrer=https%3A%2F%2Fnew.classicalstudies.org%2Fcart&muid=4b05ae8f-a19e-4a6b-a213-2174d88e5d99451e13&sid=NA&version=6&preview=false” because it is loaded in the third-party context and dynamic state partitioning is enabled.

I can't figure out why one can be processed but the other can't.

2
  • Does the browser console show nothing?
    – cilefen
    Jul 12, 2022 at 11:15
  • Thanks for your comment. I added the browser's console output to the original post.
    – sjhuskey
    Jul 12, 2022 at 13:12

1 Answer 1

1

My problem was caused by an improperly configured license expiration field on the product variation. I discovered this by adding the following to the site's index.php (web/index.php):

ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

On the white screen that would come up after the transaction timed out, the error reported was:

Fatal error: Maximum execution time of 120 seconds exceeded in /home/blistein/domains/new.classicalstudies.org/web/modules/contrib/recurring_period/src/Plugin/RecurringPeriod/FixedReferenceDateInterval.php on line 177

That led me to examine the license expiration field, and I found that it was set to a date prior to the date of the transaction. I changed the year to the next year and changed the interval field to "1 Years". After that, the transaction went through without issue.

I hope this helps someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.