Skip to content

Commit

Permalink
Merge pull request #482 from HotcakesCommerce/development
Browse files Browse the repository at this point in the history
Syncing dev and main
  • Loading branch information
WillStrohl authored Dec 6, 2023
2 parents 5438467 + 7f278f7 commit 603998f
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 222 deletions.
4 changes: 2 additions & 2 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

<!-- Version Number -->
<PropertyGroup Condition=" '$(BUILD_NUMBER)' == '' ">
<Version>03.08.00</Version>
<Version>03.08.01</Version>
<FileVersion>01.00.00</FileVersion>
<InformationalVersion>01.00.00</InformationalVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(BUILD_NUMBER)' != '' ">
<!-- Build Server Number -->
<Version>03.08.00</Version>
<Version>03.08.01</Version>
<FileVersion>$(BUILD_NUMBER)</FileVersion>
<InformationalVersion>$(BUILD_NUMBER)</InformationalVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: CLSCompliant(false)]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("3.08.00")]
[assembly: AssemblyVersion("3.08.01")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Expand Down
19 changes: 12 additions & 7 deletions Libraries/Hotcakes.PaypalWebServices/RestPaypalApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using PayPalCheckoutSdk.Core;
using PayPalCheckoutSdk.Orders;
Expand Down Expand Up @@ -207,23 +208,23 @@ public async Task<HttpResponse> createOrder(
AmountWithBreakdown = new AmountWithBreakdown
{
CurrencyCode = currencyCodeType,
Value = orderTotal,
Value = formatAmount(orderTotal),
AmountBreakdown = new AmountBreakdown
{
ItemTotal = new Money
{
CurrencyCode = currencyCodeType,
Value = itemsTotal
Value = formatAmount(itemsTotal)
},
Shipping = new Money
{
CurrencyCode = currencyCodeType,
Value = shippingTotal
Value = formatAmount(shippingTotal)
},
TaxTotal = new Money
{
CurrencyCode = currencyCodeType,
Value = taxTotal
Value = formatAmount(taxTotal)
},
}
},
Expand Down Expand Up @@ -282,18 +283,18 @@ public async Task<HttpResponse> createOrder(
AmountWithBreakdown = new AmountWithBreakdown()
{
CurrencyCode = currencyCodeType,
Value = orderTotal,
Value = formatAmount(orderTotal),
AmountBreakdown = new AmountBreakdown()
{
ItemTotal = new Money
{
CurrencyCode = currencyCodeType,
Value = itemsTotal
Value = formatAmount(itemsTotal)
},
TaxTotal = new Money
{
CurrencyCode = currencyCodeType,
Value = taxTotal
Value = formatAmount(taxTotal)
},
}
}
Expand All @@ -310,6 +311,10 @@ public async Task<HttpResponse> createOrder(
return response;
}

private string formatAmount(string amount)
{
return string.IsNullOrEmpty(amount) ? amount : Regex.Replace(amount, "[, ]", "");
}

public async Task<HttpResponse> GetOrder(string orderId)
{
Expand Down
Loading

0 comments on commit 603998f

Please sign in to comment.