refactor(automations): detect manual payment via OrderTransaction.manualPaymentGateway

- Drop wireTransferGatewayNames from ShopSettings (new migration).
- Replace string-matching with a GraphQL query against
  Order.transactions[].manualPaymentGateway, the first-class flag
  Shopify exposes for any merchant-defined manual payment method.
- Both webhook handlers now fetch the order on the fly to classify it,
  removing the configurable gateway-names field from settings.
This commit is contained in:
Gerhard Scheikl
2026-05-09 20:31:31 +02:00
parent 0800d1160b
commit 93aec2f368
6 changed files with 71 additions and 58 deletions
@@ -0,0 +1,4 @@
-- Drop the column added by the previous migration; we now classify
-- wire-transfer orders by querying OrderTransaction.manualPaymentGateway
-- via the GraphQL Admin API instead of by configurable name match.
ALTER TABLE "ShopSettings" DROP COLUMN "wireTransferGatewayNames";
-4
View File
@@ -105,10 +105,6 @@ model ShopSettings {
autoEmailOnWireTransferPlaced Boolean @default(false)
// 2) Order is fulfilled and is NOT a wire-transfer order → auto-email.
autoEmailOnFulfilledNonWireTransfer Boolean @default(false)
// Comma-separated list of payment-gateway names treated as "wire transfer"
// (matched case-insensitively, substring). Empty falls back to a sensible
// default ("manual,Überweisung,Wire Transfer,Bank Transfer,Vorkasse,Bank Deposit").
wireTransferGatewayNames String @default("")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt