Skip to content

Commit

Permalink
Amazon Pay C# SDK 3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher TruLove committed May 24, 2019
1 parent 864a1e9 commit 510100f
Show file tree
Hide file tree
Showing 55 changed files with 13,818 additions and 11,278 deletions.
Binary file added AmazonPay/AmazonPay.3.5.1.nupkg
Binary file not shown.
11 changes: 8 additions & 3 deletions AmazonPay/AmazonPay.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\..\GitHub\login-and-pay-with-amazon-sdk-samples\Csharp\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -22,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -32,20 +34,23 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\lib\AmazonPay.xml</DocumentationFile>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>KeyFile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<DelaySign>false</DelaySign>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net20\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net20\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Expand Down
2 changes: 1 addition & 1 deletion AmazonPay/AmazonPay.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>$id$</id>
<version>3.5.0.0</version>
<version>3.5.1.0</version>
<title>$title$</title>
<authors>AmazonPay</authors>
<owners>AmazonPay</owners>
Expand Down
Binary file added AmazonPay/AmazonPayPublic.snk
Binary file not shown.
2 changes: 1 addition & 1 deletion AmazonPay/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace AmazonPay
{
public static class Constants
{
public static readonly string SDKClientVersion = "3.5.0.0";
public static readonly string SDKClientVersion = "3.5.1.0";
public static readonly string SDKName = "amazon-pay-sdk-csharp";
public static readonly string PaymentsServiceVersion = "2013-01-01";
public static readonly int MaxErrorRetry = 3;
Expand Down
Binary file added AmazonPay/KeyFile.snk
Binary file not shown.
6 changes: 3 additions & 3 deletions AmazonPay/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Amazon Pay")]
[assembly: AssemblyProduct("AmazonPay")]
[assembly: AssemblyCopyright("Copyright © 2017-2018")]
[assembly: AssemblyCopyright("Copyright © 2017-2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.5.0.0")]
[assembly: AssemblyFileVersion("3.5.0.0")]
[assembly: AssemblyVersion("3.5.1.0")]
[assembly: AssemblyFileVersion("3.5.1.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,25 @@ protected override ConfirmBillingAgreementRequest GetThis()
/// </summary>
/// <param name="amazon_billing_agreement_id"></param>
/// <returns>ConfirmBillingAgreementRequest Object</returns>
/// Deprecating because of typo in method name
[System.Obsolete("Erroneous method name. Please use WithAmazonBillingAgreementId")]
public ConfirmBillingAgreementRequest WithAmazonBillingreementId(string amazon_billing_agreement_id)
{
this.amazon_billing_agreement_id = amazon_billing_agreement_id;
return this;
}

/// <summary>
/// Sets the Amazon Billing Agreement ID
/// </summary>
/// <param name="amazon_billing_agreement_id"></param>
/// <returns>ConfirmBillingAgreementRequest Object</returns>
public ConfirmBillingAgreementRequest WithAmazonBillingAgreementId(string amazon_billing_agreement_id)
{
this.amazon_billing_agreement_id = amazon_billing_agreement_id;
return this;
}

/// <summary>
/// Gets the Amazon Billing Agreement ID
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions AmazonPay/Responses/Operator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public enum Operator

//OrderReferenceDetailsResponse
FullDescriptor, isAmazonBalanceFirst, OrderLanguage, RequestPaymentAuthorization, PaymentServiceProviderId,
PaymentServiceProviderOrderId, OrderItemCategory, SupplementaryData,
PaymentServiceProviderOrderId, OrderItemCategory, SupplementaryData, StaticToken, OrderReferenceStatus,

//GetMerchantAccountStatusResponse
AccountStatus,

Expand Down
38 changes: 37 additions & 1 deletion AmazonPay/Responses/OrderReferenceDetailsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class OrderReferenceDetailsResponse : AbstractResponse
private string sellerOrderId;
private string customInformation;
private string supplementaryData;
private string paymentAuthenticationState;
private string staticToken;

/// <summary>
/// Billing Agreement ID for CreateOrderReferenceForID API call
Expand Down Expand Up @@ -150,7 +152,19 @@ private void ParseDictionaryToNewVariables(IDictionary dictionary)
reasonDescription = obj.ToString();
break;
case Operator.State:
orderReferenceState = obj.ToString();
/* State is the Key in XML that is same for both OrderReferenceStatus state and
* PaymentAuthenticationStatus state. When flattened the XML attribute is lost but
* saved in the parentKey Variable. When parentKey equals 'OrderReferenceStatus'
* then parse it into orderReferenceState else into paymentAuthenticationState
*/
if (parentKey.Equals(Operator.OrderReferenceStatus.ToString()))
{
orderReferenceState = obj.ToString();
}
else
{
paymentAuthenticationState = obj.ToString();
}
break;
case Operator.SellerNote:
sellerNote = obj.ToString();
Expand Down Expand Up @@ -318,6 +332,9 @@ it contains JArray. JArray contains the order item categories. This is added to
case Operator.SupplementaryData:
supplementaryData = obj.ToString();
break;
case Operator.StaticToken:
staticToken = obj.ToString();
break;
}
}
}
Expand Down Expand Up @@ -702,5 +719,24 @@ public string GetSupplementaryData()
{
return this.supplementaryData;
}

/// <summary>
/// Get the SupplemetaryData
/// </summary>
/// <returns>string PaymentAuthenticationState</returns>
public string GetPaymentAuthenticationState()
{
return this.paymentAuthenticationState;
}

/// <summary>
/// Get the StaticToken
/// </summary>
/// <returns>string StaticToken</returns>
public string GetStaticToken()
{
return this.staticToken;
}

}
}
2 changes: 1 addition & 1 deletion AmazonPay/StandardPaymentRequests/ChargeRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public ChargeRequest WithAmazonReferenceId(string amazon_reference_id)
chargeType = "BillingAgreement";
getBillingAgreementDetails.WithAmazonBillingAgreementId(amazon_reference_id);
setBillingAgreementDetails.WithAmazonBillingAgreementId(amazon_reference_id);
confirmBillingAgreement.WithAmazonBillingreementId(amazon_reference_id);
confirmBillingAgreement.WithAmazonBillingAgreementId(amazon_reference_id);
authorizeOnBillingAgreement.WithAmazonBillingAgreementId(amazon_reference_id);
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion AmazonPay/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Common.Logging" version="2.0.0" targetFramework="net20" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net20" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net20" />
</packages>
6 changes: 4 additions & 2 deletions UnitTests/AmazonPayUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ public void TestGetOrderReferenceDetails()
Assert.AreEqual(oroResponseObject.GetBillingAddressDetails().GetCountryCode(), "US");
Assert.AreEqual(oroResponseObject.GetBillingAddressDetails().GetName(), "Christopher C. Conn");
Assert.AreEqual(oroResponseObject.GetSupplementaryData(), sampleSupplementaryData);

Assert.AreEqual(oroResponseObject.GetPaymentAuthenticationState(), "REQUIRED");
Assert.AreEqual(oroResponseObject.GetStaticToken(), "z50RVvXyKBkhRX40zy2VazJIfJBRmhGF32FUW9Np6PU=");

//Test Payment Descriptor
Assert.AreEqual(oroResponseObject.GetAmazonBalanceFirst().ToString(), "False");
Assert.AreNotEqual(oroResponseObject.GetAmazonBalanceFirst().ToString(), "true");
Expand Down Expand Up @@ -1528,7 +1530,7 @@ public void TestConfirmBillingAgreement()
client = new Client(clientConfig);
client.SetTimeStamp("0000");
ConfirmBillingAgreementRequest confirmBillingAgreement = new ConfirmBillingAgreementRequest();
confirmBillingAgreement.WithAmazonBillingreementId("test")
confirmBillingAgreement.WithAmazonBillingAgreementId("test")
.WithMerchantId("test")
.WithMWSAuthToken("test");
client.ConfirmBillingAgreement(confirmBillingAgreement);
Expand Down
6 changes: 3 additions & 3 deletions UnitTests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTests")]
[assembly: AssemblyCopyright("Copyright © 2017-2018")]
[assembly: AssemblyCopyright("Copyright © 2017-2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.5.0.0")]
[assembly: AssemblyFileVersion("3.5.0.0")]
[assembly: AssemblyVersion("3.5.1.0")]
[assembly: AssemblyFileVersion("3.5.1.0")]
8 changes: 7 additions & 1 deletion UnitTests/TestFiles/GetOrderReferenceDetails.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<GetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
<GetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
<GetOrderReferenceDetailsResult>
<OrderReferenceDetails>
<PaymentServiceProviderAttributes>
Expand Down Expand Up @@ -42,11 +42,17 @@
<CurrencyCode>USD</CurrencyCode>
<Amount>1.29</Amount>
</OrderTotal>
<PaymentAuthenticationStatus>
<State>REQUIRED</State>
</PaymentAuthenticationStatus>
<Buyer>
<Name>John Green</Name>
<Email>test@gmail.com</Email>
</Buyer>
<ReleaseEnvironment>Sandbox</ReleaseEnvironment>
<PaymentReference>
<StaticToken>z50RVvXyKBkhRX40zy2VazJIfJBRmhGF32FUW9Np6PU=</StaticToken>
</PaymentReference>
<SellerNote>1st Amazon Pay OneTime Checkout Order</SellerNote>
<AmazonOrderReferenceId>S01-9111020-6707923</AmazonOrderReferenceId>
<CreationTimestamp>2017-07-23T21:58:56.816Z</CreationTimestamp>
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<None Include="App.config" />
<None Include="packages.config" />
Expand Down
1 change: 1 addition & 0 deletions UnitTests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<packages>
<package id="Common.Logging" version="2.0.0" targetFramework="net20" />
<package id="NUnit" version="2.6.4" targetFramework="net20" />
<package id="NUnitTestAdapter" version="2.1.1" targetFramework="net20" />
</packages>
Binary file modified lib/AmazonPay.dll
Binary file not shown.
Binary file modified lib/AmazonPay.pdb
Binary file not shown.
Binary file modified lib/Newtonsoft.Json.dll
Binary file not shown.
Loading

0 comments on commit 510100f

Please sign in to comment.