Flow Name: Create Payment Request¶
Last Updated: 2025-09-15 Source Code: Create_Payment_Request.flow-meta.xml
API Name: Create_Payment_Request Status: Active Type: Custom Trigger: Manually initiated (likely from Order record page button/action)
Business Purpose¶
Creates a Chargent payment request for an existing Order that can be sent to customers via email. This allows businesses to request payment from customers for orders that haven't been paid yet.
Process Flow¶
- Get Gateway: Retrieves the first active Chargent payment gateway
- Get Order: Looks up the Order record with billing and account information
- Create Chargent Order: Creates a ChargentOrder record with:
- Billing information from the Order
- Payment method set to "Credit Card"
- Payment frequency set to "Once"
- Charge amount equal to Order total
- Links to the Standard Order
- Create Payment Request: Creates a ChargentOrders Payment Request with:
- Email address from Account
- Auto-sends payment request email
- Links to the Chargent Order and Standard Order
- Includes payment instructions in notes
- Success/Error Handling: Shows toast message on success or error screen on failure
📊 Click to view Process Flow Diagram
flowchart TD
Start([Start: Manually initiated (likely from Order record page button/action)]) --> 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 works with active payment gateways
- Uses Order billing information for payment request
- Payment method is hardcoded to "Credit Card"
- Payment frequency is always "Once" (one-time payment)
- Order source is set to "ecommerce"
- Email is automatically sent to customer
- Payment request notes include amount due and support contact information
Dependencies¶
- ChargentBase__Gateway__c object (payment gateway)
- ChargentOrders__ChargentOrder__c object
- ChargentOrders__Payment_Request__c object
- Order object with Account and billing information
- Custom toast component (c:toastInLightningFlow)
Changes¶
None explicitly noted in the flow
⚠️ Pre-Go-Live Concerns¶
CRITICAL - Fix Before Go-Live¶
- Missing null checks: No validation if Gateway lookup fails - could cause runtime errors
- Missing Order validation: No check if Order is in appropriate status for payment requests
- Hardcoded support contact: Contact information is hardcoded in formula - should be configurable
HIGH - Address Soon After Go-Live¶
- No duplicate prevention: Flow could create multiple payment requests for same Order
- Limited payment methods: Only supports Credit Card, no ACH or other payment types
- No amount validation: Doesn't verify Order has positive amount before creating payment request
MEDIUM - Future Enhancement¶
- No audit trail: No logging of who initiated payment request or when
- Limited customization: Payment template and notes are hardcoded
- No expiration logic: Payment requests don't have expiration dates
LOW - Monitor¶
- Generic error handling: Error messages could be more specific to help troubleshooting
- No business hour validation: Requests can be sent at any time
Maintenance Notes¶
Complexity: Medium - Straightforward payment request creation with basic error handling. Review quarterly for any changes to payment gateway configuration or business requirements. Monitor for any customer complaints about payment request emails.