Skip to content

How a payment works

This page explains what happens between the moment you render the checkout and the moment you receive the webhooks.

Your server Browser (SDK iframe) CreditCore API Gateway
│ │ │ │
│ POST /api/session ───────────────────────────────────▶│ │
│◀──────────────────────────────── sessionId (5 min) ───│ │
│── render page ────────▶│ │ │
│ │ submit payment (encrypted card) │
│ │─────────────────────────────▶│ validate card ───────────▶│
│ │ │ charge / pre-auth ───────▶│
│ │◀──────────── { code: "OK" } ─│ │
│◀───────────────────────────────── webhooks (async) ───│ │
  1. Session. Your backend creates a session for the domain that will show the checkout. The session is valid for 5 minutes.

  2. Checkout. The SDK loads a secure card form in an iframe. When the buyer clicks Pay, the card number and CVC are encrypted in the browser and sent to CreditCore together with the email, name, productId, sessionId and any additionalData you configured.

  3. Session & product checks. CreditCore verifies that the session exists, has not expired and matches the domain, and that the product exists and is active for your account.

  4. Merchant account selection. CreditCore picks a merchant account (MID) from the product’s merchant-account group that accepts the card type.

  5. Card validation. The card is validated with the gateway (a zero-amount verification). If validation fails, the checkout returns CREDITCARD_VALIDATION and nothing is charged. Blocked BINs return BIN_BLACKLIST.

  6. Duplicate check. For subscription products that don’t allow multiple subscriptions, if the same email + card already has a subscription to the product that isn’t cancelled, the checkout returns ALREADY_SUBSCRIBED. A cancelled one is reactivated.

  7. Charge. Depending on the product type, CreditCore charges the card, places a pre-authorization, or schedules the first charge for later.

  8. Response and webhooks. The SDK receives { "code": "OK", "customerId": "…", "transactionStatus": … }. CreditCore then sends a TRANSACTION webhook (if a charge was attempted) and, for subscription products, a CONVERSION webhook.

Field Type Description
sessionId string The session used.
code string OK, or an error code.
message string Human-readable result.
customerId string ID of the customer (the buyer). The same email in your account always maps to the same customer.
transactionStatus integer Transaction type code of the subscription’s first transaction: 101 (SUBSCRIPTION_START) or 110 (PREAUTHORIZED). 0 for one-time products, for delayed charges, and when no pre-authorization was approved. It doesn’t tell whether a SUBSCRIPTION_START charge was approved: use the TRANSACTION webhook for that.

The session is bound to the domain you passed to POST /api/session. At checkout, CreditCore compares it with the domain option you pass to the SDK (sent as landingDomain). If they don’t match, the checkout fails.

  • Use the host name only: shop.example.com, not https://shop.example.com/checkout.
  • Always pass the same value in both places.
Step Typical time
Session lifetime 5 minutes
Checkout response 1–3 seconds
Webhook delivery Seconds after the response (asynchronous)
Renewals Processed every hour for customers due in that hour