Simulate Refunds
Simulate a refund from a merchant to a virtual card.
Create a Simulated Refund
try {
const result = await simulatorClient.simulateRefund({
debitId: debit.id,
amount: 1200,
})
} catch (error) {
// Handle error
}do {
let refundInput = SimulateRefundInput(
amount: 1200,
debitId: debit.id
)
let response = try await simulatorClient.simulateRefundWithInput(
refundInput
)
// Refund has been created
} catch let error {
// Handle/notify the user of error
}val refundInput = SimulateRefundInput(
debitId = debit.id,
amount = 1200
)
launch {
try {
val refund = withContext(Dispatchers.IO) {
simulatorClient.simulateRefund(refundInput)
}
// Refund has been created
} catch (e: RefundException) {
// Handle/notify the user of exception
}
}Last updated