Open omerida opened 2 years ago
This happens if you follow cybersource-flex-samples-php generatekey.php/[php-microform] example.
The correct way to do this is not pass in a bare array but instead call it like this:
$keyRequest = new GeneratePublicKeyRequest([
"encryptionType" => "RsaOaep256",
"targetOrigin" => $targetOrigin,
]);
// Generating Flex .11 capture context
$keyResponse = $api_instance->generatePublicKey($format = 'JWT', $keyRequest);
\CyberSource\Api\KeyGenerationApi::generatePublicKey()
will fail if masking is enabled.The code fails in
cybersource/rest-client-php/lib/Api/KeyGenerationApi.php
, line 172 because$httpBody
is an array and\CyberSource\Utilities\Helpers\DataMasker::maskData
expects to be passed a JSON string.