Edit Settings in web.config

Posted by Scott Selby on Stack Overflow See other posts from Stack Overflow or by Scott Selby
Published on 2012-10-20T03:42:53Z Indexed on 2012/10/20 5:02 UTC
Read the original article Hit count: 190

Filed under:
|
|
|
|

I didn't know how to title this question - I am making a request to PayPal's Express Payment API. I am using their dll that helps make the request and parse the response. The instructions for their code to work is to add you authorization credentials in the web.config file. I have done so. My problem is that I want to be able to edit these credentials that are being set dynamically ( probably get from SQL ) because we are going to allow different users to enter their API credentials. Sending the request to PayPal looks like this

  Dim wrapper As New SetExpressCheckoutReq()
    wrapper.SetExpressCheckoutRequest = request
    Dim service As New PayPalAPIInterfaceServiceService()
    Dim setECResponse As SetExpressCheckoutResponseType = service.SetExpressCheckout(wrapper)

There's not much room in there to edit the header of the request , because PayPalAPIInterfaceServiceService() is defined in their dll and applies its own header based on the credentials in the web.config.

So, my question is , is there a way to point in the web.config to another location when it looks in web.config? I'm not to sure this is possible , also is there any way to edit the header of a request that is defined in a dll without changing the dll (to stay pci compliant)

The line in the web.config is here:

 <account apiUsername="****" apiPassword="****" apiSignature="****"/>

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET