Skip to content

Offer payer_data discovery and quantity pricing - #18

Open
shocknet-justin wants to merge 5 commits into
1.8from
offer-payer-data
Open

shocknet-justin wants to merge 5 commits into
1.8from
offer-payer-data

Conversation

@shocknet-justin

@shocknet-justin shocknet-justin commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Behavior

  • Offer code 6 means required payer data is missing or rejected. Return the full required-name list and no invoice so wallets can collect or correct fields and retry.
  • Malformed offer requests use code 1. Error codes are operation-specific; other CLINK operations retain their existing code-6 semantics.
  • quantity is a positive safe-integer JSON number. Other payer-data values remain strings. Required quantity is never inferred as 1; unsolicited quantity cannot change pricing or fulfillment data.

Pricing

Resolve the unit price using the existing category before multiplication: fixed configuration (0), host-resolved current price (1), or payer-selected spontaneous amount_sats (2). Variable offers do not need an encoded satoshi price, and payer amount_sats cannot override the host-resolved price. Apply limits to the final invoice total; unsafe or out-of-range totals use code 5. Preserve accepted quantity for seller fulfillment.

Alignment

SDK support is included in shocknet/ClinkSDK#32.

Pub implementation is on https://github.com/shocknet/Lightning.Pub/tree/offer-payer-data-quantity, branched from dash2. Pub currently exposes fixed and spontaneous pricing; this change does not add a new variable-pricing engine.

Pub keeps its existing SDK dependency until 1.8 is released; bump it on dash2 before dash2 merges for release.

Manage Fields

Label, price_sats, and payer_data are required in offer.fields. callback_url is optional: omission on create means null; omission on update preserves it; null or an empty string clears it. Updates require offer.id. No label is generated for a missing label.

SDK: shocknet/ClinkSDK#37
Pub: shocknet/Lightning.Pub#1077

Co-authored-by: Cursor <cursoragent@cursor.com>
@shocknet-justin
shocknet-justin marked this pull request as ready for review September 14, 2026 15:11
@shocknet-justin shocknet-justin changed the title offer code 6 for required payer_data Offer payer_data discovery and quantity pricing Nov 6, 2026
@shocknet-justin
shocknet-justin changed the base branch from main to 1.8 November 6, 2026 18:55
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.

1 participant