question

ex8 avatar image
ex8 asked pawank3 Suspended answered

Developer Pay API V2 - "'failureMessage': 'RE0528 - EncrptBlock is invalid|'" ?

Hello,

I have been stuck on this issue with the Pay V2 API ( https://docs.clover.com/build/developer-pay-api/)

It is giving me an encryption block is invalid error and I cannot seem to figure out why it is not working. The failure message isn't the best. I have thoroughly followed the documentation for the card encryption. I am stuck.

I did the encryption two different ways.
1) Added the prefix from the first GET request to the card number and used that to encrypt
card_num = secrets['prefix'] + card['card_number']
RSAkey = RSA.construct((int(secrets['modulus']), int(secrets['exponent'])))
key = RSAkey.publickey()
encrypted = key.encrypt(int(card['card_number']), card_num)
card_encrypted = b64encode(str(encrypted[0]))

2) Did NOT add the prefix to the card number initially, just used the card number and prefix to encrypt.
RSAkey = RSA.construct((int(secrets['modulus']), int(secrets['exponent'])))
publickey = RSAkey.publickey()
encrypted = publickey.encrypt(int(card['card_number']), secrets['prefix'])
card_encrypted = b64encode(str(encrypted[0]).encode()

If anyone is able to assist with this, I would be grateful.

Best Regards,
Payments
1 comment
10 |2000

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

Hi @ex8,

Before answering your question, and to provide more accurate and timely answers in the future, please fill out this information discovery form - https://goo.gl/forms/xIWnym9wwdZhiEYw1. Note that we will keep all your information private and will not disclose it to any other party.

Best,

Keith

0 Likes 0 ·

1 Answer

pawank3 avatar image
pawank3 Suspended answered
Hello @ex8 ...did you find the solution for this ???
10 |2000

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