Bando Docs
Launch AppLearn More
  • Bando for Developers
    • The On-chain Spending Protocol
    • Quickstart
    • Glossary
    • Use Cases
    • Protocol Architecture
      • Payment Reference Validation
      • Order Request
      • Order Fulfillment
      • Refunds
  • Spending Widget
    • Widget Quick Start
    • Configuration
    • Customization
    • Localization
    • Wallet Management
    • Framework Integration
      • Next.js
      • Svelte
  • Fulfiller API
    • Get Started with the API
    • Authentication
    • Guides
      • Get Available Products
      • Get a Payment Reference
      • Validate a payment reference
      • Get a Quote
      • Get Available Tokens for a Chain
    • API Reference
  • EVM Smart Contracts
    • EVM Smart Contracts | Architecture
    • Contracts
      • Core
        • BandoERC20Fulfillable
        • BandoFulfillmentManager
        • BandoFulfillable
        • BandoRouter
        • FulfillmentTypes
      • Libraries
        • FulfillmentRequestLib
        • SwapLib
      • Periphery
        • ERC20TokenRegistry
        • FulfillableRegistry
      • Proxy
        • Upgradeability
    • Security
      • Access Control
      • Security Considerations
      • Rekt Test
      • Audits
    • Code
Powered by GitBook
On this page
  • Submitting a Fulfillment Result
  • Authorizing a Refund

Was this helpful?

Edit on GitHub
  1. Bando for Developers
  2. Protocol Architecture

Refunds

Complete guide to handling crypto payment refunds with Bando. Understand the refund flow, requirements, and implementation across supported chains.

PreviousOrder FulfillmentNextWidget Quick Start

Last updated 3 months ago

Was this helpful?

Submitting a Fulfillment Result

Once the BandoRouter emits a ServiceRequested event, the corresponding fulfiller must listen for this event or transaction to fulfill the order.

After the order is fulfilled for the user off-chain, the fulfiller must interact with the BFP's manager contract to call registerFulfillmentResult. This call submits the result to an on-chain registry, changes the status of the request, and releases the funds in escrow to the beneficiary (the fulfiller's configured address).

Authorizing a Refund

As a conscious decision, we made the refund process authorizable by the fulfiller. This choice was made to avoid possible re-entrancies and to prevent potential DoS attacks and theft of funds. The process follows these steps:

  1. The fulfiller fails to complete a request and decides to refund

  2. The fulfiller (the only one with permissions) interacts with the Manager Contract to authorize a refund for the transaction

  3. The funds in escrow are now marked as refundable to the user's address

  4. The fulfiller calls the withdrawRefund function, and the funds are released to the target address