10000 GitHub - fahdi/seacoast-lendfusion-integration: SeacoastLoans Lendfusion Integration
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fahdi/seacoast-lendfusion-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeaCoast Lendfusion Integration

A WordPress plugin that integrates SeaCoast's loan application system with the Lendfusion API.

Features

  • Retailer Application Form (Form #15) integration
  • Loan Application Form (Form #16) integration
  • Personal Loan Application Form (Form #2) integration
  • Automatic OAuth token management
  • Comprehensive logging system
  • Admin interface for log management
  • Proxy support for API requests
  • Environment-based configuration (Production/Sandbox)
  • Customizable API base URLs for each environment
  • Plaid Integration for identity verification and bank account setup
  • Dynamic form confirmation handling
  • Entry meta management for application tracking
  • Automatic email notifications for API errors
  • Comprehensive error tracking and reporting

Installation

  1. Upload the plugin files to the /wp-content/plugins/seacoast-lendfusion-integration directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Configure the plugin settings in the WordPress admin panel

Configuration

Environment Settings

The plugin supports configuring two separate environments:

  1. Sandbox (Testing)

  2. Production (Live)

    • Separate API Base URL field (default: https://core.seacoastloans.com)
    • Production-specific Client ID and Client Secret
    • Quick Bucks Application Type ID: 2

You can select your active environment (Sandbox or Production) via the radio buttons at the top of the settings page. The current active environment is always prominently displayed.

Required Settings

For each environment (Sandbox and Production), you'll need to configure:

  1. API Base URL

    • The root URL for the Lendfusion API
    • Default values are provided but can be customized
  2. API Credentials

    • Client ID
    • Client Secret
  3. Proxy Settings (if required)

    • Proxy Host:Port
    • Proxy Username (if required)
    • Proxy Password (if required)

Switching Environments

When switching between environments:

  1. Select the desired environment radio button (Sandbox or Production)
  2. Save your settings
  3. The plugin will immediately begin using the selected environment for all API calls
  4. A visual indicator at the top of the settings page shows your current active environment

Error Handling and Notifications

The plugin includes a comprehensive error handling system with automatic email notifications:

Error Categories

  • Authentication errors (invalid tokens, access denied)
  • Connection errors (timeouts, network issues)
  • JSON parsing errors (malformed responses)
  • Application-specific errors

Email Notifications

When an API error occurs, the plugin automatically sends an email to the site administrator containing:

  • Form title and entry ID
  • Error code and message
  • Timestamp of the error
  • Additional error details
  • Error categorization
  • Relevant form data

Error Logging

All errors are logged with detailed information:

  • Full error stack trace
  • Request and response data
  • User context
  • Form submission details
  • Error categorization

Logging

The plugin maintains detailed logs of all API interactions in the wp-content/seacoast-logs directory.

Log Management

  1. View recent logs in the WordPress admin panel under "SeaCoast Integration"
  2. Download full log file using the "Download Log File" button
  3. View complete logs in a modal window using the "View Full Log" button
  4. Clear all logs using the "Clear All Logs" button
  5. Logs include:
    • API requests and responses
    • OAuth token management
    • Error messages and stack traces
    • Form submission details
    • Plaid integration events
    • Application status changes
    • Email notification events

Log File Format

Logs are stored in a structured format:

[timestamp] message: data

The log file can be downloaded as a plain text file for offline analysis or archiving.

Form Integration

Retailer Application (Form #15)

  • Creates agency records in Lendfusion
  • Handles file uploads for business licenses
  • Manages Plaid integration for identity verification
  • Stores application status and agency ID in entry meta
  • Provides admin interface for viewing application details

Loan Application (Form #16)

  • Creates loan applications in Lendfusion
  • Handles payment receipt uploads
  • Manages application submission workflow
  • Integrates with Plaid for identity verification and bank account setup
  • Stores Plaid URLs and application status in entry meta
  • Provides dynamic confirmation messages with next steps

Personal Loan Application (Form #2)

  • Creates personal loan applications in Lendfusion
  • Manages application submission workflow
  • Integrates with Plaid for identity verification and bank account setup
  • Stores application status and Plaid URLs in entry meta
  • Provides dynamic confirmation messages with next steps

Plaid Integration

The plugin integrates with Plaid for:

  1. Identity Verification

    • Generates shareable verification URLs
    • Stores verification status
    • Provides verification links in confirmation messages
  2. Bank Account Setup

    • Generates hosted link URLs for bank connection
    • Stores bank connection status
    • Provides bank setup links in confirmation messages

Plaid URL Management

  • URLs are stored in form entry meta
  • Available through admin interface
  • Accessible via shortcodes
  • Included in confirmation messages
  • Protected by WordPress security measures

Troubleshooting

  1. Check the logs in the WordPress admin panel
  2. Verify API credentials and environment settings
  3. Ensure proxy settings are correct (if using)
  4. Check file permissions for the logs directory
  5. Try clearing cached OAuth tokens through the API Test page
  6. Verify Plaid integration settings
  7. Check entry meta for stored application data
  8. Review error email notifications for API issues

Security

  • All API credentials are stored securely
  • Logs are protected and only accessible to administrators
  • Nonce verification for all admin actions
  • Input sanitization and validation
  • Secure storage of Plaid URLs
  • Protected access to application data
  • Secure error handling and reporting

Support

For support or issues, please contact the development team.

Changelog

1.2.3

  • Updated file upload field mapping for Quickbucks Loan form to use only the correct receipt upload field (ID 107) and send its URL to the Lendfusion API.
  • Enhanced logging for file uploads: logs now clearly show detected file uploads, document mapping, and API payloads for better traceability.

1.1.7

  • Updated personal loan application endpoint handling
  • Added support for individual and business applications
  • Improved form data structure and field mappings
  • Enhanced data sanitization and type casting
  • Updated confirmation message to show application status and next steps
  • Fixed environment-specific endpoint URLs for personal loan applications

1.1.6

  • Updated loan retailer field ID from 63 to 114
  • Improved field validation and sanitization
  • Enhanced error handling for retailer field

1.1.5

  • Removed file handling from API requests to fix validation errors
  • Improved error handling and logging
  • Fixed retailer validation

1.1.4

  • Added support for proxy settings
  • Added automatic email notifications for API errors
  • Enhanced error handling with detailed error reporting
  • Improved logging system with email alerts
  • Added error categorization (authentication, connection, JSON parsing)

1.1.3

  • Added customizable API base URLs for each environment
  • Improved environment selection with visual indicators
  • Reorganized settings page for better clarity

1.1.2

  • Initial release
  • Basic form integration
  • Logging system
  • Admin interface
  • Proxy support

About

SeacoastLoans Lendfusion Integration

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0