I got this message :
CRYPTO FAILURE: Probably a bad swipe or damaged card. Retry swipe or use manual card entry. Contact support if this problem persists.
when sending POST to /v2/merchant/{mId}/pay.
I'm using phpseclib to encrypt the cardnumber, this is my code.
$e = new Math_BigInteger($key->exponent);
$m = new Math_BigInteger($key->modulus);
$card = $key->prefix.$card_number;
$rsa = new Crypt_RSA();
$rsa->setHash('sha1');
$rsa->setMGFHash('sha1');
$rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_OAEP);
$rsa->loadKey(array('n' =>$m, 'e' => $e ));
$ciphertext = $rsa->encrypt($card);
$cardEncrypted =base64_encode($ciphertext);
I tested with different encryption mode (PKCS1,OAEP) and different hash (sha1,sha256,sha512).
Can you help me ?