Skip to content

Commit 26acc4f

Browse files
Merge pull request #75 from CyberSource/feb-2024-release
Feb 2024 release
2 parents 17a40bb + 43d324b commit 26acc4f

File tree

37 files changed

+1014
-402
lines changed

37 files changed

+1014
-402
lines changed

cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/AuthenticationSdk.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6-
<Version>0.0.1.12</Version>
6+
<Version>0.0.1.13</Version>
77
<Authors>CyberSource</Authors>
88
<Product>Authentication_SDK</Product>
99
<Description />
@@ -35,7 +35,7 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<PackageReference Include="jose-jwt" Version="2.5.0" />
38+
<PackageReference Include="jose-jwt" Version="4.1.0" />
3939
<PackageReference Include="NLog" Version="5.0.0" />
4040
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
4141
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />

cybersource-rest-client-netstandard/README.md

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
12
# .NET Standard Client SDK for the CyberSource REST API
23

34
The CyberSource .NET Standard client provides convenient access to the [CyberSource REST API](https://developer.cybersource.com/api/reference/api-reference.html) from your .NET application.
45

5-
## Requirements
6+
## System Requirements
67

78
* .NET Standard 2.1
89

@@ -14,13 +15,19 @@ The CyberSource .NET Standard client provides convenient access to the [CyberSou
1415
PM> Install-Package CyberSource.Rest.Client.NetStandard
1516
```
1617

17-
## Registration & Configuration
18+
## Account Registration and Configuration
19+
20+
* Account Registration
21+
22+
Follow the first step mentioned in [Getting Started with CyberSource REST SDKs](https://developer.cybersource.com/hello-world/rest-api-sdks.html#gettingstarted) to create a sandbox account.
1823

19-
Use of this SDK and the CyberSource APIs requires having an account on our system. You can find details of getting a test account and creating your keys [here](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)
24+
* Configuration
2025

21-
Remember this SDK is for use in server-side .NET applications that access the CyberSource REST API and credentials should always be securely stored and accessed appropriately.
26+
Follow the second step mentioned in [Getting Started with CyberSource REST SDKs](https://developer.cybersource.com/hello-world/rest-api-sdks.html#gettingstarted) to configure the SDK by inputting your credentials.
2227

23-
## SDK Usage Examples and Sample Code
28+
***Please note that this is for reference only. Ensure to store the credentials in a more secure manner.***
29+
30+
## How to Use
2431

2532
To get started using this SDK, it's highly recommended to download our sample code repository:
2633

@@ -34,7 +41,44 @@ Additionally, you can find details and examples of how our API is structured in
3441

3542
The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.
3643

37-
## MetaKey Support
44+
## Example using Sample Code Application
45+
46+
* Add [CyberSource REST client](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/cfd0c4e996c4d991eef5e06f6c8c520e3354e8c2/cybersource-rest-samples-netcore.csproj#L43) into your .NET Standard project.
47+
48+
* Configure your credentials in [Configuration File](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/cfd0c4e996c4d991eef5e06f6c8c520e3354e8c2/Source/Configuration.cs#L12C9-L48C10)
49+
50+
* Use the stored crdentials to create an instance of [clientConfig](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/cfd0c4e996c4d991eef5e06f6c8c520e3354e8c2/Source/Samples/Payments/Payments/SimpleAuthorizationInternet.cs#L87C17-L88C111).
51+
52+
* Create an instance [API](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/cfd0c4e996c4d991eef5e06f6c8c520e3354e8c2/Source/Samples/Payments/Payments/SimpleAuthorizationInternet.cs#L90) using the clientConfig.
53+
54+
* Use the created ApiClient instance to call CyberSource APIs. For example [SimpleAuthorizationInternet](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/cfd0c4e996c4d991eef5e06f6c8c520e3354e8c2/Source/Samples/Payments/Payments/SimpleAuthorizationInternet.cs#L91).
55+
56+
For more detailed examples, refer to the [cybersource-rest-samples-csharp](https://github.com/CyberSource/cybersource-rest-samples-csharp) repository.
57+
58+
### Switching between the sandbox environment and the production environment
59+
60+
Cybersource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the `runEnvironment` property in the SDK Configuration. See our sample at [Sample Configuration file](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/master/Source/Configuration.cs).
61+
62+
```csharp
63+
// For TESTING use
64+
_configurationDictionary.Add("runEnvironment", "apitest.cybersource.com");
65+
// For PRODUCTION use
66+
// _configurationDictionary.Add("runEnvironment", "api.cybersource.com");
67+
```
68+
69+
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
70+
71+
### Logging
72+
73+
[![Generic badge](https://img.shields.io/badge/LOGGING-NEW-GREEN.svg)](https://shields.io/)
74+
75+
Since v0.0.1.7, a new logging framework has been introduced in the SDK. This new logging framework makes use of NLog, and standardizes the logging so that it can be integrated with the logging in the client application.
76+
77+
More information about this new logging framework can be found in this file : [Logging.md](Logging.md)
78+
79+
## Fetures
80+
81+
### MetaKey Support
3882

3983
A Meta Key is a single key that can be used by one, some, or all merchants (or accounts, if created by a Portfolio user) in the portfolio.
4084

@@ -44,7 +88,7 @@ MIDs continue to be able to create keys for themselves, even if a Meta Key is ge
4488

4589
Further information on MetaKey can be found in [New Business Center User Guide](https://developer.cybersource.com/library/documentation/dev_guides/Business_Center/New_Business_Center_User_Guide.pdf).
4690

47-
## OAuth Support
91+
### OAuth Support
4892

4993
OAuth enables service providers to securely share access to customer data without sharing password data.
5094

@@ -65,26 +109,20 @@ In order to use OAuth, set the run environment to OAuth enabled URLs. OAuth only
65109
// _configurationDictionary.Add("runEnvironment", "api-ma.cybersource.com")
66110
```
67111

68-
### Switching between the sandbox environment and the production environment
69-
70-
Cybersource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the `runEnvironment` property in the SDK Configuration. See our sample at [Sample Configuration file](https://github.com/CyberSource/cybersource-rest-samples-csharp/blob/master/Source/Configuration.cs).
71-
72-
```csharp
73-
// For TESTING use
74-
_configurationDictionary.Add("runEnvironment", "apitest.cybersource.com");
75-
// For PRODUCTION use
76-
// _configurationDictionary.Add("runEnvironment", "api.cybersource.com");
77-
```
112+
## How to Contribute
78113

79-
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
114+
* Fork the repo and create your branch from `master`.
115+
* If you've added code that should be tested, add tests.
116+
* Ensure the test suite passes.
117+
* Submit your pull request! (Ensure you have [synced your fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) with the original repository before initiating the PR).
80118

81-
### Logging
119+
## Need Help?
82120

83-
[![Generic badge](https://img.shields.io/badge/LOGGING-NEW-GREEN.svg)](https://shields.io/)
121+
For any help, you can reach out to us at our [Discussion Forum](https://community.developer.cybersource.com/t5/cybersource-APIs/bd-p/api).
84122

85-
Since v0.0.1.7, a new logging framework has been introduced in the SDK. This new logging framework makes use of NLog, and standardizes the logging so that it can be integrated with the logging in the client application.
123+
## Disclaimer
86124

87-
More information about this new logging framework can be found in this file : [Logging.md](Logging.md)
125+
CyberSource may allow Customer to access, use, and/or test a CyberSource product or service that may still be in development or has not been market-tested (“Beta Product”) solely for the purpose of evaluating the functionality or marketability of the Beta Product (a “Beta Evaluation”). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer’s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder): The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (“Beta Product Form”). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer’s use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. CyberSource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided “AS IS” and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR (C) FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS.
88126

89127
## License
90128

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Api/TokenApiTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ public void PostTokenPaymentCredentialsTest()
7272
{
7373
// TODO uncomment below to test the method and replace null with proper value
7474
//string tokenId = null;
75+
//PostPaymentCredentialsRequest postPaymentCredentialsRequest = null;
7576
//string profileId = null;
76-
//var response = instance.PostTokenPaymentCredentials(tokenId, profileId);
77+
//var response = instance.PostTokenPaymentCredentials(tokenId, postPaymentCredentialsRequest, profileId);
7778
//Assert.IsInstanceOf<string> (response, "response is string");
7879
}
7980

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* CyberSource Merged Spec
3+
*
4+
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5+
*
6+
* OpenAPI spec version: 0.0.1
7+
*
8+
* Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
*/
10+
11+
12+
using NUnit.Framework;
13+
14+
using System;
15+
using System.Linq;
16+
using System.IO;
17+
using System.Collections.Generic;
18+
using CyberSource.Api;
19+
using CyberSource.Model;
20+
using CyberSource.Client;
21+
using System.Reflection;
22+
23+
namespace CyberSource.Test
24+
{
25+
/// <summary>
26+
/// Class for testing PostPaymentCredentialsRequest
27+
/// </summary>
28+
/// <remarks>
29+
/// This file is automatically generated by Swagger Codegen.
30+
/// Please update the test case below to test the model.
31+
/// </remarks>
32+
[TestFixture]
33+
public class PostPaymentCredentialsRequestTests
34+
{
35+
// TODO uncomment below to declare an instance variable for PostPaymentCredentialsRequest
36+
//private PostPaymentCredentialsRequest instance;
37+
38+
/// <summary>
39+
/// Setup before each test
40+
/// </summary>
41+
[SetUp]
42+
public void Init()
43+
{
44+
// TODO uncomment below to create an instance of PostPaymentCredentialsRequest
45+
//instance = new PostPaymentCredentialsRequest();
46+
}
47+
48+
/// <summary>
49+
/// Clean up after each test
50+
/// </summary>
51+
[TearDown]
52+
public void Cleanup()
53+
{
54+
55+
}
56+
57+
/// <summary>
58+
/// Test an instance of PostPaymentCredentialsRequest
59+
/// </summary>
60+
[Test]
61+
public void PostPaymentCredentialsRequestInstanceTest()
62+
{
63+
// TODO uncomment below to test "IsInstanceOfType" PostPaymentCredentialsRequest
64+
//Assert.IsInstanceOfType<PostPaymentCredentialsRequest> (instance, "variable 'instance' is a PostPaymentCredentialsRequest");
65+
}
66+
67+
/// <summary>
68+
/// Test the property 'PaymentCredentialType'
69+
/// </summary>
70+
[Test]
71+
public void PaymentCredentialTypeTest()
72+
{
73+
// TODO unit test for the property 'PaymentCredentialType'
74+
}
75+
76+
}
77+
78+
}

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Model/PtsV2PaymentsCapturesPost201ResponseProcessorInformationTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ public void TransactionIdTest()
7272
{
7373
// TODO unit test for the property 'TransactionId'
7474
}
75+
/// <summary>
76+
/// Test the property 'NetworkTransactionId'
77+
/// </summary>
78+
[Test]
79+
public void NetworkTransactionIdTest()
80+
{
81+
// TODO unit test for the property 'NetworkTransactionId'
82+
}
7583

7684
}
7785

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Model/Ptsv2paymentsAcquirerInformationTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ public void MerchantIdTest()
9696
{
9797
// TODO unit test for the property 'MerchantId'
9898
}
99+
/// <summary>
100+
/// Test the property 'AcquirerMerchantId'
101+
/// </summary>
102+
[Test]
103+
public void AcquirerMerchantIdTest()
104+
{
105+
// TODO unit test for the property 'AcquirerMerchantId'
106+
}
99107

100108
}
101109

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Model/Riskv1authenticationresultsOrderInformationTests.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ public void AmountDetailsTest()
7272
{
7373
// TODO unit test for the property 'AmountDetails'
7474
}
75-
/// <summary>
76-
/// Test the property 'LineItems'
77-
/// </summary>
78-
[Test]
79-
public void LineItemsTest()
80-
{
81-
// TODO unit test for the property 'LineItems'
82-
}
8375

8476
}
8577

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@
2323
namespace CyberSource.Test
2424
{
2525
/// <summary>
26-
/// Class for testing Riskv1authenticationresultsOrderInformationLineItems
26+
/// Class for testing Riskv1decisionsAcquirerInformation
2727
/// </summary>
2828
/// <remarks>
2929
/// This file is automatically generated by Swagger Codegen.
3030
/// Please update the test case below to test the model.
3131
/// </remarks>
3232
[TestFixture]
33-
public class Riskv1authenticationresultsOrderInformationLineItemsTests
33+
public class Riskv1decisionsAcquirerInformationTests
3434
{
35-
// TODO uncomment below to declare an instance variable for Riskv1authenticationresultsOrderInformationLineItems
36-
//private Riskv1authenticationresultsOrderInformationLineItems instance;
35+
// TODO uncomment below to declare an instance variable for Riskv1decisionsAcquirerInformation
36+
//private Riskv1decisionsAcquirerInformation instance;
3737

3838
/// <summary>
3939
/// Setup before each test
4040
/// </summary>
4141
[SetUp]
4242
public void Init()
4343
{
44-
// TODO uncomment below to create an instance of Riskv1authenticationresultsOrderInformationLineItems
45-
//instance = new Riskv1authenticationresultsOrderInformationLineItems();
44+
// TODO uncomment below to create an instance of Riskv1decisionsAcquirerInformation
45+
//instance = new Riskv1decisionsAcquirerInformation();
4646
}
4747

4848
/// <summary>
@@ -55,38 +55,46 @@ public void Cleanup()
5555
}
5656

5757
/// <summary>
58-
/// Test an instance of Riskv1authenticationresultsOrderInformationLineItems
58+
/// Test an instance of Riskv1decisionsAcquirerInformation
5959
/// </summary>
6060
[Test]
61-
public void Riskv1authenticationresultsOrderInformationLineItemsInstanceTest()
61+
public void Riskv1decisionsAcquirerInformationInstanceTest()
6262
{
63-
// TODO uncomment below to test "IsInstanceOfType" Riskv1authenticationresultsOrderInformationLineItems
64-
//Assert.IsInstanceOfType<Riskv1authenticationresultsOrderInformationLineItems> (instance, "variable 'instance' is a Riskv1authenticationresultsOrderInformationLineItems");
63+
// TODO uncomment below to test "IsInstanceOfType" Riskv1decisionsAcquirerInformation
64+
//Assert.IsInstanceOfType<Riskv1decisionsAcquirerInformation> (instance, "variable 'instance' is a Riskv1decisionsAcquirerInformation");
6565
}
6666

6767
/// <summary>
68-
/// Test the property 'UnitPrice'
68+
/// Test the property 'AcquirerBin'
6969
/// </summary>
7070
[Test]
71-
public void UnitPriceTest()
71+
public void AcquirerBinTest()
7272
{
73-
// TODO unit test for the property 'UnitPrice'
73+
// TODO unit test for the property 'AcquirerBin'
7474
}
7575
/// <summary>
76-
/// Test the property 'Quantity'
76+
/// Test the property 'Country'
7777
/// </summary>
7878
[Test]
79-
public void QuantityTest()
79+
public void CountryTest()
8080
{
81-
// TODO unit test for the property 'Quantity'
81+
// TODO unit test for the property 'Country'
8282
}
8383
/// <summary>
84-
/// Test the property 'TaxAmount'
84+
/// Test the property 'Password'
8585
/// </summary>
8686
[Test]
87-
public void TaxAmountTest()
87+
public void PasswordTest()
8888
{
89-
// TODO unit test for the property 'TaxAmount'
89+
// TODO unit test for the property 'Password'
90+
}
91+
/// <summary>
92+
/// Test the property 'MerchantId'
93+
/// </summary>
94+
[Test]
95+
public void MerchantIdTest()
96+
{
97+
// TODO unit test for the property 'MerchantId'
9098
}
9199

92100
}

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Model/Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierTokenizedCardTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ public void StateTest()
8181
// TODO unit test for the property 'State'
8282
}
8383
/// <summary>
84+
/// Test the property 'EnrollmentId'
85+
/// </summary>
86+
[Test]
87+
public void EnrollmentIdTest()
88+
{
89+
// TODO unit test for the property 'EnrollmentId'
90+
}
91+
/// <summary>
92+
/// Test the property 'TokenReferenceId'
93+
/// </summary>
94+
[Test]
95+
public void TokenReferenceIdTest()
96+
{
97+
// TODO unit test for the property 'TokenReferenceId'
98+
}
99+
/// <summary>
84100
/// Test the property 'Reason'
85101
/// </summary>
86102
[Test]

0 commit comments

Comments
 (0)