For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connector Token

Used when card details are collected by the processor's JS SDK (e.g. Stripe.js, Adyen Drop-in). Raw card data never reaches your server — the processor returns an opaque token that Prism accepts directly.

There are two ways to use a token depending on your flow:


Non-PCI: tokenize then authorize

When: Token was just collected from the processor's JS SDK in the browser right now.

Step 1 — Collect and tokenize in the browser using the processor's JS SDK (e.g. Stripe.js, Adyen Drop-in). Card details are entered and tokenized entirely client-side — they never reach your server or Prism. The SDK returns an opaque token (e.g. pm_xxx).

Step 2 — Authorize using tokenAuthorize. Pass the token in connectorToken:

const paymentClient = new PaymentClient(config);

const response = await paymentClient.tokenAuthorize({
    merchantTransactionId: "txn_001",
    amount: { minorAmount: 1000, currency: Currency.USD },
    connectorToken: { value: "pm_1AbcXyzStripeTestToken" },
    address: { billingAddress: {} },
    captureMethod: CaptureMethod.AUTOMATIC,
    returnUrl: "https://example.com/return",
});
from payments import (
    PaymentServiceTokenAuthorizeRequest, Money, Currency, CaptureMethod,
    PaymentAddress, Address, SecretString,
)

response = await payment_client.token_authorize(
    PaymentServiceTokenAuthorizeRequest(
        merchant_transaction_id="txn_001",
        amount=Money(minor_amount=1000, currency=Currency.USD),
        connector_token=SecretString(value="pm_1AbcXyzStripeTestToken"),
        address=PaymentAddress(billing_address=Address()),
        capture_method=CaptureMethod.AUTOMATIC,
        return_url="https://example.com/return",
    )
)

See First Payment — non-PCI flow for the full end-to-end example including the browser-side tokenize step.


Direct authorize with a token

When: You already hold a token from a previous tokenize call and want to charge it via the standard authorize flow. Pass it in paymentMethod.token:

Last updated

Was this helpful?