Skip to content

Flow Name: [I2C] Account: Auto-renewal Payment Method Changed

Last Updated: 2025-09-18 Source Code: I2C_Account_Auto_renewal_Payment_Method_Changed.flow-meta.xml

API Name: I2C_Account_Auto_renewal_Payment_Method_Changed Status: Active Type: Custom Trigger: Account update (after save) when Auto_Renewal_Payment_Method__c changes

Business Purpose

Ensures payment method consistency across all recurring subscriptions by automatically updating the payment method on all active ChargentOrders when a customer changes their auto-renewal payment method at the Account level.

Process Flow

  1. Trigger Detection: Activates when Account's Auto_Renewal_Payment_Method__c field changes
  2. Recurring Orders Lookup: Retrieves all ChargentOrders for the Account with "Recurring" payment status
  3. Payment Method Update Loop:
  4. Iterates through each recurring ChargentOrder
  5. Creates temporary order record with updated payment method
  6. Adds to collection for bulk update
  7. Bulk Update: Updates all affected ChargentOrders with the new payment method
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Account update (after save) when Auto_Renewal_Payment_Method__c changes]) --> Lookup[Lookup Related Data]

    Lookup --> Found{Data<br/>Found?}
    Found -->|No| End([End])
    Found -->|Yes| Calculate[Calculate/Determine Values]

    Calculate --> Update[Update Records]
    Update --> End

    style Start fill:#e1f5ff
    style Lookup fill:#f0e1ff
    style Found fill:#fff4e1
    style Calculate fill:#e1ffe1
    style Update fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only processes ChargentOrders with "Recurring" payment status
  • Updates ChargentOrders__Payment_Method_Default__c field to match Account's Auto_Renewal_Payment_Method__c
  • Uses bulk update pattern for performance with multiple recurring orders
  • Immediate propagation ensures all future recurring payments use updated method

Dependencies

  • Account object with Auto_Renewal_Payment_Method__c field
  • ChargentOrders__ChargentOrder__c with payment method and status fields
  • Proper Account-to-ChargentOrder relationships
  • Active recurring subscriptions on the account

Changes

Flow description indicates this handles propagation of payment method changes to existing auto-renewing subscriptions.

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • No error handling for ChargentOrder update failures
  • No validation that new payment method is valid/active

HIGH - Address Soon After Go-Live

  • Missing notification to user about which orders were updated
  • No rollback mechanism if bulk update partially fails
  • Could overwrite payment methods set individually on orders

MEDIUM - Future Enhancement

  • Add comprehensive error handling and rollback logic
  • Implement user notification of affected subscriptions
  • Add validation of payment method before propagation
  • Consider adding opt-out mechanism for specific orders

LOW - Monitor

  • Monitor for failed payment method updates
  • Track customer satisfaction with automatic payment method changes
  • Validate that all recurring charges use updated payment methods

Maintenance Notes

Important flow for payment method consistency. Well-structured with bulk processing pattern. Critical for subscription billing reliability. Consider adding error handling and user notifications before production deployment.