Pay with transfer
Settle a session paid via deposit address
Asks Glide to check for and process the payment for a session whose paymentAction is transfer. Call it after the user has sent funds to the session's depositAddress.
Throws a PaymentPendingError while the transfer hasn't been detected or confirmed yet — use waitForTransfer to poll until it succeeds.
Import
import { payWithTransfer } from "@paywithglide/glide-js";Usage
index.ts
import { payWithTransfer } from "@paywithglide/glide-js";
import { config } from "./config";
const { success } = await payWithTransfer(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
PaymentPendingError— the transfer hasn't been detected or confirmed yet; retry after a short delay.TransactionNotFoundError— no transfer transaction was found for the session.InsufficientPaymentAmountError— the transferred amount doesn't cover the required payment amount; the payment will be refunded.