CyberSource / cybersource-rest-client-dotnetstandard

.NET Standard client library for the CyberSource REST API
7 stars 15 forks source link

Use ApiClient basePath in API calls #45

Open wopietrz opened 1 year ago

wopietrz commented 1 year ago

Each time CallAuthenticationHeaders method is called a new instance of RestClientis created and initialized with merchantConfig.HostName. That makes it impossilbe to set RestClient baseAddress with values different than apitest.cybersource.com or cybersoure.com. Also there should be a possibility to override some of authentication headers like Host to specify custom hostname and and port number of the server to which the request is being sent. That would allow to call Cybersource API via cloud based API management platforms e.g. Azure Api Managment

wrightsonm commented 1 year ago

@wopietrz ApiClient.cs is code genned.

You might want to look at updating:

https://github.com/CyberSource/cybersource-rest-client-dotnetstandard/blob/master/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/ApiClient.mustache

wopietrz commented 1 year ago

Thanks for reply. It is a change proposal. I can have a look at *.mustache file but want to be sure if the code chage is acceptable for you.