I am implementing registration process that implements cybersource as payment gateway with ASP MVC web API.
In web.config we have to specify the keys and logs directory.
<add key="cybs.keysDirectory" value= "E:\CyberSource\Keys/" /> <add key="cybs.logDirectory" value= "E:\CyberSource\Logs/" />
This works fine when we deploy the API on IIS and work locally. But when we deploy the API to Azure and for the registration part (Subscribe) that use the CyberSource gateway we get the 502 bad request error from the request.
We tried relative paths as well but still the same error.
Issue: We believe that the API is not getting the .p12 file from the keys directory.
Question: Where to put the .p12 file or where to create the keys directory and what should we specify in web.config to make it work.
A CyberSource Evaluation account.
Complete your Evaluation account creation by following the instructions in the Registration email. Transaction Security Keys
Create security keys in the Enterprise Business Center (ebctest) after you've created your Merchant Admin account. Refer to our developer guide for details on how to generate .P12 key.
Where to put the .p12 file or where to create the keys directory and what should we specify in web.config to make it work.
If you want to use the certificates in the Azure WebApp, please have a try to convert .p12 to .pfx and install it in the WebApp. About how to upload and use certificates in Azure WebApp, please refer to this blog. I aslo find another similar SO thread.
Adding an app setting named WEBSITE_LOAD_CERTIFICATES with its value set to the thumbprint of the certificate will make it accessible to your web application. You can have multiple comma-separated thumbprint values or can set this value to “ * “ (without quotes) in which case all your certificates will be loaded to your web applications personal certificate store.