QuickPay Order ID Conflict on Cancelled Orders

Created on 8 July 2025, 26 days ago

Problem/Motivation

The current implementation of the QuickPay payment integration in Drupal 11 has an issue with order ID generation. When a user cancels a product order during the payment process, the corresponding order in Drupal is not deleted. However, QuickPay creates a placeholder order on its side using the provided order ID. If the user attempts to make another payment for the same product, QuickPay returns an error indicating that the order ID already exists, as it conflicts with the previously created placeholder. This disrupts the payment flow and prevents users from completing subsequent payment attempts for the same order. The issue stems from the lack of unique ID generation, as the current method does not account for cancelled orders or ensure sufficient uniqueness to avoid collisions on QuickPay’s system.

Proposed resolution

To address this issue, we propose updating the QuickPay module’s order ID generation logic in Drupal 11. Instead of relying on the existing ID generation method, we will implement a new approach that generates unique order IDs by combining the current timestamp with an encryption mechanism.

Specifically, we will:

  1. Capture the current timestamp (e.g., in milliseconds) at the moment of order creation to ensure a unique base value.
  2. Encrypt the timestamp using a hashing algorithm (e.g., SHA-256 or MD5) to enhance uniqueness and avoid predictable patterns.
  3. Append or prepend a prefix/suffix (e.g., site-specific code or random string) to further differentiate IDs across orders.

This approach ensures that each order ID is unique, even for cancelled orders, preventing conflicts with QuickPay’s placeholder orders. The updated IDs will be compatible with QuickPay’s requirements and maintain a consistent payment flow. We will also test the new ID generation logic thoroughly in the development environment to confirm that it resolves the error and supports seamless payment retries.

Feature request
Status

Needs work

Version

2.0

Component

Code

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