💸 Implement ACH Payments
Developers can use this documentation to implement processing payments via ACH.
Implementing ACH Payments
Implementing ACH payments depends largely on if you're settling on-chain versus off-chain. Merchants who are settling on-chain to a contract may need to pass a transaction to the CoinflowPurchase component or to our ach checkout endpoint. Passing a transaction is not always required but it will allow Coinflow to run a transaction to complete the user's purchase if there's on-chain logic to run once the funds have settled.
How It Works
- The merchant submits a transaction to Rapid.
- The user initiates an ACH purchase.
- Approvely initiates the ACH transfer and monitors the payment until it is received (typically 3 business days).
- Once the transfer is completed, Approvely executes the on-chain transaction you provided using our USDC payer, fulfilling the purchase on behalf of the user.
How to Implement ACH via UI
Merchants implementing checkout via ACH using our UI should follow the steps outlined in our integration builder. Merchants who are settling on-chain may need to make adjustments to the transaction prop passed to Approvely.
How to Implement ACH via API
- Get the total purchase amount including all fees.
- Enable a customer to add a bank account.
- Get the customer's tokenized bank account.
- Send an ACH Checkout
- Note: Merchants on chain will need to pass a transaction. See section: 'On-Chain ACH Transactions'
On-Chain ACH Transactions
When Do ACH Payments Settle for On-Chain Transactions?
To prevent fraud, Approvely does not finalize credits, USDC, or bank transfers until the ACH payment has fully settled. Due to the delayed settlement of ACH payments, merchants using on-chain settlements must configure their smart contracts to handle separate wallets for initiating and receiving payments. This setup allows Approvely to finalize the transaction on-chain after the ACH payment has settled.
Transactions on Solana
Solana transactions specify all accounts that are read from or written to during the transaction. For on-chain settlements, replace the user’s wallet (or the wallet making the USDC payment) in your transaction instructions with the placeholder key 22222222222222222222222222222222222222222222. Similarly, replace the USDC payer's token account with the placeholder key 33333333333333333333333333333333333333333333.
For example, if your standard transaction instruction looks like this:
JavaScript
const transferIx = createTransferInstruction( getTokenAddressSync(usersWallet, USDC_MINT), // spender token account destinationTokenAccount, // destination token account usersWallet, // Owner of spender token account 1 // amount );
Modify it as follows for on-chain ACH settlement:
JavaScript
const transferIx = createTransferInstruction( new PublicKey('33333333333333333333333333333333333333333333'), // spender token account destinationTokenAccount, // destination token account new PublicKey('22222222222222222222222222222222222222222222'), // Owner of spender token account 1 // amount );
Approvely will dynamically replace these placeholders with the appropriate signer and the signer's token account, enabling the secure payment of USDC on behalf of the user.
📘If you support both card and ACH payments, add the placeholders, and when you call redeem transaction, Approvely will automatically replace the placeholders with the users wallet and their token account.
Transactions on EVM
Evm transactions inherently includes a have a msg.sender and a from field. Our system will automatically set that to our payer.
Updated 4 months ago