These docs are for v1.0. Click to read the latest docs for v4.1.

Comunidade

Ask a Question
Back to All

Erro de charges[0].payment_method.card.encrypted. Já olhei outras respostas por aqui.

Não sei mais o que alterar. O envio só retorna:

{
"error_messages": [
{
"code": "40002",
"description": "invalid_parameter",
"parameter_name": "charges[0].payment_method.card.encrypted"
}
]
}


Ex: dados usados na criptografia do cartão. Já testei com outros cartões disponibilizados na documentação

                   publicKey:
                                      'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr+ZqgD892U9/HXsa7XqBZUayPquAfh9xx4iwUbTSUAvTlmiXFQNTp0Bvt/5vK2FhMj39qSv1zi2OuBjvW38q1E374nzx6NNBL5JosV0+SDINTlCG0cmigHuBOyWzYmjgca+mtQu4WczCaApNaSuVqgb8u7Bd9GCOL4YJotvV5+81frlSwQXralhwRzGhj/A57CGPgGKiuPT+AOGmykIGEZsSD9RKkyoKIoc0OS8CPIzdBOtTQCIwrLn2FxI83Clcg55W8gkFSOS6rWNbG5qFZWMll6yl02HtunalHmUlRUL66YeGXdMDC2PuRcmZbGO5a/2tbVppW6mfSWG3NPRpgwIDAQAB',
                                  holder: 'Nome Sobrenome',
                                  number: '4242424242424242',
                                  expMonth: '12',
                                  expYear: '2030',
                                  securityCode: '123',

Envio para a API:

{
"customer":{
"name":"Jose da Silva",
"email":"[email protected]",
"tax_id":"10657277479",
"phones":[
{
"country":55,
"area":11,
"number":23455665,
"type":"MOBILE"
}
]
},
"shipping":{
"address":{
"street":"rua teste",
"number":"123",
"complement":"apt 12",
"locality":"pinheiros",
"city":"são paulo",
"region_code":"SP",
"country":"BRA",
"postal_code":"01231123"
}
},
"charges":[
{
"amount":{
"value":1000,
"currency":"BRL"
},
"payment_method":{
"card":{
"holder":{
"name":"teste"
},
"store":false,
"encrypted":"HXcjNEhNIn863LDkOBqEyHG2KrsTwdDxfUd6Fc/MQ0e5hbzKrCOg7gN0uwUBPoqvJU+LQajeZ+lANEPcx5un5Bw/BzKKK0JhLvjxSoo79rwkyxvLILT2SYtOJYuRYU/9RDpW9+s9NEaB5PkLb4IvvA2mScq/KDiOgi7kWUqY1b8IbpUDjq6wc/SoXb3PMTFyXQQbRwkdcpwlzLQt1zPtXGgPXuCMHhXoeaBYSS4V+1X+JaRUSOjl6N313bjk4tKvnfWqOSW1dzPdHaN0pt9LR9H2omCCU5ARKdc8fB/Pt8NoY8oGccIKDCIkcZPufsxwrCgV1cjSUFq6jDSJI7dhPw=="
},
"type":"CREDIT_CARD",
"installments":1,
"capture":true
}
}
],
"reference_id":"ex-00001",
"items":[
{
"name":"venda",
"quantity":1,
"unit_amount":1000
}
]
}

© 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