Scottsdale ACH Gateway
Location: web/app/plugins/scottsdale-ach-gateway/
Version: 1.1.0
Author: Rhino Group
Plugin Name: Scottsdale ACH Gateway
Overviewโ
The scottsdale-ach-gateway plugin provides two WooCommerce payment gateways:
- Scottsdale ACH Gateway โ Full ACH bank transfer payment using Plaid for bank account authentication and iTransact as the ACH processing backend.
- Scottsdale Deposit Gateway โ Credit card deposit gateway (5% of order total) used for bank wire transfer orders. Extends the AngellEYE PayPal PPCP credit card gateway.
File Structureโ
scottsdale-ach-gateway/
โโโ init.php โ Plugin bootstrap
โโโ inc/
โ โโโ class-plugin.php โ Main orchestrator
โ โโโ class-system.php โ Gateway registration
โ โโโ class-admin.php โ Admin assets
โ โโโ class-frontend.php โ Nonce rendering, payment data saving
โ โโโ class-api.php โ REST API endpoint registration
โ โโโ class-gateway.php โ ACH WooCommerce payment gateway
โ โโโ class-gateway-deposit.php โ CC deposit payment gateway
โ โโโ class-plaid-api.php โ Plaid API client
โ โโโ class-itransact-api.php โ iTransact ACH processor client
โ โโโ class-utils.php โ Utility helpers
โ โโโ class-simplexml-extended.php โ XML parsing utility
โโโ dist/
โโโ css/ โ Compiled CSS
โโโ img/
โ โโโ money-check-dollar-light.svg โ ACH gateway icon
โ โโโ credit-card-regular.svg โ Deposit gateway icon
โโโ js/
โโโ cc-deposit-checkout.js โ Deposit gateway frontend
ACH Payment Gateway (WC_Scottsdale_ACH_Gateway)โ
Gateway ID: scottsdale-ach-gateway
Extends: WC_Payment_Gateway
Title: "ACH Gateway - Scottsdale"
How ACH Checkout Worksโ
1. Customer reaches checkout, selects "ACH Bank Transfer"
2. Gateway calls Plaid API โ gets a Plaid Link token
3. Frontend launches Plaid Link (embedded bank auth UI)
4. Customer selects their bank, authenticates via Plaid
5. Plaid returns a public_token to the browser
6. Frontend calls POST /wp-json/plaid/get-access-token (REST API)
7. REST API exchanges public_token โ access_token (stored in user meta)
8. Customer selects their bank account from the list Plaid returns
9. Customer submits checkout
10. WC_Scottsdale_ACH_Gateway::process_payment() calls iTransact API
11. iTransact submits ACH debit, returns transaction ID
12. Order status set to wc-pending-ach
13. Kount Pre-Auth runs; ENS callback updates order if approved
14. suma-woo-emails sends "Pending ACH" email to customer
Admin Configurationโ
WooCommerce โ Settings โ Payments โ Scottsdale ACH Gateway
| Setting | Description |
|---|---|
| Title | Gateway title shown at checkout |
| Description | Description shown at checkout |
| Mode | Sandbox or Live (iTransact API mode) |
| Debug | Enable debug logging |
Key Methodsโ
| Method | Description |
|---|---|
payment_fields() | Renders the Plaid Link button and existing account dropdown at checkout |
enqueue_scripts() | Loads Plaid SDK and gateway JS on checkout page |
process_payment( $order_id ) | Processes the ACH payment via iTransact, returns redirect |
get_admin_form_fields() | Returns the admin settings field definitions |
Deposit Gateway (WC_Scottsdale_Deposit_Gateway)โ
Gateway ID: scottsdale-deposit-gateway
Extends: WC_Gateway_CC_AngellEYE (PayPal PPCP credit card)
Title: "Deposit Gateway - Scottsdale"
Purposeโ
When a customer pays via bank wire transfer, Scottsdale Mint requires a 5% deposit to secure the order. This deposit is collected via credit card through the deposit gateway.
How the Deposit Flow Worksโ
1. Customer selects "Bank Wire Transfer" at checkout
2. Deposit Gateway is presented instead of full CC payment
3. Customer enters credit card details (5% of order total is charged)
4. Kount Pre-Auth runs on the deposit transaction
5. Kount ENS callback: approved โ order moves to wc-partially-paid
6. Customer receives confirmation email with bank wire instructions
7. Customer sends bank wire for remaining 95%
8. Admin confirms bank wire received โ order moves to processing
Configurationโ
Only loaded when the WC_Gateway_CC_AngellEYE PayPal PPCP extension is available. The System class checks for this dependency before registering the gateway.
Plaid API Client (\Scottsdale\ACH_Gateway\PlaidApi)โ
Wraps Plaid's API for bank account authentication.
Key Methodsโ
| Method | Description |
|---|---|
get_link_token() | Creates a Plaid Link token for the checkout UI |
get_access_token( $public_token ) | Exchanges a Plaid public_token for a persistent access_token |
get_accounts( $access_token ) | Returns list of bank accounts for the authenticated user |
Data Storageโ
Plaid tokens are stored in user meta (logged-in users) or WooCommerce session (guests):
| Meta Key | Description |
|---|---|
plaid_access_token | Persistent Plaid access token for the user's bank |
plaid_selected_institution | Name of the bank institution |
plaid_selected_account | Selected account details (last 4 digits, type) |
iTransact API Client (\Scottsdale\ACH_Gateway\ITransactApi)โ
Handles ACH payment submission to the iTransact payment processor.
Mode: Configurable (sandbox / live) via gateway admin settings.
The iTransact gateway is specialized for precious metals dealers and provides:
- ACH debit processing
- Precious metals industry risk management
- Industry-specific fraud screening in addition to Kount
REST API Endpointsโ
Registered via \Scottsdale\ACH_Gateway\API using rest_api_init.
POST /wp-json/plaid/get-access-tokenโ
Exchanges a Plaid public_token (generated client-side by Plaid Link) for a server-side access_token.
Authentication: WP nonce (rendered in page footer by Frontend::render_api_nonce())
Request body:
{
"public_token": "public-sandbox-abc123...",
"institution_name": "Wells Fargo",
"account_id": "xyz789"
}
Response:
{
"success": true,
"accounts": [
{ "id": "xyz789", "name": "Checking โขโขโขโข 4321", "type": "depository" }
]
}
POST /wp-json/plaid/remove-accountโ
Removes a saved Plaid bank account from user meta.
Authentication: WP nonce
Request body:
{
"account_id": "xyz789"
}
WordPress Hooks Registeredโ
| Hook | Class::Method | Priority | Description |
|---|---|---|---|
plugins_loaded | System::init() | 1001 | Initialize the plugin after all plugins are loaded |
woocommerce_payment_gateways | System::add_gateway() | 1100 | Register ACH and deposit gateways with WooCommerce |
wp_footer | Frontend::render_api_nonce() | 5 | Output API nonce for REST calls |
woocommerce_checkout_update_user_meta | Frontend::maybe_copy_payment_data_to_user_meta() | 10 | Persist Plaid selections to user meta |
rest_api_init | API::register_routes() | โ | Register Plaid REST routes |
wp_enqueue_scripts | Gateway::enqueue_scripts() | 99 | Load Plaid SDK on checkout |
admin_init | Admin::enqueue_assets() | โ | Load admin CSS/JS |
Dependenciesโ
| Dependency | Type | Required |
|---|---|---|
| Plaid API credentials | External API | Yes (configured in WC gateway settings) |
| iTransact API credentials | External API | Yes (configured in WC gateway settings) |
WC_Gateway_CC_AngellEYE | WooCommerce payment class | For deposit gateway only |
| Plaid Link SDK | CDN script | Loaded on checkout: https://cdn.plaid.com/link/v2/stable/link-initialize.js |