Comunidade

Ask a Question
Back to All

Pagamento recorrente sempre retorna "atrasado" ao criar assinatura

Sempre ao criar uma assinatura tudo ocorre bem porém sempre retorna com o status "atrasado" -> REQ:

const options = {
method: 'POST',
url: 'https://sandbox.api.assinaturas.pagseguro.com/subscriptions',
headers: {
accept: 'application/json',
Authorization: 'MEUTOKEN',
'content-type': 'application/json'
},
data: {
plan: {id: 'PLAN
...'},
customer: {
id: 'CUST_...',
billing_info: [
{
card: {
encrypted: 'g4KunK641+VHGg9wsIotcAftZTA7vJ7cAMi16PLyn0T/A8X/b1L/ttwtdyuL1Mfg1HoLYudC4xLFrVenn0LC8cDX9L9g0d4b0v+GRCdiUOAefegJawCw5YyWiaSMe5sV1DEw8gXAUl+afftgZ+oa1be/Lw6TIYFoJLQ4Fjp6WFYHKQUzY2so/bAGqwbvZRmlrFJcgsutRGdMuQEIVnhnin2IeBeH3Yli5aC8Xfjzvec+NrG12tMEmH3YUIhvoTgLw0SC8oIUViSrs1TSoatxDNSPMtVDvSkWSJmScKJptghFJ9UfOlTbkIDXoqVbjRyyBZhP1s7eVwtPCnnigFsf1Q=='
},
type: 'CREDIT_CARD'
}
]
},
reference_id: '1',
payment_method: [{type: 'CREDIT_CARD', card: {security_code: 123}}]
}
};

axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));

Resposta: {
"id": "SUBS...",
"reference_id": "1",
"amount": {
"value": 7000,
"currency": "BRL"
},
"status": "OVERDUE",
"plan": {
"id": "PLAN
...",
"name": "Plano start",
"interval": {
"length": 1,
"unit": "MONTH"
}
},
"payment_method": [
{
"type": "CREDIT_CARD",
"card": {
"token": "CARD_2042****3714",
"brand": "mastercard",
"first_digits": "524008",
"last_digits": "2454",
"exp_month": "12",
"exp_year": "2026",
"holder": {
"name": "Lucas ..."
}
}
}
],
"next_invoice_at": "2025-03-02",
"billing_cycle": {
"occurrence": 1
},
"pro_rata": false,
"customer": {
"id": "CUST_7...",
"name": "Lucas ...",
"email": "iiaiiiko@minhduc.shop"
},
"created_at": "2025-02-02T09:18:02.635-03:00",
"updated_at": "2025-02-02T09:18:04.043-03:00",
"retries": [
{
"attempt": "FIRST",
"retried_at": "2025-02-03",
"status": "SCHEDULED"
}
],
"split_enabled": false,...

© 1996- Todos os direitos reservados.

PAGSEGURO INTERNET INSTITUIÇÃO DE PAGAMENTO S/A - CNPJ/MF 08.561.701/0001-01

Av. Brigadeiro Faria Lima, 1.384, São Paulo - SP - CEP 01451-001