This package has getCardHash method for JUNO API (juno.com.br).
const Juno = require('juno-payment-node');
private async getCardHash(ccNumber: string, name: string, ccCode: string,
ccExpiresOnMonth: string, ccExpiresOnYear: string): Promise<string> {
return new Promise(async (resolve, reject) => {
let tokenJuno = getJunoPublicKey(); // TODO: Code get key.
let cardData = {
cardNumber: ccNumber,
holderName: name,
securityCode: ccCode,
expirationMonth: ccExpiresOnMonth,
expirationYear: ccExpiresOnYear
};
let checkout = new Juno.DirectCheckout(tokenJuno,
isProd()); // TODO: Code check whether is production or not.
checkout.getCardHash(cardData, resolve, reject);
});
}
let ccHash = await this.getCardHash (ccNumber, name, ccCode, ccExpiresOnMonth, ccExpiresOnYear);