question

vinod-nodejs avatar image
vinod-nodejs asked Lauren Worthington answered

Is there any code in nodejs to convert RSA/OAEP/SHA1 encryption for Build Payment

Is there any code in nodejs to convert RSA/OAEP/SHA1 encryption for Build Payment. We followed the followed API to make payment - POST /v2/merchant/{mId}/pay
REST APIPaymentsDeveloper Pay API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Lauren Worthington avatar image
Lauren Worthington answered
Hello,

You can use the crypto package:

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");
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community