Labels: complexity: high
Update the SDK pay() method to accept a donateOnFailure boolean flag. When true, the payment is marked in the contract so that if the invoice fails to reach its goal, the funds are donated rather than refunded.
Acceptance criteria:
pay({ invoiceId, amount, donateOnFailure }) passes the flag to the contract
donateOnFailure defaults to false
getPaymentHistory returns the flag per payment
- TypeScript type updated on
PaymentOptions
Labels: complexity: high
Update the SDK
pay()method to accept adonateOnFailureboolean flag. When true, the payment is marked in the contract so that if the invoice fails to reach its goal, the funds are donated rather than refunded.Acceptance criteria:
pay({ invoiceId, amount, donateOnFailure })passes the flag to the contractdonateOnFailuredefaults tofalsegetPaymentHistoryreturns the flag per paymentPaymentOptions