From 892c3ac920f97d69355e818c482931e78119672f Mon Sep 17 00:00:00 2001 From: Shangamesh T Date: Fri, 25 Dec 2020 17:26:44 +0530 Subject: [PATCH] Amazon Pay API SDK (.NET) 2.4.2 --- Amazon.Pay.API.SDK/Amazon.Pay.API.SDK.csproj | 4 ++-- Amazon.Pay.API.SDK/Constants.cs | 2 +- Amazon.Pay.API.SDK/WebStore/Buyer/BuyerResponse.cs | 7 +++++++ CHANGES.md | 3 +++ README.md | 4 ++-- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Amazon.Pay.API.SDK/Amazon.Pay.API.SDK.csproj b/Amazon.Pay.API.SDK/Amazon.Pay.API.SDK.csproj index e865284..59b0207 100644 --- a/Amazon.Pay.API.SDK/Amazon.Pay.API.SDK.csproj +++ b/Amazon.Pay.API.SDK/Amazon.Pay.API.SDK.csproj @@ -2,8 +2,8 @@ net45;netstandard2.0 - 2.4.1 - 2.4.1.0 + 2.4.2 + 2.4.2.0 true Amazon Pay Amazon diff --git a/Amazon.Pay.API.SDK/Constants.cs b/Amazon.Pay.API.SDK/Constants.cs index 071cc8f..17a0227 100644 --- a/Amazon.Pay.API.SDK/Constants.cs +++ b/Amazon.Pay.API.SDK/Constants.cs @@ -4,7 +4,7 @@ namespace Amazon.Pay.API { public class Constants { - public const string SdkVersion = "2.4.1.0"; + public const string SdkVersion = "2.4.2.0"; public const string SdkName = "amazon-pay-api-sdk-dotnet"; public const int ApiVersion = 2; diff --git a/Amazon.Pay.API.SDK/WebStore/Buyer/BuyerResponse.cs b/Amazon.Pay.API.SDK/WebStore/Buyer/BuyerResponse.cs index 48b4dcc..35a03c3 100644 --- a/Amazon.Pay.API.SDK/WebStore/Buyer/BuyerResponse.cs +++ b/Amazon.Pay.API.SDK/WebStore/Buyer/BuyerResponse.cs @@ -1,4 +1,5 @@ using Amazon.Pay.API.Types; +using Amazon.Pay.API.WebStore.Types; using Newtonsoft.Json; namespace Amazon.Pay.API.WebStore.Buyer @@ -34,5 +35,11 @@ public class BuyerResponse : AmazonPayResponse /// [JsonProperty(PropertyName = "postalCode")] public string PostalCode { get; internal set; } + + /// + /// Shipping address selected by the buyer. + /// + [JsonProperty(PropertyName = "shippingAddress")] + public Address ShippingAddress { get; internal set; } } } diff --git a/CHANGES.md b/CHANGES.md index afbcfbc..0d64a1b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +### Version 2.4.2 - December 2020 +* Added the "ShippingAdress" property to BuyerResponse which can be accessed by passing "shippingAddress" as signInScopes parameter while rendering Amazon Sign-in button + ### Version 2.4.1 * Add Interfaces for WebStoreClient and InstoreClient to allow developers to mock classes in tests. diff --git a/README.md b/README.md index 266a625..b504536 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ public class Sample : PageModel public void OnGet() { // prepare the request - SignInScope[] scopes = { SignInScope.Name, SignInScope.Email, SignInScope.PostalCode }; + SignInScope[] scopes = { SignInScope.Name, SignInScope.Email, SignInScope.PostalCode, SignInScope.ShippingAddress, SignInScope.PhoneNumber }; var request = new SignInRequest ( signInReturnUrl: "https://example.com/account.html", @@ -457,7 +457,7 @@ public class Sample : PageModel string buyerToken = HttpContext.Request.Query["buyerToken"]; // get the buyer details - // NOTE: the BuyerResponse that is returned here contains properties for buyerId, name, email, etc. + // NOTE: the BuyerResponse that is returned here contains properties for buyerId, name, email, shippingAddress, phoneNumber etc. Buyer = client.GetBuyer(buyerToken); } }