Label: complexity: high
Points: 200
Description
Payers who contribute to a long-running invoice may want their funds returned if the invoice isn't fully funded within their chosen timeframe. This issue adds payer_expiry: u64 per payment — if the invoice is still pending after payer_expiry, that specific payer can call reclaim_expired_payment() to retrieve their contribution.
Technical Context
Involves types.rs (add expiry: u64 to Payment) and lib.rs. Update pay() to accept optional payer_expiry: u64. Add reclaim_expired_payment(env, invoice_id, payer) requiring payer auth, asserting env.ledger().timestamp() > payment.expiry, transferring payer's total back, removing their payments, updating invoice.funded.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
Payers who contribute to a long-running invoice may want their funds returned if the invoice isn't fully funded within their chosen timeframe. This issue adds
payer_expiry: u64per payment — if the invoice is still pending afterpayer_expiry, that specific payer can callreclaim_expired_payment()to retrieve their contribution.Technical Context
Involves
types.rs(addexpiry: u64toPayment) andlib.rs. Updatepay()to accept optionalpayer_expiry: u64. Addreclaim_expired_payment(env, invoice_id, payer)requiring payer auth, assertingenv.ledger().timestamp() > payment.expiry, transferring payer's total back, removing their payments, updatinginvoice.funded.Acceptance Criteria
pay()accepts optionalpayer_expirytimestampreclaim_expired_payment()requires payer auth"payment not expired"before expiry timestampinvoice.fundeddecremented correctly after reclaimcargo clippypasses with zero warnings