Histórico de mensagens em pagamento-contas

EXIBINDO CONVERSAS RECENTES:

Data: 15/06/2024
Canal: pagamento-contas
Avatar discord do usuario adenilson2703

adenilson2703

estou usando cod teste padrao

Avatar discord do usuario adenilson2703

adenilson2703

Ver Respostas

exports.paymentToken = async (req, res, next) => {
EfiJs.CreditCard.debugger(true);
try {
const result = await EfiJs.CreditCard
.setAccount('')
.setEnvironment('sandbox') // 'production' or 'sandbox'
.setCreditCardData({
brand: 'visa',
number: '4485785674290087',
cvv: '123',
expirationMonth: '05',
expirationYear: '2029',
reuse: false
}) .getPaymentToken();
console.log('result', result);
const payment_token = result.payment_token;
const card_mask = result.card_mask;
console.log('payment_token', payment_token);
console.log('card_mask', card_mask);
return res.send({
request: true,
success: true,
message: 'Pagamento cartão!',
payment_token:payment_token,
card_mask:card_mask
});

} catch (error) {
console.log('Código: ', error.code);
console.log('Nome: ', error.error);
console.log('Mensagem: ', error.error_description);
return res.send({
request: true,
success: false,
message: 'Pagamento cartão!',

});
}
1

Avatar discord do usuario adenilson2703

adenilson2703

boa tarde! estou recebebdo erro no getPaymentToken node.js 14|CLINIC | Debugger: true
14|CLINIC | Lib version: 2.1.0
14|CLINIC | Environment production
14|CLINIC | Error_getPaymentToken ReferenceError: fetch is not defined
14|CLINIC | at Function.getSalt (/home/tecno/clinic_manager/api_server/node_modules/payment-token-efi/distNode/payment-token-efi.js:1:64474)
14|CLINIC | at Function.getPaymentToken (/home/tecno/clinic_manager/api_server/node_modules/payment-token-efi/distNode/payment-token-efi.js:1:70685)
14|CLINIC | at exports.paymentToken (/home/tecno/clinic_manager/api_server/controllers/app-products/order-controller.js:459:14)
14|CLINIC | at Layer.handle [as handle_request] (/home/tecno/clinic_manager/api_server/node_modules/express/lib/router/layer.js:95:5)
14|CLINIC | at next (/home/tecno/clinic_manager/api_server/node_modules/express/lib/router/route.js:149:13)
14|CLINIC | at Route.dispatch (/home/tecno/clinic_manager/api_server/node_modules/express/lib/router/route.js:119:3)
14|CLINIC | at Layer.handle [as handle_request] (/home/tecno/clinic_manager/api_server/node_modules/express/lib/router/layer.js:95:5)
14|CLINIC | at /home/tecno/clinic_manager/api_server/node_modules/express/lib/router/index.js:284:15
14|CLINIC | at Function.process_params (/home/tecno/clinic_manager/api_server/node_modules/express/lib/router/index.js:346:12)
14|CLINIC | at next (/home/tecno/clinic_manager/api_server/node_modules/express/lib/router/index.js:280:10)
14|CLINIC | Código: undefined
14|CLINIC | Nome: undefined
14|CLINIC | Mensagem: undefined