Skip to content

Flow Name: [I2C] Update Payment Method Billing Email

Last Updated: 2025-04-14 Source Code: I2C_Update_Payment_Method_Billing_Email.flow-meta.xml

API Name: I2C_Update_Payment_Method_Billing_Email Status: Active Type: Custom Trigger: ChargentBase__Payment_Method__c creation/update (before save) when billing email is "invalid@aanp.org"

Business Purpose

Circumvents a known system bug by automatically updating payment method billing email addresses from the associated Account's PersonEmail when the default placeholder email is detected during payment method creation.

Process Flow

  1. Triggers when Payment Method is created/updated with billing email set to "invalid@aanp.org"
  2. Validates that Payment Method has an associated Account (ChargentBase__Account__c is not null)
  3. Copies the Account's PersonEmail to the Payment Method's ChargentBase__Billing_Email__c field
  4. Single-step direct assignment with no additional logic
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: ChargentBase__Payment_Method__c creation/update (before save) when billing email is "invalid@aanp.org"]) --> Check{Entry Criteria<br/>Met?}

    Check -->|No| End([End])
    Check -->|Yes| Process[Execute Business Logic]

    Process --> Update[Update Records]
    Update --> End

    style Start fill:#e1f5ff
    style Check fill:#fff4e1
    style Process fill:#e1ffe1
    style Update fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only processes Payment Methods with specific placeholder email "invalid@aanp.org"
  • Requires Payment Method to have valid Account relationship
  • Before-save trigger for immediate email correction
  • Addresses system limitation preventing payment method creation with emails containing numbers

Dependencies

  • ChargentBase__Payment_Method__c object with ChargentBase__Billing_Email__c and ChargentBase__Account__c fields
  • Account object with PersonEmail field
  • Proper relationship between Payment Method and Account

Changes

Flow description notes this circumvents a bug preventing payment method creation from flow when email contains numbers.

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Hardcoded values that should be configurable: Email address "invalid@aanp.org" is hardcoded and could break if changed
  • Missing null checks on required operations: No validation that Account.PersonEmail exists or is valid before assignment
  • Missing error handling or fault paths: No error handling if Account relationship is missing or PersonEmail is null

HIGH - Address Soon After Go-Live

  • Flows that modify critical business data without validation: Updates billing email without validating email format or deliverability
  • Workaround approach suggests underlying system issue should be properly resolved
  • No logging or audit trail for email address changes

MEDIUM - Future Enhancement

  • Replace hardcoded email with custom setting or custom metadata
  • Add email format validation before assignment
  • Implement proper fix for underlying bug instead of workaround
  • Add comprehensive logging for payment method email updates

LOW - Monitor

  • Monitor for cases where Account.PersonEmail is blank or invalid
  • Track success rate of payment method creation after email update
  • Validate that underlying bug still exists and workaround is still needed

Maintenance Notes

Simple workaround flow that addresses a specific system bug. High risk due to hardcoded values and lack of validation. Should be replaced with proper system fix when possible. Critical that hardcoded email value remains consistent with system expectations.