cancel
Showing results for 
Search instead for 
Did you mean: 

Do the cybersource api and authentication nuget packages support .net 6 or .net 7 projects?

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 

swingnchad
Member
1 ACCEPTED SOLUTION

Accepted Solutions

@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

View solution in original post

gauravbansal
Member
2 REPLIES 2

@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

gauravbansal
Member
rajvpate
Administrator Administrator
Administrator