Skip to content

Commit

Permalink
Merge branch 'abuzuhri:main' into VendorTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Edogusma authored Dec 11, 2023
2 parents 6feaf2a + a1c3810 commit 0a74eec
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 496 deletions.
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,11 @@ Install-Package CSharpAmazonSpAPI
## Keys
To get all keys needed you need to follow this step [Creating and configuring IAM policies and entities](https://developer-docs.amazon.com/sp-api/docs/creating-and-configuring-iam-policies-and-entities) and then you need to [Registering your Application](https://developer-docs.amazon.com/sp-api/docs/registering-your-application) then [Authorizing Selling Partner API applications
](https://developer-docs.amazon.com/sp-api/docs/authorizing-selling-partner-api-applications#step-1-request-a-login-with-amazon-access-token)
> :warning: **Use role ARN created in step 5 when you register your application**: and dont use IAM user


| Name | Description |
| --- | --- |
| AccessKey | AWS USER ACCESS KEY |
| SecretKey | AWS USER SECRET KEY |
| RoleArn | AWS IAM Role ARN (needs permission to “Assume Role” STS) |
| Region | Marketplace region [List of Marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids)|
| Marketplace | Marketplace region [List of Marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids)|
| ClientId | Your amazon app id |
| ClientSecret | Your amazon app secret |
| RefreshToken | Check how to get [RefreshToken](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md#Self-authorization) |
Expand All @@ -105,9 +102,6 @@ You can configure a connection like so please see [Here](https://github.com/abuz
```CSharp
AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
{
AccessKey = "AKIAXXXXXXXXXXXXXXX",
SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RoleArn = "arn:aws:iam::XXXXXXXXXXXXX:role/XXXXXXXXXXXX",
ClientId = "amzn1.application-XXX-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
ClientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RefreshToken= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
Expand All @@ -118,9 +112,6 @@ or

AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
{
AccessKey = "AKIAXXXXXXXXXXXXXXX",
SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RoleArn = "arn:aws:iam::XXXXXXXXXXXXX:role/XXXXXXXXXXXX",
ClientId = "amzn1.application-XXX-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
ClientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RefreshToken= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
Expand All @@ -134,9 +125,6 @@ Please see [here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Sou
>```csharp
>AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
>{
> AccessKey = "AKIAXXXXXXXXXXXXXXX",
> SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
> RoleArn = "arn:aws:iam::XXXXXXXXXXXXX:role/XXXXXXXXXXXX",
> ClientId = "amzn1.application-XXX-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
> ClientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
> RefreshToken= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
Expand Down Expand Up @@ -216,9 +204,6 @@ var orders = _amazonConnection.Orders.GetOrders(parameterOrderList);
```CSharp
AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
{
AccessKey = "AKIAXXXXXXXXXXXXXXX",
SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RoleArn = "arn:aws:iam::XXXXXXXXXXXXX:role/XXXXXXXXXXXX",
ClientId = "amzn1.application-XXX-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
ClientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RefreshToken= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
Expand Down
9 changes: 2 additions & 7 deletions Source/FikaAmazonAPI.SampleCode/CustomMessageReceiver.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using Amazon;
using FikaAmazonAPI.NotificationMessages;
using FikaAmazonAPI.NotificationMessages;
using FikaAmazonAPI.Parameter.Notification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FikaAmazonAPI.SampleCode
{
Expand All @@ -19,6 +13,7 @@ public void ErrorCatch(Exception ex)

public void NewMessageRevicedTriger(NotificationMessageResponce message)
{
Console.Write(".");
//Your Code here
}
}
Expand Down
10 changes: 5 additions & 5 deletions Source/FikaAmazonAPI.SampleCode/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ static async Task Main(string[] args)

AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
{
AccessKey = config.GetSection("FikaAmazonAPI:AccessKey").Value,
SecretKey = config.GetSection("FikaAmazonAPI:SecretKey").Value,
RoleArn = config.GetSection("FikaAmazonAPI:RoleArn").Value,
//AccessKey = config.GetSection("FikaAmazonAPI:AccessKey").Value,
//SecretKey = config.GetSection("FikaAmazonAPI:SecretKey").Value,
//RoleArn = config.GetSection("FikaAmazonAPI:RoleArn").Value,
ClientId = config.GetSection("FikaAmazonAPI:ClientId").Value,
ClientSecret = config.GetSection("FikaAmazonAPI:ClientSecret").Value,
RefreshToken = config.GetSection("FikaAmazonAPI:RefreshToken").Value,
Expand All @@ -29,8 +29,8 @@ static async Task Main(string[] args)
});


//FeedsSample feedsSample = new FeedsSample(amazonConnection);
//feedsSample.SubmitFeedPRICING(69.3F, "8809606851663");
FeedsSample feedsSample = new FeedsSample(amazonConnection);
feedsSample.SubmitFeedPRICING(69.3F, "8809606851663");

var feeds = amazonConnection.Feed.GetFeeds(new Parameter.Feed.ParameterGetFeed()
{
Expand Down
13 changes: 7 additions & 6 deletions Source/FikaAmazonAPI/AmazonConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ private void ValidateCredentials(AmazonCredential Credentials)
{
if (Credentials == null)
throw new AmazonUnauthorizedException($"Error, you cannot make calls to Amazon without credentials!");
else if (string.IsNullOrEmpty(Credentials.AccessKey))
throw new AmazonInvalidInputException($"InvalidInput, AccessKey cannot be empty!");
else if (string.IsNullOrEmpty(Credentials.SecretKey))
throw new AmazonInvalidInputException($"InvalidInput, SecretKey cannot be empty!");
else if (string.IsNullOrEmpty(Credentials.RoleArn))
throw new AmazonInvalidInputException($"InvalidInput, RoleArn cannot be empty!");
//Remove AWS authorization
//else if (string.IsNullOrEmpty(Credentials.AccessKey))
// throw new AmazonInvalidInputException($"InvalidInput, AccessKey cannot be empty!");
//else if (string.IsNullOrEmpty(Credentials.SecretKey))
// throw new AmazonInvalidInputException($"InvalidInput, SecretKey cannot be empty!");
//else if (string.IsNullOrEmpty(Credentials.RoleArn))
// throw new AmazonInvalidInputException($"InvalidInput, RoleArn cannot be empty!");
else if (string.IsNullOrEmpty(Credentials.ClientId))
throw new AmazonInvalidInputException($"InvalidInput, ClientId cannot be empty!");
else if (string.IsNullOrEmpty(Credentials.ClientSecret))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,61 @@ public enum VariantEnum
/// Enum SWCH for value: SWCH
/// </summary>
[EnumMember(Value = "SWCH")]
SWCH = 10
SWCH = 10,

/// <summary>
/// Enum PT09 for value: PT09
/// </summary>
[EnumMember(Value = "PT09")]
PT09 = 11,

/// <summary>
/// Enum PT10 for value: PT10
/// </summary>
[EnumMember(Value = "PT10")]
PT10 = 12,

/// <summary>
/// Enum PT11 for value: PT11
/// </summary>
[EnumMember(Value = "PT11")]
PT11 = 13,

/// <summary>
/// Enum PT12 for value: PT12
/// </summary>
[EnumMember(Value = "PT12")]
PT12 = 14,

/// <summary>
/// Enum PT13 for value: PT13
/// </summary>
[EnumMember(Value = "PT13")]
PT13 = 15,

/// <summary>
/// Enum PT14 for value: PT14
/// </summary>
[EnumMember(Value = "PT14")]
PT14 = 16,

/// <summary>
/// Enum PT15 for value: PT15
/// </summary>
[EnumMember(Value = "PT15")]
PT15 = 17,

/// <summary>
/// Enum EEGL for value: EEGL
/// </summary>
[EnumMember(Value = "EEGL")]
EEGL = 18,

/// <summary>
/// Enum EGUS for value: EGUS
/// </summary>
[EnumMember(Value = "EGUS")]
EGUS = 19
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public enum DeemedResellerCategoryEnum
/// Enum JE_VOEC for value: JE_VOEC
/// </summary>
[EnumMember(Value = "JE_VOEC")]
JE_VOEC
JE_VOEC = 9
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using FikaAmazonAPI.AmazonSpApiSDK.Runtime;
using System;
using System;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Token
{
public class AWSAuthenticationTokenData
{
public AWSAuthenticationCredentials AWSAuthenticationCredential { get; set; }
//public AWSAuthenticationCredentials AWSAuthenticationCredential { get; set; }
public string SessionToken { get; set; }
public DateTime Expiration { get; set; }

Expand Down

This file was deleted.

82 changes: 0 additions & 82 deletions Source/FikaAmazonAPI/AmazonSpApiSDK/Runtime/AWSSigV4Signer.cs

This file was deleted.

Loading

0 comments on commit 0a74eec

Please sign in to comment.