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:
@@ -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";
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user