RickardPettersson / swish-api-csharp

Swish For Merchant API Client .Net Standard Library
MIT License
29 stars 14 forks source link

Be able to send certificate as Stream instead of path? #15

Closed toastmastern closed 2 years ago

toastmastern commented 2 years ago

Hi

Was evaluating your package, thanks for good work! For an easier implementation in cloud, would it be possible to add a public constructor where the ClientCertificate can be passed as a Stream instead of a file path?

ie something like

public Client(Stream certificate, string certificatePassword, string callbackUrl, string payeePaymentReference, string merchantAlias)

and have the content property read from stream instead of disk or something equivalent?

Thanks in advance!

RickardPettersson commented 2 years ago

Probably it should be possible, i put it on my todo list to check, that probably fix the linux path problem also that are another isssue.

ludvigbartholdsson commented 2 years ago

Also looking for this. Thx!

RickardPettersson commented 2 years ago

I have now updated the code and the NuGet package version 2.0 is on the way, Microsoft doing stuff with the package before it come available public but the code is in this repository from now. The latest code has split the different functions to different classes so example eCommerceClient is the new C# class to use for e-commerce functionality and all of the clients takes in a object named ClientCertificate where you have the opertunity to put a Stream of the certificate instead of a path. Please try and come back with feedback.