const { data } = await axios({ method: "get", url: https://apisandbox.dev.clover.com/v2/merchant/mId/pay/key, params: { access_token: ACCESS_TOKEN } }); const encrypted = crypto.publicEncrypt( data.pem, Buffer.from(data.prefix + CARD_NUMBER) ); const cardEncrypted = Buffer.from(encrypted).toString("base64");
2 People are following this question.