Multiple Payment Requests in commerce_quickpay_gateway Cause Order ID Collisions

Created on 15 July 2025, 18 days ago

Problem/Motivation

The Drupal Commerce module, when used with the commerce_quickpay_gateway module, occasionally sends two requests during the payment process, causing an ID collision. This results in QuickPay throwing an error indicating that the order is already taken or exists. The issue stems from JavaScript (jQuery) code in the module that triggers multiple simultaneous requests to create an order with the same ID. To align with Drupalโ€™s direction of phasing out jQuery support, we propose replacing the jQuery-based code with vanilla JavaScript.

Steps to reproduce

  1. Install Drupal Commerce 3.0.
  2. Install commerce_quickpay_gateway 2.x-dev@dev.
  3. Configure a payment gateway for QuickPay.
  4. Attempt to process a payment for an order.
  5. Observe that the redirect triggers two requests: the first is treated as a cancel, and the second attempts to load, often resulting in a QuickPay error stating the order is already taken.

Proposed resolution

Use the once method to ensure the payment request is triggered only once, preventing multiple simultaneous requests and eliminating ID collisions. Additionally, replace the jQuery-based code with vanilla JavaScript to align with Drupalโ€™s move away from jQuery support.

โœจ Feature request
Status

Active

Version

3.0

Component

Payment

Created by

๐Ÿ‡บ๐Ÿ‡ฆUkraine matthew10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024