Simulate Debits
Simulate a charge from a merchant to a virtual card.
Create a Simulated Debit
try {
const result = await simulatorClient.simulateDebit({
authorizationId: authorization.id,
amount: 1200,
})
} catch (error) {
// Handle error
}do {
let debitInput = SimulateDebitInput(
amount: 1200,
authorizationId: authorization.id
)
let response = try await simulatorClient.simulateDebitWithInput(
debitInput
)
// Debit has been created
} catch let error {
// Handle/notify the user of error
}val debitInput = SimulateDebitInput(
authorizationId = authorization.id,
amount = 1200
)
launch {
try {
val debit = withContext(Dispatchers.IO) {
simulatorClient.simulateDebit(debitInput)
}
// Debit has been created
} catch (e: DebitException) {
// Handle/notify the user of exception
}
}Last updated