The github sample is done in .net core 3.1. From a .net 6.0 project I can install the 2 packages: CyberSource.Authentication and CyberSource.Rest.Client. Using the sample code on github under the .net core solution I first get an error that GetConfiguration() doesn't exist on this line:
var configDictionary = new Configuration().GetConfiguration();
So I implement my own GetConfiguration() method based on the sample code. But now I get a runtime error on this line:
var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);
The error is RestSharp, Version=108.0.3.0 is required, but the nuget package installed 106.12.0.
So I then install RestSharp Version 108.0.3.0 but I get another runtime error:
'Method not found: 'Void RestSharp.RestClient..ctor(System.String)'.'
It's one error after another. Is there any way to get this to run on .net 6 or .net 7 which are the latest frameworks to date.
and use the sample .net core code in my
Solved! Go to Solution.
06-28-2023 05:37 PM
@swingnchad You have used incorrect .net cybersource SDK for your application. "CyberSource.Rest.Client" SDK is used for .Net Framework applications.
For .net6 or .net7 projects, you have to use "CyberSource.Rest.Client.NetStandard" and "CyberSource.Authentication.NetStandard" SDKs.
Links are given below:
NuGet Gallery | CyberSource.Rest.Client.NetStandard 0.0.1.25
NuGet Gallery | CyberSource.Authentication.NetStandard 0.0.1.10
07-13-2023 01:07 AM
@swingnchad You have used incorrect .net cybersource SDK for your application. "CyberSource.Rest.Client" SDK is used for .Net Framework applications.
For .net6 or .net7 projects, you have to use "CyberSource.Rest.Client.NetStandard" and "CyberSource.Authentication.NetStandard" SDKs.
Links are given below:
NuGet Gallery | CyberSource.Rest.Client.NetStandard 0.0.1.25
NuGet Gallery | CyberSource.Authentication.NetStandard 0.0.1.10
07-13-2023 01:07 AM
A blog post has been created here to explain the nuances: https://community.developer.cybersource.com/t5/cybersource-Developer-Blog/REST-SDK-NET-Compatibility...
07-31-2023 11:20 AM