Implementation

Learn how to implement ACH payments.

To avoid fraud, Coinflow does not finalize credits/USDC/bank transfers until after the ACH payment has fully settled. Since ACH has delayed settlement, merchants must design their smart contracts to support separate wallets for paying and receiving the good/service. This ensures that Coinflow can finalize the transaction securely after the ACH payment has settled.

How It Works

  1. Merchant passes a transaction to Coinflow.
  2. User initiates an ACH purchase.
  3. Our systems initiate the ACH transfer and then wait until the money is received (3 business days).
  4. After transfer, our system runs the transaction you provided with our USDC payer, delivering the goods/services to the end user.

Solana Integration

Solana transactions list every account which is read from or written to during the transaction. In the place of the users wallet (or the wallet paying the USDC), replace that key in the transaction instructions with 22222222222222222222222222222222222222222222. In the place of the USDC payers token account, replace the key in the transaction instructions with 33333333333333333333333333333333333333333333.

For example if you would normally construct a transaction instruction like so:

const transferIx = createTransferInstruction(  
  getTokenAddressSync(usersWallet, USDC_MINT), // spender token account
  destinationTokenAccount,  // destination token account
  usersWallet, // Owner of spender token account
  1  // amount
);

You would now instead construct the transaction instruction like so:

const transferIx = createTransferInstruction(  
  new PublicKey('33333333333333333333333333333333333333333333'), // spender token account
  destinationTokenAccount,  // destination token account
  new PublicKey('22222222222222222222222222222222222222222222'), // Owner of spender token account
  1  // amount
);

On the backend Coinflow will replace these placeholders with a signer and the signers token account so that it can pay USDC on behalf of the user.

📘

If you support both card and ACH payments, add the placeholders, and in the redeem transaction Coinflow will automatically replace the placeholders with the users wallet and their token account.

EVM Integration

Evm transactions always have a msg.sender and a from field. Our system will automatically set that to our payer.