Skip to main content
Refunds a subscriber by transferring tokens from the merchant’s wallet to the subscriber’s wallet. The refund is a direct transfer call - the merchant pays from their own balance, not from the contract.

Parameters


Authorization

The merchant address on the subscription’s plan must sign the transaction. The merchant’s auth covers both the refund() call and the nested token.transfer().

Return value

None (void).

Events emitted


Error cases


Examples

The refund amount is not validated against previous charges. The merchant can refund any amount they choose, including partial refunds. The merchant must have sufficient token balance to cover the refund.