Implementing a new PSP

Actual communication is done inside one of the three execution functions: ExecutePayment, GetPayFormData, or GetPayRedirectUrl. Which one is invoked depends on the interaction type of the PSP. These functions always run outside of work, as they're expected to communicate with an external provider.

If these function need to update payment state (metadata, paid, etc) they should open work and invoke UpdatePaymentMetadata with the payment token passed to them.

Some general guidelines when implementing a new payment method

pendingpayments table

WRD Payments tracks payments whose status we need to watch/poll in wrd.pendingpayments. Transactions are recorded there as soon as StartPayment starts communicating with the PSP.