Scenario 1: Authorization and clearing
- Create a card with
type: VIRTUAL - Simulate authorization with a
cardIdandamount - Confirm
CARD_TRANSACTION_CREATEDwebhook received withstatus: PENDING - Simulate clearing with the
transactionId - Confirm
CARD_TRANSACTION_UPDATEDwebhook received withstatus: CLEARED
Scenario 2: Declined transaction
- Create a card
- Simulate decline with a
cardId,amount, and optionaldeclineReason(defaults toINSUFFICIENT_BALANCE) - Confirm
CARD_TRANSACTION_CREATEDwebhook received withstatus: DECLINED
declineReason.
Scenario 3: Decline against a frozen card
- Freeze a card
- Confirm
CARD_STATUS_UPDATEDwebhook received withstatus: FROZEN - Simulate authorization (confirm it is declined)
- Unfreeze a card
- Confirm
CARD_STATUS_UPDATEDwebhook received withstatus: ACTIVE
Scenario 4: Refund on a cleared transaction
- Create a card
- Simulate authorization
- Simulate clearing with the
transactionId - Simulate refund with the
transactionId - Confirm
CARD_TRANSACTION_UPDATEDwebhook received
Scenario 5: External authorization
Applies to External authorization mode projects only. In Managed projects, Reap decides the authorization and there is no endpoint to call.
CARD_AUTHORIZATION_REQUEST to your registered authorization endpoint and authorizes based on the decision you return. See The authorization request for the contract.
- Register your authorization endpoint (a webhook with
mode: REQUEST) and create a card - Simulate authorization with a
cardIdandamount - Your endpoint receives a
CARD_AUTHORIZATION_REQUEST; return{ "decision": "APPROVE" }or a decline - Confirm the
CARD_TRANSACTION_CREATEDwebhook reflects your decision:status: PENDINGon approve,status: DECLINEDon decline
Simulating card statuses
To force a card into a status that is otherwise hard to trigger (BLOCKED, EXPIRED), see Simulating card statuses.