Skip to content

Adyen 3DS fails on deploy-preview origins due to Chargebee treating “Origin already exists” as fatal error #180

@julianCast

Description

@julianCast

When using Chargebee JS with Adyen + Client Key + 3DS, payments fail on dynamic origins (e.g. Netlify deploy-preview URLs). The failure happens inside Chargebee’s internal call to fetch gateway credentials and appears to be caused by Chargebee treating Adyen’s “Origin already exists” response as a fatal error.

Using: https://js.chargebee.com/v2/chargebee.js

GET /api/internal/payment_intents/fetch_gateway_public_credential?origin=<window.location.origin>

Inside this call, Chargebee attempts to ensure the origin is registered in Adyen by calling the Adyen Management API:

POST /v3/me/allowedOrigins

If the origin already exists, Adyen responds with:

{
  "type": "https://docs.adyen.com/errors/validation",
  "title": "Invalid allowed origin information provided.",
  "status": 422,
  "requestId": "1f1fd450-1d13-efcc-b538-977c22ecbc7c_0-B63BFJ849FZ28332",
  "invalidFields": [
    {
      "name": "domain",
      "value": "https://deploy-preview-6082--site.netlify.app",
      "message": "Origin already exists"
    }
  ],
  "errorCode": "31_004"
}
Image

Then we get a 500

Image

Breaking changes Adyen v1 to v3 (in case is related)

Image

Note: Not happening on production or localhost.

This leaves the PaymentIntent stuck in inited and causes authorizeWith3ds to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions