The lifecycle at a glance
A Diesel exchange temporarily connects two balances: the customer’s original gift card and a Shopify gift card created for the checkout. The original value is reserved first, then the Shopify value is applied. What happens next depends on whether the checkout completes, remains idle, or is abandoned.
Every transition is recorded as a separate operation. This makes the process recoverable and prevents a late webhook or delayed queue job from reversing a transaction that has already settled.
- 01
Check
Validate the card details and return the current available balance.
- 02
Exchange
Reserve the requested value and apply one Shopify gift card to checkout.
- 03
Settle
Complete the exchange when Shopify confirms that the order was created.
- 04
Recover
Retire or abort an incomplete exchange and return reserved value when appropriate.
Checking and exchanging
Diesel checks the card number and four-digit PIN, then lets the customer exchange up to the checkout total after discounts. The request payload remains unchanged if a network timeout requires a retry.
Completion
Completion wins over a delayed abort. If an abort job becomes available after the order has already completed, it performs no financial action and does not deactivate the applied gift card.
Retire and abort
Retire handles a checkout that is still active but has remained idle beyond the configured window. The applied Shopify gift card is removed and the reserved value is released back to the original card.
Abort is the abandoned-checkout safety net. A delayed abort job checks whether completion occurred before it attempts to release anything. When completion exists, the abort becomes a harmless no-op. When no completion exists, the worker releases the funds and records that value was actually cleared.
Refunds
A Shopify refund webhook queues a refund operation for the amount returned by the merchant. Diesel maps the order back to its original exchange and restores that value to the source card.
The encrypted card reference is carried through the protected workflow so operators never need to copy raw card data into the admin app. Partial refunds can be processed without treating the whole exchange as reversed.