Label: complexity: high
Points: 200
Description
Payers holding XLM or other Stellar assets cannot pay USDC invoices directly. This issue adds an auto_convert: bool flag to pay() — when true, the contract calls the Stellar DEX to swap the payer's asset to the invoice token before crediting the payment.
Technical Context
Involves lib.rs pay(). Add auto_convert: bool parameter. When true, invoke a DEX swap contract (mock interface in tests) to convert payer's source asset to invoice.token before the standard token_client.transfer(). The swapped amount is what gets credited to invoice.funded.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
Payers holding XLM or other Stellar assets cannot pay USDC invoices directly. This issue adds an
auto_convert: boolflag topay()— when true, the contract calls the Stellar DEX to swap the payer's asset to the invoice token before crediting the payment.Technical Context
Involves
lib.rspay(). Addauto_convert: boolparameter. When true, invoke a DEX swap contract (mock interface in tests) to convertpayer's source asset toinvoice.tokenbefore the standardtoken_client.transfer(). The swapped amount is what gets credited toinvoice.funded.Acceptance Criteria
pay()acceptsauto_convert: boolparameterauto_convert = falseproduces identical behaviour to current implementationauto_convert = true, DEX swap is invoked before crediting paymentinvoice.fundedcargo clippypasses with zero warnings