Tickets not autoactivating and so not sent when using stripe payment

Created on 19 January 2024, 10 months ago
Updated 13 March 2024, 8 months ago

Problem/Motivation

The tickets are not autoactivating so also not sent because order state is not consistent at the moment that is checked.
I am using Drupal 10.1 with last tickets version (with patches from https://www.drupal.org/project/commerce_ticketing/issues/3382034 Drupal 10 upgrade RTBC to make it work with D10).

Steps to reproduce

If using stripe with credit card, when checkout is complete, the order `onPaid` event carries an order entity in `draft` state and turns to `completed` whenever after payment, so tickets cannot autoactivate because of order state not matching with what is set in product variation type "`commerce_ticketing`" 3rdparty settings(completed) ( https://git.drupalcode.org/project/commerce_ticketing/-/blame/2.x/src/Ev... . Because they remain in `created `state it will never be sent ( https://git.drupalcode.org/project/commerce_ticketing/-/blob/2.x/src/Eve... ).

The results of https://git.drupalcode.org/project/commerce_ticketing/-/blob/2.x/src/Eve... conditions are:

  "autoactivate" => true
  "order_state" => "completed"
  "setting_order_state" => "draft"
  "ticket_state" => "created"

If for example using a promotion of 100%, when checkout is complete, the order `onPaid` event carries an order entity in `completed` state, so tickets can be autoactivated because of order state matching with what's is set in product variation type `commerce_ticketing` 3rdparty settings (completed) ( https://git.drupalcode.org/project/commerce_ticketing/-/blame/2.x/src/Ev... ). Because now they are in state active they will be sent ( https://git.drupalcode.org/project/commerce_ticketing/-/blob/2.x/src/Eve... ).

The results of https://git.drupalcode.org/project/commerce_ticketing/-/blob/2.x/src/Eve... conditions are:

  "autoactivate" => true
  "order_state" => "completed"
  "setting_order_state" => "draft"
  "ticket_state" => "created"

So the evaluation is not consistent and I think it must be changed, I could provide functional tests with what I am saying to probe it, but anyway I thought some improvements in.

Proposed resolution

- Allow various order states in "activate ticket on order state" (`commerce_ticketing` 3rdparty settings ). This way tickets will activate whenever is in draft or completed.
- Add an activate action in ticket entity lists: I cannot find any way to activate the ticket when is in `created` state (maybe is in entity edit form but i hit "Error: Call to undefined method" will open an issue).
- Rename the operation from Re-send to Send if it was not already sent in ticket list operations to refine UX.

Remaining tasks

Functional tests.

User interface changes

- Rename the operation from Re-send to Send if it was not already sent in ticket list operations to refine UX.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇸Spain aleix

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