[MPP 1/3] feat(sell): credit-card payment method — ServiceOffer CRD + --pay-with card#605
Open
bussyjd wants to merge 1 commit into
Open
[MPP 1/3] feat(sell): credit-card payment method — ServiceOffer CRD + --pay-with card#605bussyjd wants to merge 1 commit into
bussyjd wants to merge 1 commit into
Conversation
Introduce a second, payment-method-agnostic gate on ServiceOffer so sellers can accept credit-card payments (MPP / Stripe stripe.charge) alongside the existing x402 on-chain crypto path. This PR lands the CRD surface + CLI flag; the verifier/controller card settlement seam is a separate spike. ServiceOffer CRD (internal/monetizeapi/types.go, regenerated yaml + deepcopy): - Add payment.method discriminator: "crypto" (default, unchanged behavior) | "card". - Add payment.card block (provider=stripe, account=acct_..., currency, networkId, paymentMethodTypes) — the card analog of network/payTo. - payment.payTo / payment.network are no longer unconditionally required; per-method requirements are enforced by three CEL x-kubernetes-validations rules so the API server rejects malformed offers at admission time (payTo+network required for crypto, card.account required for card). The existing payTo 0x-pattern is preserved and only applies when present. CLI (cmd/obol/sell.go): `obol sell http` gains --pay-with (crypto|card), --stripe-account and --card-currency. The card branch skips wallet/chain/asset resolution and ERC-8004 registration (no on-chain identity), emitting a method=card offer. Crypto invocations are byte-for-byte unchanged. schemas.PaymentTerms gains parity Method/Card fields + EffectiveMethod(). Tests: CLI flag/resolver unit tests (cmd/obol), CRD card-schema + CEL test (internal/embed). Smoke-verified on a live k3d v1.35 apiserver: 9/9 admission cases (crypto/card accept+reject) and an end-to-end `obol sell http --pay-with card` round-trip producing a valid stored CR.
3cf7c0e to
f422bb8
Compare
obol sell http --pay-with card
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the v0.11.0 MPP credit-card seller work → targets
integration/v0.11.0-rc1.What
Adds a payment-method-agnostic gate to
ServiceOfferso sellers can accept credit-card payments (MPP / Stripestripe.charge) alongside the existing x402 on-chain crypto path. This PR is the CRD surface + CLI flag; the verifier/controller card-settlement seam is a separate stacked spike.ServiceOffer CRD (
internal/monetizeapi/types.go, regenerated YAML + deepcopy)payment.methoddiscriminator:crypto(default, unchanged behavior) |card.payment.cardblock —provider(stripe),account(acct_…),currency,networkId,paymentMethodTypes— the card analog ofnetwork/payTo.payment.payTo/networkare no longer unconditionally required; three CELx-kubernetes-validationsrules enforce per-method requirements at admission (payTo+network for crypto, card.account for card). The existingpayTo^0x…{40}$pattern is preserved and only bites when present.CLI (
cmd/obol/sell.go)obol sell httpgains--pay-with(crypto|card),--stripe-account,--card-currency. The card branch skips wallet/chain/asset resolution and ERC-8004 registration (no on-chain identity). Crypto invocations are byte-for-byte unchanged.schemas.PaymentTermsgains parityMethod/Cardfields.Validation
go test ./...green;go vet+ gofmt clean; controller-gen produces no diff (generate-check passes).obol sell http --pay-with cardround-trip producing a valid stored CR.Notes
--register).