CloverAuth.AuthResult authResult = CloverAuth.authenticate(getApplicationContext(), mAccount); final String authToken = authResult.authToken;
thanks for your answer.
I am using node js to request the web pay api, in github sample, node js can use the pem parameter, but I can't get the pem parameter from the { {url}}/v2/merchant/{ {mId}}/pay/key api, just got modulus, exponent and prefix these 3 parameter, so I use below code to generate the encrypted card number, it seems the cardEncrypted is wrong, then api return me : "Error connecting to Payment Gateway" , can you please help with this? thanks in advance.
var RsaNode = require('rsa-node');
var rsa = new RsaNode(modulus, exponent);
var encrypted = rsa.encrypt(prefix + cardNumber);
var cardEncrypted = new Buffer(encrypted).toString('base64');
another try is below, still with error: error:0306E06C:bignum routines:BN_mod_inverse:no inverse
var getPem = require('rsa-pem-from-mod-exp');
var pem = getPem(modulus, exponent);
const crypto = require('crypto');
var encrypted = crypto.publicEncrypt(pem, Buffer(prefix + cardNumber));
1 Person is following this question.