{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-js/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-walkthrough","admonition","step"]},"type":"markdown"},"seo":{"title":"Finix.ThreeDSecure | Finix JS Reference","description":"API reference for Finix.ThreeDSecure — raise a 3D Secure challenge inside your checkout and read the authentication result.","siteUrl":"https://docs.finix.com","llmstxt":{"hide":false,"sections":[{"title":"Getting Started","includeFiles":["guides/getting-started/**/*.md"],"excludeFiles":[]},{"title":"Online Payments","includeFiles":["guides/online-payments/**/*.md"],"excludeFiles":["guides/online-payments/payment-features/fsa-hsa-non-healthcare-mcc.md"]},{"title":"In-Person Payments","includeFiles":["guides/in-person-payments/**/*.md"],"excludeFiles":[]},{"title":"Subscriptions","includeFiles":["guides/subscriptions/**/*.md"],"excludeFiles":[]},{"title":"After the Payment","includeFiles":["guides/after-the-payment/**/*.md"],"excludeFiles":[]},{"title":"Managing Operations","includeFiles":["guides/managing-operations/**/*.md"],"excludeFiles":[]},{"title":"Platform Payments","includeFiles":["guides/platform-payments/**/*.md"],"excludeFiles":[]},{"title":"Payouts","includeFiles":["guides/payouts/**/*.md"],"excludeFiles":[]},{"title":"Low-Code / No-Code","includeFiles":["low-code-no-code/**/*.md"],"excludeFiles":[]},{"title":"Developers","includeFiles":["additional-resources/developers/**/*.md"],"excludeFiles":[]},{"title":"Plugins","includeFiles":["additional-resources/plugins/**/*.md"],"excludeFiles":[]},{"title":"Industry Considerations","includeFiles":["guides/industry-considerations/**/*.md"],"excludeFiles":[]},{"title":"Regional Considerations","includeFiles":["guides/regional-considerations/**/*.md"],"excludeFiles":[]},{"title":"Release Notes","includeFiles":["release-notes/**/*.md"],"excludeFiles":[]}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":1,"filters":{},"filesets":[{"files":[{"path":"js/_filesets/three-d-secure.js","content":[{"start":0,"condition":{"steps":["entry-points"]},"children":["// 1. Standalone class — you already have a session and control the timing","Finix.ThreeDSecure(\"sandbox\")","  .validate(threeDSecureSession)","  .on(\"succeeded\", ({ session }) => {","    // Submit the payment with session.id","  });","","// 2. Payment form option — Finix.js calls your endpoint and runs the challenge","Finix.PaymentForm(\"payment-form\", \"sandbox\", \"APgPDQrLD52TYvqazjHJJchM\", {","  ThreeDSecure: {","    createSession: async (token) => createSessionOnYourBackend(token),","  },","  onSubmit: function (error, response) { /* ... */ },","});"]},"",{"start":17,"condition":{"steps":["signature"]},"children":["// Returns a ThreeDSecure instance","const threeDS = Finix.ThreeDSecure(\"sandbox\");"]},"",{"start":22,"condition":{"steps":["param-environment"]},"children":["Finix.ThreeDSecure(\"qa\");      // QA","Finix.ThreeDSecure(\"sandbox\"); // Sandbox","Finix.ThreeDSecure(\"prod\");    // Production"]},"",{"start":28,"condition":{"steps":["validate"]},"children":["// Your backend creates the session and returns the response body untouched","const threeDSecureSession = await fetch(\"/your/backend/3d-secure-sessions\", {","  method: \"POST\",","  headers: { \"Content-Type\": \"application/json\" },","  body: JSON.stringify({ paymentInstrumentId: \"PI6iQcTtJNCS8GZAVKYi5Ueb\", amount: 1000, currency: \"USD\" }),","}).then((response) => response.json());","","const threeDS = Finix.ThreeDSecure(\"sandbox\");","","// Pass the whole session object, not just the id","threeDS.validate(threeDSecureSession);"]},"",{"start":42,"condition":{"steps":["on"]},"children":["const threeDS = Finix.ThreeDSecure(\"sandbox\");","threeDS.validate(threeDSecureSession);","","threeDS.on(\"initialized\", ({ session }) => {","  console.log(\"Challenge initialized for\", session.id);","});","","threeDS.on(\"succeeded\", ({ session }) => {","  // Submit the payment with session.id","});","","threeDS.on(\"failed\", ({ error }) => {","  console.error(error.code, error.reason);","});"]},"",{"start":59,"condition":{"steps":["statuses"]},"children":["Finix.ThreeDSecure(\"sandbox\").validate(threeDSecureSession, ({ session, status, error }) => {","  switch (status) {","    case \"initialized\":","      // The challenge component is initialized","      break;","    case \"succeeded\":","      // Authentication finished — submit the payment with session.id","      break;","    case \"failed\":","      // Authentication did not finish — read error.code","      console.error(error.code, error.reason);","      break;","  }","});"]},"",{"start":76,"condition":{"steps":["callback-payload"]},"children":["threeDS.on(\"failed\", ({ session, status, error }) => {","  // session - the 3D Secure Session passed to validate()","  // status  - \"initialized\" | \"succeeded\" | \"failed\"","  // error   - { code, reason }, present only when status is \"failed\"","  console.error(error.code, error.reason);","});"]},"",{"start":85,"condition":{"steps":["usage-patterns"]},"children":["// Separate calls","const threeDS = Finix.ThreeDSecure(\"sandbox\");","threeDS.validate(threeDSecureSession);","threeDS.on(\"succeeded\", ({ session }) => {","  // Submit the payment with session.id","});","","// Chained","Finix.ThreeDSecure(\"sandbox\")","  .validate(threeDSecureSession)","  .on(\"succeeded\", ({ session }) => {","    // Submit the payment with session.id","  });","","// Inline callback","Finix.ThreeDSecure(\"sandbox\").validate(threeDSecureSession, ({ session, status, error }) => {","  if (status === \"succeeded\") {","    // Submit the payment with session.id","  }","});"]},"",{"start":108,"condition":{"steps":["form-option"]},"children":["Finix.PaymentForm(\"payment-form\", \"sandbox\", \"APgPDQrLD52TYvqazjHJJchM\", {","  ThreeDSecure: {","    createSession: async (token) => createSessionOnYourBackend(token), // required","    onStatusChange: ({ session, status, error }) => {                  // optional","      console.log(\"3D Secure status:\", status);","    },","  },","  onSubmit: function (error, response) { /* ... */ },","});"]},"",{"start":120,"condition":{"steps":["create-session"]},"children":["Finix.PaymentForm(\"payment-form\", \"sandbox\", \"APgPDQrLD52TYvqazjHJJchM\", {","  ThreeDSecure: {","    // Finix.js calls this once the card is tokenized.","    // Resolve with the response body from POST /3d_secure_sessions.","    createSession: async (token) => {","      const response = await fetch(\"/your/backend/3d-secure-sessions\", {","        method: \"POST\",","        headers: { \"Content-Type\": \"application/json\" },","        body: JSON.stringify({ token: token, amount: 1000, currency: \"USD\" }),","      });","      return response.json();","    },","  },","  onSubmit: function (error, response) { /* ... */ },","});"]},"",{"start":138,"condition":{"steps":["on-status-change"]},"children":["Finix.PaymentForm(\"payment-form\", \"sandbox\", \"APgPDQrLD52TYvqazjHJJchM\", {","  ThreeDSecure: {","    createSession: async (token) => createSessionOnYourBackend(token),","    onStatusChange: ({ session, status, error }) => {","      // Optional — use it for your own analytics or messaging","      analytics.track(\"3ds_status\", { status: status });","","      if (status === \"failed\") {","        showMessage(error.reason);","      }","    },","  },","  onSubmit: function (error, response) { /* ... */ },","});"]},"",{"start":155,"condition":{"steps":["custom-button"]},"children":["const form = Finix.PaymentForm(\"payment-form\", \"sandbox\", \"APgPDQrLD52TYvqazjHJJchM\", {","  paymentMethods: [\"card\"],","  ThreeDSecure: {","    createSession: async (token) => createSessionOnYourBackend(token),","  },","});","","document.getElementById(\"pay-btn\").addEventListener(\"click\", function () {","  form.submit(function (error, response) {","    if (error) {","      console.error(\"Tokenization failed:\", error);","      return;","    }","    const { data, threeDSecure } = response;","    if (threeDSecure.status === \"succeeded\") {","      // Charge data.id and reference threeDSecure.session.id","    }","  });","});"]},"",{"start":177,"condition":{"steps":["submit-response"]},"children":["Finix.PaymentForm(\"payment-form\", \"sandbox\", \"APgPDQrLD52TYvqazjHJJchM\", {","  paymentMethods: [\"card\"],","  ThreeDSecure: {","    createSession: async (token) => createSessionOnYourBackend(token),","  },","  onSubmit: function (error, response) {","    if (error) {","      console.error(\"Tokenization failed:\", error);","      return;","    }","","    const tokenData = response.data || {};","    const threeDSecure = response.threeDSecure || {};","","    // threeDSecure.session.state still reads \"PENDING\" here, even on success.","    // Branch on threeDSecure.status instead.","    if (threeDSecure.status === \"succeeded\") {","      fetch(\"/your/backend\", {","        method: \"POST\",","        headers: { \"Content-Type\": \"application/json\" },","        body: JSON.stringify({","          token: tokenData.id,","          threeDSecureSessionId: threeDSecure.session.id,","        }),","      });","    }","  },","});"]},"",{"start":208,"condition":{"steps":["error-code-values"]},"children":["threeDS.on(\"failed\", ({ error }) => {","  switch (error.code) {","    case \"USER_CANCELLED\":","      // The buyer closed the overlay — offer to try again","      break;","    case \"CHALLENGE_TIMEOUT\":","    case \"CHALLENGE_LOAD_FAILED\":","      // Retryable — create a new session and call validate() again","      break;","    case \"CARD_NOT_ENROLLED\":","    case \"CHALLENGE_FAILED\":","      // This card will not authenticate — charging anyway is your policy call","      break;","    default:","      console.error(error.code, error.reason);","  }","});"]},"",{"start":228,"condition":{"steps":["session-object"]},"children":["// The object your backend returns from POST /3d_secure_sessions,","// and the object Finix.js hands back as `session`:","// {","//   \"id\": \"3d_secure_session_f3fG3Zj8K958MTP5vpXAXX\",","//   \"created_at\": \"2026-08-13T16:37:59.211335Z\",","//   \"updated_at\": \"2026-08-13T16:37:59.469140Z\",","//   \"3d_secure_authentication\": null,","//   \"3d_secure_authentication_session_id\": \"tds_visa_0367b8b7ebd8\",","//   \"3d_secure_authentication_url\": null,","//   \"3d_secure_version\": null,","//   \"amount\": 1000,","//   \"currency\": \"USD\",","//   \"authentication_type\": null,","//   \"failure_code\": null,","//   \"failure_message\": null,","//   \"merchant_id\": \"MUmUNeW5N9Yw8RkLhLcGghy4\",","//   \"payment_instrument_id\": null,","//   \"redirect_url\": null,","//   \"state\": \"PENDING\",","//   \"tags\": {}","// }"]},""],"metadata":{"steps":["entry-points","signature","param-environment","validate","on","statuses","callback-payload","usage-patterns","form-option","create-session","on-status-change","custom-button","submit-response","error-code-values","session-object"]},"basename":"three-d-secure.js","language":"javascript"}],"downloadAssociatedFiles":[]}],"steps":[{"id":"entry-points","heading":"Two entry points"},{"id":"statuses","heading":"Statuses"},{"id":"callback-payload","heading":"Callback payload"},{"id":"signature","heading":"Function signature"},{"id":"param-environment","heading":"environment"},{"id":"validate","heading":"validate()"},{"id":"on","heading":"on()"},{"id":"usage-patterns","heading":"Usage patterns"},{"id":"form-option","heading":"ThreeDSecure"},{"id":"create-session","heading":"createSession"},{"id":"on-status-change","heading":"onStatusChange"},{"id":"custom-button","heading":"Custom submit buttons"},{"id":"submit-response","heading":"threeDSecure"},{"id":"error-code-values","heading":"error.code values"},{"id":"session-object","heading":"Session shape"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"finixthreedsecure","__idx":0},"children":["Finix.ThreeDSecure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Raises a 3D Secure (3DS) challenge inside your checkout page and reports the outcome to your front end."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Finix.js wraps the 3DS vendor SDK end to end. You don't install a vendor package, you don't allowlist a vendor script in your Content Security Policy, and the buyer never sees a vendor URL. The challenge renders in a full-screen transparent iframe that Finix.js creates and removes, so the buyer stays on your checkout page the whole time."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the protocol, session states, and liability shift, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/online-payments/fraud-and-risk/3d-secure"},"children":["3D Secure"]},". For a walkthrough of a complete checkout, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/online-payments/fraud-and-risk/3d-secure/finix-js"},"children":["3D Secure using Finix.js"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"creating-the-session","__idx":1},"children":["Creating the session"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every challenge runs against a 3D Secure Session, and your server creates it by calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /3d_secure_sessions"]},". Finix.js consumes the session you hand it. It never creates one."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Keep credentials and trusted values on your server"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create the session through an authenticated backend endpoint; never expose Finix API credentials in browser code. Derive and validate trusted values such as the merchant and amount on the server, and rate-limit the endpoint to prevent abuse."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"choosing-an-entry-point","__idx":2},"children":["Choosing an entry point"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"entry-points","heading":"Two entry points"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Entry point"},"children":["Entry point"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Use this when"},"children":["Use this when"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Finix.ThreeDSecure()"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The card is already on file, or you're PCI compliant and collect card details yourself. You decide when the challenge runs."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ThreeDSecure"]}," form option"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["You already tokenize with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/js/payment-form"},"children":["Finix.PaymentForm()"]},". Finix.js calls your session endpoint, raises the challenge, retries, and manages the submit button for you."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The form option is the shorter integration of the two. Reach for the class when you aren't using the payment form."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"statuses-and-callbacks","__idx":3},"children":["Statuses and callbacks"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"statuses","heading":"Statuses"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both entry points report the same three statuses."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":["Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initialized"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Finix.js has initialized the challenge component"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["succeeded"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authentication finished. Submit the payment and reference the session ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authentication did not finish. Read ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.code"]}," for the cause"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"callback-payload","heading":"Callback payload"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every 3DS callback receives one object."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Property"},"children":["Property"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object | null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The 3D Secure Session. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," only on the payment form path, when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createSession"]}," fails or returns an unusable session"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initialized"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["succeeded"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failed"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Present only when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failed"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," object has two properties:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}," - A Finix.js error code. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#error-codes"},"children":["Error codes"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reason"]}," - A human-readable description of the failure, suitable for logging."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These codes are produced by Finix.js and the 3DS vendor. They are a separate enum from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failure_code"]}," field on the 3D Secure Session itself, so don't map one onto the other."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-threedsecure-class","__idx":4},"children":["The ThreeDSecure class"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"signature","heading":"Function signature"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Finix.ThreeDSecure(environment)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["environment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Finix environment (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sandbox"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["prod"]},")"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ThreeDSecure"]}," instance. Both of its methods return that same instance, so calls chain."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"param-environment","heading":"environment"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Selects the environment to authenticate against, and the vendor credentials Finix.js uses internally."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"sandbox\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sandbox"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"prod\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Production"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These are the same environment strings the rest of Finix.js accepts. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sandbox"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://finix.sandbox-payments-api.com"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["prod"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://finix.payments-api.com"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"validate","heading":"validate()"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Raises the challenge for a session."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"threeDS.validate(threeDSecureSession, callback)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecureSession"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The entire response body from your server's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /3d_secure_sessions"]}," call"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["callback"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["function({ session, status, error })"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Inline form of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["on()"]},". Runs on every status change"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass the response object through whole rather than picking fields out of it. Returns the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ThreeDSecure"]}," instance."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"on","heading":"on()"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Registers a listener for one status."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"threeDS.on(status, callback)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status to listen for: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initialized"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["succeeded"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failed"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["callback"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["function({ session, status, error })"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Runs when the challenge reaches that status"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["on()"]}," once for each status you want to handle. Returns the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ThreeDSecure"]}," instance."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"usage-patterns","heading":"Usage patterns"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The class supports three equivalent styles. Use whichever fits your checkout code."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Separate calls"]}," - Hold the instance in a variable, then call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["validate()"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["on()"]}," against it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Chained"]}," - Chain ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["on()"]}," onto the return value of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["validate()"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inline callback"]}," - Pass a single callback to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["validate()"]}," and branch on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},"."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-threedsecure-form-option","__idx":5},"children":["The ThreeDSecure form option"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"form-option","heading":"ThreeDSecure"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An optional object in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/js/options"},"children":["options"]}," you pass to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Finix.PaymentForm()"]},". Providing it turns on 3D Secure for the form: Finix.js tokenizes the card, calls your session endpoint, raises the challenge, and reports both results to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Property"},"children":["Property"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createSession"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["async function(token)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls your backend and resolves with a 3D Secure Session"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onStatusChange"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["function({ session, status, error })"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Runs on every status change"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"create-session","heading":"createSession"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A hook to your own session endpoint. Finix.js calls it once the card is tokenized, and expects it to resolve with the response body from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /3d_secure_sessions"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"createSession: async (token) => ThreeDSecureSession\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," - The token Finix.js created for the card details in the form."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handing the call to Finix.js is what makes this path shorter than the class. Because Finix.js owns the timing, it calls your endpoint at the right moment, asks for a fresh session when a buyer cancels or a challenge fails, and disables and re-enables the submit button around the challenge. None of that is automatic when you drive the class yourself."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createSession"]}," throws, rejects, or times out, the form reports ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SESSION_API_FAILED"]},". If it resolves with something unusable, the form reports ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SESSION_API_MALFORMED"]},". In both cases ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"on-status-change","heading":"onStatusChange"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optional. Finix.js raises the challenge, retries, and manages the button without it, so use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onStatusChange"]}," for your own analytics or buyer-facing messaging."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"onStatusChange: ({ session, status, error }) => void\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It receives the same payload as the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["on()"]}," callbacks. The same callback is also documented on the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/js/callbacks"},"children":["Callbacks"]}," page alongside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onLoad"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUpdate"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"custom-button","heading":"Custom submit buttons"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The option works with the submit button the form renders and with your own button calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["form.submit()"]},". Finix.js manages the enabled state of the form's own button. With a custom button, keep using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUpdate"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasErrors"]}," as you do today. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/js/form-instance"},"children":["Form Instance"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"submit-response","__idx":6},"children":["Submit response"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"submit-response","heading":"threeDSecure"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ThreeDSecure"]}," option is set, the response passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]}," carries a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecure"]}," key alongside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Key"},"children":["Key"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The token. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/js/token-response"},"children":["Token Response"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecure"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The authentication result: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ session, status, error }"]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Read status, not session.state"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecure.session.state"]}," still reads ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING"]}," when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["succeeded"]},". The API state only advances once Finix processes the authentication result from the vendor, which happens after your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]}," runs. Decide whether to charge from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecure.status"]},", then submit the payment referencing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecure.session.id"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-codes","__idx":7},"children":["Error codes"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"error-code-values","heading":"error.code values"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Code"},"children":["Code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CARD_NOT_ENROLLED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session came back ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILED"]},". The card can't be authenticated. This isn't a decline, so whether you charge it anyway is a policy decision"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHALLENGE_FAILED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The issuer declined the authentication. No further detail is available"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USER_CANCELLED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The buyer closed the overlay"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MERCHANT_CANCELLED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The challenge was cancelled programmatically"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHALLENGE_TIMEOUT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The challenge page didn't load within 20 seconds. Retryable"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHALLENGE_LOAD_FAILED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The challenge component couldn't be initialized. Retryable"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SESSION_API_FAILED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createSession"]}," threw or timed out. Payment form only, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SESSION_API_MALFORMED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createSession"]}," returned an unusable session. Payment form only, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An unclassified vendor failure. The vendor's own message is logged to the browser console"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Retrying ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHALLENGE_TIMEOUT"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHALLENGE_LOAD_FAILED"]}," means creating a new session first. Sessions expire five minutes after they're created, and each one covers a single payment. On the payment form path, Finix.js calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createSession"]}," again for you."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3d-secure-session-object","__idx":8},"children":["3D Secure Session object"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"session-object","heading":"Session shape"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," property in every callback is the object your backend returned from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /3d_secure_sessions"]},", unchanged."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"3d_secure_session_f3fG3Zj8K958MTP5vpXAXX\",\n  \"created_at\": \"2026-08-13T16:37:59.211335Z\",\n  \"updated_at\": \"2026-08-13T16:37:59.469140Z\",\n  \"3d_secure_authentication\": null,\n  \"3d_secure_authentication_session_id\": \"tds_visa_0367b8b7ebd8\",\n  \"3d_secure_authentication_url\": null,\n  \"3d_secure_version\": null,\n  \"amount\": 1000,\n  \"currency\": \"USD\",\n  \"authentication_type\": null,\n  \"failure_code\": null,\n  \"failure_message\": null,\n  \"merchant_id\": \"MUmUNeW5N9Yw8RkLhLcGghy4\",\n  \"payment_instrument_id\": null,\n  \"redirect_url\": null,\n  \"state\": \"PENDING\",\n  \"tags\": {}\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Finix.js uses camelCase for its own options and callbacks, but this object comes straight from the Finix API and keeps its snake_case field names. That mix is expected."]}]}]}]},"headings":[{"value":"Finix.ThreeDSecure","id":"finixthreedsecure","depth":1},{"value":"Creating the session","id":"creating-the-session","depth":2},{"value":"Choosing an entry point","id":"choosing-an-entry-point","depth":2},{"value":"Statuses and callbacks","id":"statuses-and-callbacks","depth":2},{"value":"The ThreeDSecure class","id":"the-threedsecure-class","depth":2},{"value":"The ThreeDSecure form option","id":"the-threedsecure-form-option","depth":2},{"value":"Submit response","id":"submit-response","depth":2},{"value":"Error codes","id":"error-codes","depth":2},{"value":"3D Secure Session object","id":"3d-secure-session-object","depth":2}],"frontmatter":{"seo":{"title":"Finix.ThreeDSecure | Finix JS Reference","description":"API reference for Finix.ThreeDSecure — raise a 3D Secure challenge inside your checkout and read the authentication result."},"markdown":{"toc":{"hide":true}},"footer":{"hide":true}},"lastModified":"2026-10-07T18:56:56.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/js/three-d-secure","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}