Before implementing, learn about delegates here. Also see snow-delegate-template.
Specs
A contract can become a treasury pay delegate by adhering to ISNWPayDelegate3_1_1:
When extending pay functionality with a delegate, the protocol will pass a SNWDidPayData3_1_1 to the didPay(...) function:
The msg.sender to the delegate will be the payment terminal that facilitated the payment.
In payment terminals based on the SNWPayoutRedemptionPaymentTerminal3_1_1, such as SNWETHPaymentTerminal3_1_1's and SNWERC20PaymentTerminal3_1_1's, the pay delegate hook gets called after the project's tokens have been minted and distributed. View the docs.
Make sure to only allow trusted contracts to access the didPay(...) transaction.
Attaching
New delegate contracts should be deployed independently. Once deployed, its address can be returned from a data source hook. See how to build a data source for more.
Examples