Skip to content

Add payment delegation — allow a third party to pay on behalf of a payer #315

Description

@Kingsman-99

Overview

Currently only the address initiating the transaction can be recorded as the payer. Add delegation so a sponsoring address can pay an invoice on behalf of another address (e.g. a company paying on behalf of an employee).

Acceptance Criteria

  • pay_invoice_delegated(invoice_id, on_behalf_of: Address) function
  • Caller provides funds; on_behalf_of address is recorded as the payer
  • on_behalf_of must have signed a delegation authorization stored via set_delegation(invoice_id, delegate: Address)
  • set_delegation callable only by the address granting the delegation
  • Delegation is single-use — consumed on first pay_invoice_delegated call
  • Payment history records both the payer (on_behalf_of) and executor (caller)
  • Emits DelegatedPayment { invoice_id, payer, executor, amount, ledger } event
  • Integration tests: delegation grant → delegated pay, replay attack prevention

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsfeatureNew contract feature or operation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions