The
pay function is the core method of Base Pay that lets your users send USDC (digital dollars) on the Base network. No crypto knowledge required - we handle all the complexity. No fees for merchants or users.Try it out: Test the pay function interactively in our Base Pay SDK Playground.Parameters
Returns
Errors
Thepay function throws an error when the payment fails. The error object contains a message explaining what went wrong.
Error Handling
Thepay function throws errors instead of returning a result. Always wrap calls to pay in a try-catch block to handle errors gracefully:
Error Handling