Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture Context fails if masking enabled #94

Open
omerida opened this issue Feb 23, 2022 · 1 comment
Open

Capture Context fails if masking enabled #94

omerida opened this issue Feb 23, 2022 · 1 comment

Comments

@omerida
Copy link

omerida commented Feb 23, 2022

\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.

@omerida
Copy link
Author

omerida commented Feb 23, 2022

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);	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant