Theme switcher

Configuração de Cobrança

Esse endpoint cria a configuração uma cobrança no cartão de crédito.

Após a resposta desse endpoint, deve iniciar a coleta do 3ds, enviando 3ds.token e 3ds.collectUrl, seguindo o exemplo abaixo:

JavaScript
<div style="display: none"> <iframe id="collection_iframe" name="collectionIframe" height="1" width="1" ></iframe> <form id="collectionForm" method="POST" target="collectionIframe"> <input id="collectionInput" type="hidden" name="JWT" value="" /> </form> </div>; function start3DSDataCollection(token3DS, collectUrl) { return new Promise((resolve, reject) => { const form = document.getElementById("collectionForm"); const input = document.getElementById("collectionInput"); // Define destino e token form.action = collectUrl; input.value = token3DS; // Envia o formulário para o iframe oculto form.submit(); const expectedOrigin = new URL(collectUrl).origin; // Função para escutar mensagens vindas do iframe function handler(event) { if (event.origin === expectedOrigin) { console.log("Coleta 3DS2 finalizada", event.data); window.removeEventListener("message", handler); resolve(event.data); } } // Adiciona o listener window.addEventListener("message", handler); // Timeout de 30 segundos setTimeout(() => { window.removeEventListener("message", handler); reject(new Error("Timeout")); }, 30000); }); } }

Exemplo Resposta - Endpoint

{ "3ds": { "id": "b3144...", "token": "eyJhb...", "collectUrl": "https://centinelapi.cardinalcommerce.com/V1/Cruise/Collect", "providerType": "CYBERSOURCE", "error": null }, "card": { "cardId": "56953...", "cvv": "123", "customerId": 123 } }

Header Parameters

Authorizationstring Required

Colocar no formato Bearer TOKEN

Acceptstring Required

application/json

Content-Typestring Required

application/json

Body Parameters

customerIdnumber
customerobject Required

Show child attributes

cardobject Required

Show child attributes

Response

200
Object
{ "3ds": { "id": "b3144...", "token": "eyJhb...", "collectUrl": "https://centinelapi.cardinalcommerce.com/V1/Cruise/Collect", "providerType": "CYBERSOURCE", "error": null }, "card": { "cardId": "56953...", "cvv": "123", "customerId": 123 } }
400
Object
Bad Request -- Composição do request inválido
401
Object
Unauthorized -- Chave TOKEN inválida
403
Object
Forbidden -- Apenas administradores
404
Object
Not Found -- Pedido não existe
405
Object
Method Not Allowed -- Método não permitido
406
Object
Not Acceptable -- Formato JSON inválido
410
Object
Gone -- Essa requisição não existe mais
418
Object
I'm a teapot.
429
Object
Too Many Requests -- Muitas requisições em um curto espaço de tempo
500
Object
Internal Server Error -- Favor tente mais tarde
503
Object
Service Unavailable -- Estamos temporariamente inativos, favor aguardar.
Was this section helpful?

What made this section unhelpful for you?

Base URL

Production:

Sandbox:

Language Box

POST

/

Select
1

Response

Was this section helpful?

What made this section unhelpful for you?