Skip to content

Flow Name: [I2C] Screen Flow: Create Custom Payment

Last Updated: 2025-10-16 Source Code: I2C_Screen_Flow_Create_Custom_Payment.flow-meta.xml

API Name: I2C_Screen_Flow_Create_Custom_Payment Status: Active Type: Custom Trigger: Screen flow (manually initiated from Order record page)

Business Purpose

Allows staff to manually record custom payment types (checks, PAC contributions, NSF payments) on orders when traditional credit card processing isn't used. Creates both a ChargentOrder record and Transaction record to maintain payment history.

Process Flow

  1. Get Order Record: Retrieves Order details including total amount
  2. Payment Details Screen: User selects:
  3. Payment method (CHECK-SPLIT, NSF Check, PAC Cash, PAC Check, NSF PAC Check)
  4. Check number (required for check payments)
  5. Date & Time (defaults to current)
  6. Amount (defaults to order total)
  7. Create Chargent Order: Creates ChargentOrder with payment method and status "Complete"
  8. Assign Transaction Values: Sets transaction fields including:
  9. Links to Order and ChargentOrder
  10. Amount and payment method
  11. Status set to "Approved"
  12. Type set to "Charge"
  13. Create Transaction: Saves the transaction record
  14. Error Handling: Shows detailed error screen if transaction creation fails
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Screen flow (manually initiated from Order record page)]) --> Screen[Display Screen:<br/>User Input Required]

    Screen --> UserInput[User Enters Data]
    UserInput --> Process[Process Input]
    Process --> Action[Execute Action]
    Action --> End([End])

    style Start fill:#e1f5ff
    style Screen fill:#fff4e1
    style UserInput fill:#e1ffe1
    style Process fill:#ffe1e1
    style Action fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only works on Order records (validates recordId starts with "801")
  • Check number is required for all check-based payment methods
  • Payment status automatically set to "Complete"
  • Transaction status automatically set to "Approved"
  • Transaction type is always "Charge"
  • Amount defaults to order total but can be modified
  • Date/time defaults to current timestamp

Dependencies

  • Order object
  • ChargentOrders__ChargentOrder__c object
  • ChargentOrders__Transaction__c object
  • Must be launched from Order record page

Changes

None explicitly noted in the flow

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • No duplicate payment prevention: Could create multiple payments for same order without validation
  • No payment amount validation: Allows payments greater than order total or negative amounts
  • Missing record validation: Could fail if Order record is invalid or missing required fields

HIGH - Address Soon After Go-Live

  • No audit trail: No tracking of who created the custom payment
  • Limited payment methods: Fixed list of payment types - difficult to add new ones
  • No approval workflow: All custom payments are automatically approved without review

MEDIUM - Future Enhancement

  • Hardcoded payment choices: Payment method options are hardcoded in flow rather than configurable
  • No partial payment logic: Doesn't handle scenarios where payment is less than order total
  • Limited error details: Error messages could provide more specific guidance

LOW - Monitor

  • Check number format: No validation of check number format or uniqueness
  • No reconciliation support: Missing fields that might help with payment reconciliation

Maintenance Notes

Complexity: Medium - Screen flow with business logic for payment processing. Review when adding new payment methods or changing business requirements. Monitor error rates and user feedback on payment method options.