CyberSource: Encore Seats on this reference

How a ticketing merchant on CyberSource runs Anthropic's Claude Commerce Agents blueprint here, how a CyberSource sandbox is obtained, what the adapter sends to the test API, and what has and has not been run against it.

The demo merchant

Encore Seats is a fictional box office: 16 primary ticket listings across six events (a summer tour, a synth-pop fall tour, a duo's autumn show, a stand-up taping, and a philharmonic season opener) and four resale listings, priced from $47 for a balcony seat to $165 for a resale pit pair, in verticals/encore_seats/data/catalog.json. Ticket holds with a server-side timer, a waitlist, a wallet, and transfers come from the blueprint's ticketing example. Its tenders are card, Apple Pay, Google Pay, PayPal, Klarna pay in 4 between $50 and $2,000, and gift cards (the demo user holds $40). Every company, brand, product, and person is fictional; only CyberSource is real.

The storefront and merchant app are the blueprint's vendored entertainment apps pointed at the reference's API (vendor/commerce-agents/examples/entertainment), on ports 3019 and 3119, with the merchant API on 8019. Their page chrome reads "ACME Tickets"; the assistant is Encore Assistant, and the checkout link reads "Pay for your tickets · Encore Seats".

Checkout in the four models

Model What the button opens What the CyberSource adapter does
hosted a CyberSource Pay by Link page POST /ipl/v2/payment-links; the link URL is the button. Secure Acceptance Hosted Checkout is a signed form POST rather than a REST call and is not wrapped
server the merchant's own page POST /pts/v2/payments with tokenInformation.transientTokenJwt (a Flex Microform or Unified Checkout token) or, for a first test, paymentInformation.card; POST /pts/v2/payments/{id}/captures
dropin the merchant's page with Unified Checkout inside it POST /up/v1/capture-contexts; the JavaScript library mounts with the capture context and returns a transient token, charged with /pts/v2/payments
link the same Pay by Link URL, sent as a link POST /ipl/v2/payment-links
Shopper Assistant (the model) Store server PSP hosted page “check out” checkout(note) create_checkout_session(lines, customer,return_url) checkout_url · expires in 15 min checkout card + button (URL added after the model's call) opens the page · picks a tender · pays redirect + webhook: order · transaction next turn: “the cart is now an order” PCI: SAQ A · the PSP renders, collects, authorizes · the store learns by webhook
The processor renders, collects and authorizes. The store holds no card data. This is the model the first cut of this reference assumed, and the one Clover, Adyen, Stripe and Worldpay each create with a single call.

The adapter implements all four and scripts/psp_smoke.py cybersource exercises them. Encore Seats runs whichever model CHECKOUT_MODEL names: build_backend in verticals/encore_seats/api/backend.py composes the store with that model's mixin from psp_commerce/integration/ ahead of it, so the ticketing storefront's checkout button opens a Pay by Link page by default, the merchant's own page for the server and drop-in models, or a payment link.

Getting CyberSource sandbox credentials

Read from CyberSource's documentation on 8 September 2026.

  1. Register at https://developer.cybersource.com/hello-world/sandbox.html with an Organization ID (6 to 25 characters), company, and contact details. After the evaluation registration you can send test transactions, and an email guides you to create a user on the Test Business Center. No approval step is documented; the email's turnaround is not documented either.
  2. Sign in to the Test Business Center at https://businesscentertest.cybersource.com/ebc2. Open Payment Configuration, Key Management, then "+ Generate key" and choose "REST - Shared Secret". Copy the Key ID and the Shared Secret Key. The Merchant ID is the organization ID you chose (https://developer.cybersource.com/docs/cybs/en-us/platform/developer/all/rest/rest-getting-started.html).
  3. REST keys expire after three years and are per environment.
  4. Unified Checkout and Pay by Link are enabled at the portfolio level by a CyberSource sales representative, then added to the merchant account under Business Center, Portfolio Management, Merchant Details, Add products, and configured under Payment Configuration, Unified Checkout (https://developer.cybersource.com/docs/cybs/en-us/paybylink/developer/all/rest/paybylink/paybylink-intro.html, https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-intro-setup/uc-intro-setup-ebc/uc-enabling-ebc.html). Whether a fresh self-service sandbox has them on is not stated in the pages read.
  5. Webhook signing keys come from POST /kms/egress/v2/keys-sym, and subscriptions from POST /notification-subscriptions/v2/webhooks; notifications carry a v-c-signature header (https://developer.cybersource.com/docs/cybs/en-us/webhooks/implementation/all/rest/webhooks.html). The reference implements no CyberSource webhook route.

The variables

Variable Read by Meaning
CYBERSOURCE_MERCHANT_ID psp_commerce/adapters/cybersource.py the organization ID; sent as v-c-merchant-id
CYBERSOURCE_KEY_ID the adapter the REST shared-secret key's ID; the keyid of the Signature header
CYBERSOURCE_SECRET_KEY the adapter the shared secret's base64 value, decoded for the HMAC
ANTHROPIC_API_KEY both assistants the model
CHECKOUT_MODEL hosted (default), server, dropin or link which page the checkout button opens, see above

All three CyberSource variables must be set for the adapter to switch on.

First party and third party

The first-party run starts Encore Seats with its assistant: first-party/run.sh brings up the API on 8019, the ticketing storefront on 3019, and the merchant app on 3119 (--all default, --merchant, --api-only). The walkthrough, from two tickets to the "Pay for your tickets" link while the hold timer runs, is in first-party/README.md.

The third-party run starts only the API and lets a platform agent buy tickets over UCP: scripted, or driven by a model, with --complete gpay_demo on the simulated gateway and --serve for an MCP client such as Claude Code. The endpoints and the handler Encore Seats advertises are in third-party/README.md.

test.sh

platforms/cybersource/test.sh

It runs the pytest subset for this merchant (-k "encore or cybersource or adapters or thirdparty or demo_paths or verticals_boot", 32 of 66 tests), boots the API and checks the gateway mode against the three variables, fetches UCP discovery and tools/list, and runs the scripted platform agent to a staged checkout. With the variables set it adds scripts/psp_smoke.py cybersource: a payment link as the hosted session, a second link, a capture context, a payment intent, an authorization on /pts/v2/payments with the adapter's test card, and a Transaction Search, stopping at the first error with CyberSource's own message.

== the merchant boots
   Encore Seats · CyberSource · gateway simulated · checkout hosted
PASS  simulated gateway (no CyberSource credentials set)
== UCP discovery and the MCP handshake
PASS  discovery document
PASS  tools/list
== a scripted third-party agent shops here
PASS  platform agent staged a checkout (continue_url (variant 1, the shopper pays on the processor's page): http://localhost:8019/checkout/cko_…)
ALL PASS (CyberSource)

What was verified, and what was not

The CyberSource adapter has not been run against apitest.cybersource.com in this repository. It is a real HTTP client whose requests, including the HTTP Signature, are asserted in tests/test_adapters_http.py::test_cybersource_signature_and_requests against a mock transport answering with the documented shapes; the signature is checked against a known vector. The simulated run of this folder was checked on 8 September 2026. scripts/psp_smoke.py cybersource is the first live run.

Troubleshooting

Symptom or question What the code does What CyberSource's documentation says (read 8 September 2026)
The first smoke step fails on /ipl/v2/payment-links the hosted model is Pay by Link Pay by Link must be enabled at the portfolio level through a sales representative; a sandbox without it cannot stage the hosted checkout, and the smoke stops there with CyberSource's message
linkType rejected the adapter sends processingInformation.linkType: "PURCHASE" with purchaseInformation.purchaseNumber, orderInformation.amountDetails and lineItems, as the create-link page shows (https://developer.cybersource.com/docs/cybs/en-us/paybylink/developer/all/rest/paybylink/paybylink-services/paybylink-create-intro.html) Pay by Link has to be enabled on the account first, see above
The link URL is empty the adapter reads purchaseInformation.paymentLink, then paymentLink the documented response carries id, status: ACTIVE, and paymentLink
/up/v1/capture-contexts rejects targetOrigins the adapter sends the merchant API's own base URL, http://localhost:8019 in the demo targetOrigins must match the page origin and be https (https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-setup-capture-context.html); Unified Checkout also needs portfolio enablement
Signature errors v-c-merchant-id, Date, Host, Digest (POST), and Signature with keyid, algorithm="HmacSHA256", headers, and the base64 HMAC the same header set is documented on the getting-started page; check the secret is the base64 value as issued
gateway_mode: simulated with credentials set one of the three variables is empty all three are required

CyberSource's test cards are Visa 4111 1111 1111 1111, Mastercard 5555 5555 5555 4444, Amex 3782 8224 6310 005, with any future expiry and any CVV (https://developer.cybersource.com/hello-world/testing-guide.html). The adapter's first-test path sends 4111111111111111 as paymentInformation.card.

The endpoints the adapter calls

All calls go to https://apitest.cybersource.com with HTTP Signature authentication. The module docstring of psp_commerce/adapters/cybersource.py is the source.

Gateway method CyberSource call Status
create_checkout_session, create_payment_link POST /ipl/v2/payment-links tested against documented shape
get_checkout_session GET /ipl/v2/payment-links/{id}; a PAID or COMPLETED status records the order tested
create_payment_intent a local reference; the charge is POST /pts/v2/payments tested
authorize_payment POST /pts/v2/payments (tokenInformation.transientTokenJwt or paymentInformation.card, processingInformation.capture), then /captures tested
create_client_session POST /up/v1/capture-contexts (Unified Checkout) with targetOrigins, clientVersion, allowedCardNetworks, allowedPaymentTypes, captureMandate, orderInformation tested
complete_client_session the transient token, charged with POST /pts/v2/payments tested
authorize_delegated Google Pay: POST /pts/v2/payments with paymentInformation.fluidData and paymentSolution: "012"; Visa Intelligent Commerce: the credential as the transient token, marked agent-initiated tested
transactions POST /tss/v2/searches (Transaction Search) tested

Settlement and dispute reports at CyberSource are batch files under /reporting/v3/reports, so the adapter's ledger stands in for settlements and disputes here.