Reference / @getenginex/sdk/testing / markDepositPaid
markDepositPaid()
markDepositPaid(
mockFetch,depositId):void
Plays the bank's part by confirming a PIX: marks the deposit created by deposits.createPix as paid in the mock's state. After that, deposits.get/deposits.list return status: 'completed' and the balance (wallet.get/wallet.getBalance) goes up by the deposit amount — only once, even if called again. mockFetch must be the fetch returned by createMockFetch (not a wrapper around it).
Parameters
mockFetch
{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }
depositId
string
Returns
void
Example
ts
import { createEnginexClient } from '@getenginex/sdk'
import { createMockFetch, markDepositPaid } from '@getenginex/sdk/testing'
const mockFetch = createMockFetch()
const enginex = createEnginexClient({ baseUrl: 'https://gateway.test', tenantHost: 'casino.test', fetch: mockFetch })
await enginex.auth.login({ email: 'ana@exemplo.com', password: 'Senha@123' })
const pix = await enginex.deposits.createPix({ amount: 5_000 })
markDepositPaid(mockFetch, pix.id)
await enginex.deposits.get({ depositId: pix.id }) // { status: 'completed', ... }Throws
If mockFetch did not come from createMockFetch or if the deposit does not exist in that mock.