cURL
curl --request POST \
--url https://api.malga.io/v1/charges/3ds/setup \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"sourceType": "card",
"cardId": "cc0b1e41-2936-45c5-947f-93995ffcdc00"
}
'const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sourceType: 'card', cardId: 'cc0b1e41-2936-45c5-947f-93995ffcdc00'})
};
fetch('https://api.malga.io/v1/charges/3ds/setup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/charges/3ds/setup"
payload := strings.NewReader("{\n \"sourceType\": \"card\",\n \"cardId\": \"cc0b1e41-2936-45c5-947f-93995ffcdc00\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "1b04367a-2386-4161-8c90-eac82267ee89",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0MzljZGU0NC05M2RkLTQ2ZWEtYWU0OC0zNTMwMzg3NGFjMmQiLCJpYXQiOjE3Mjc3MTU5NDksImlzcyI6IjVkZDgzYmYwMGU0MjNkMTQ5OGRjYmFjYSIsImV4cCI6MTcyNzcxOTU0OSwiT3JnVW5pdElkIjoiNjU0NDUzNzkzZDJmNTM1NWE3YjljN2IxIiwiUmVmZXJlbmNlSWQiOiJhNjNhZTI0NS0zNzJkLTQ1ODktODVlYS1iMDBmM2VmNjA0NGYifQ.o4IKYrNnFbr3xn-qSm_9qL-Sn-WvCpKOUMxZna7SiYE",
"collectUrl": "https://centinelapistag.cardinalcommerce.com/V1/Cruise/Collect",
"providerType": "CYBERSOURCE"
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}3DS2 Malga
Criar um novo setup
Crie uma nova sessão de setup para autenticação 3DS2 Malga, iniciando o fluxo de autenticação do portador antes da cobrança no cartão de crédito.
POST
/
v1
/
charges
/
3ds
/
setup
cURL
curl --request POST \
--url https://api.malga.io/v1/charges/3ds/setup \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"sourceType": "card",
"cardId": "cc0b1e41-2936-45c5-947f-93995ffcdc00"
}
'const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sourceType: 'card', cardId: 'cc0b1e41-2936-45c5-947f-93995ffcdc00'})
};
fetch('https://api.malga.io/v1/charges/3ds/setup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/charges/3ds/setup"
payload := strings.NewReader("{\n \"sourceType\": \"card\",\n \"cardId\": \"cc0b1e41-2936-45c5-947f-93995ffcdc00\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "1b04367a-2386-4161-8c90-eac82267ee89",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0MzljZGU0NC05M2RkLTQ2ZWEtYWU0OC0zNTMwMzg3NGFjMmQiLCJpYXQiOjE3Mjc3MTU5NDksImlzcyI6IjVkZDgzYmYwMGU0MjNkMTQ5OGRjYmFjYSIsImV4cCI6MTcyNzcxOTU0OSwiT3JnVW5pdElkIjoiNjU0NDUzNzkzZDJmNTM1NWE3YjljN2IxIiwiUmVmZXJlbmNlSWQiOiJhNjNhZTI0NS0zNzJkLTQ1ODktODVlYS1iMDBmM2VmNjA0NGYifQ.o4IKYrNnFbr3xn-qSm_9qL-Sn-WvCpKOUMxZna7SiYE",
"collectUrl": "https://centinelapistag.cardinalcommerce.com/V1/Cruise/Collect",
"providerType": "CYBERSOURCE"
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Body
application/json
Criar sessão no 3DS2 Malga
Response
Created
Was this page helpful?
⌘I