Wait for transfer
Wait for a deposit-address payment to be received
Polls payWithTransfer every 2 seconds until the transfer payment for a session is received and processed. Use it after showing the user the session's depositAddress.
Import
import { waitForTransfer } from "@paywithglide/glide-js";Usage
index.ts
import { waitForTransfer } from "@paywithglide/glide-js";
import { config } from "./config";
const { success } = await waitForTransfer(config, {
sessionId: "c165e159-1f0e-44a1-8fa8-8c963444752e",
});Parameters
sessionId*
string
The unique identifier of the session.
Return Type
success*
boolean
Indicates whether the payment was processed successfully.
Errors
Rejects with the same errors as payWithTransfer — except PaymentPendingError, which it handles by continuing to poll.
Note that this action resolves when the payment is received. To wait for the settlement transaction as well, follow up with waitForSession.