Skip to content

feat: add pay_with_tip — extend pay() with optional gratuity - #133

Open
MarcusDavidG wants to merge 1 commit into
mainfrom
feat/pay-with-tip
Open

feat: add pay_with_tip — extend pay() with optional gratuity#133
MarcusDavidG wants to merge 1 commit into
mainfrom
feat/pay-with-tip

Conversation

@MarcusDavidG

Copy link
Copy Markdown
Contributor

Adds pay_with_tip(payer, invoice_id, amount, tip) — identical to pay() but with an optional gratuity sent directly to the treasury.

Behaviour

  • amount goes to the contract vault and counts toward invoice.funded
  • tip goes directly to the treasury in a separate transfer — never held by the contract
  • tip is stored on the Payment record for audit purposes but does not count toward get_payer_total
  • tip=0 is valid and behaves identically to pay()
  • Payer index updated same as pay()
  • Auto-release / escrow-hold triggered same as pay() when fully funded

Closes #110

Adds pay_with_tip(payer, invoice_id, amount, tip) which behaves
identically to pay() but accepts an optional tip transferred
directly to the treasury address.

- tip is stored on the Payment record for audit purposes
- tip does NOT count toward invoice.funded or get_payer_total
- tip=0 is valid and identical to calling pay()
- treasury is read from instance storage (set at initialize time)
- Payer index updated same as pay()

Closes #110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add pay_with_tip — extend pay() to accept optional tip amount

1 participant