Skip to content

Commit

Permalink
Fix: Change Payment.routeminimum to string (#33)
Browse files Browse the repository at this point in the history
<!--
We appreciate the effort for this pull request but before that please
make sure you read the contribution guidelines, then fill out the blanks
below.

Please format the PR title appropriately based on the type of change:
  <type>[!]: <description>
Where <type> is one of: docs, chore, feat, fix, test.
Add a '!' after the type for breaking changes (e.g. feat!: new breaking
feature).

**All third-party contributors acknowledge that any contributions they
provide will be made under the same open-source license that the
open-source project is provided under.**

Please enter each Issue number you are resolving in your PR after one of
the following words [Fixes, Closes, Resolves]. This will auto-link these
issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->

# Fixes

- Changed routeMinimum from double to string
- Added test to demonstrate Payment.routeMinimum usage
- Bumped up the version number and added README

### Checklist

- [x] I acknowledge that all my contributions will be made under the
project's license
- [x] I have made a material change to the repo (functionality, testing,
spelling, grammar)
- [x] I have titled the PR appropriately
- [x] I have updated my branch with the main branch
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added the necessary documentation about the functionality
in the appropriate .md file
- [x] I have added inline documentation to the code I modified

If you have questions, create a GitHub Issue in this repository.
  • Loading branch information
Aman-Aalam authored Jul 19, 2024
1 parent 6c1e0d6 commit 1476cbc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions tests/PaymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public void testCreatePayments()
payment.batchId = batch.id;
payment.taxReportable = false;
payment = trolley.payment.Create(payment);
if(payment.routeMinimum != null){
Assert.IsTrue(Convert.ToDouble(payment.routeMinimum)>0);
}else{
Assert.IsNull(payment.routeMinimum);
}
Assert.IsNotNull(payment);
Assert.IsFalse(payment.taxReportable);

Expand Down
4 changes: 2 additions & 2 deletions trolley/JsonHelpers/JsonHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ protected class PaymentJsonHelper
private string returnedAt;
private string returnedNote;
private List<string> returnedReason;
private double routeMinimum;
private string routeMinimum;
private string routeType;
private string settledAt;
private double taxBasisAmount;
Expand Down Expand Up @@ -1787,7 +1787,7 @@ public Compliance Compliance
public string ReturnedAt { get => returnedAt; set => returnedAt = value; }
public string ReturnedNote { get => returnedNote; set => returnedNote = value; }
public List<string> ReturnedReason { get => returnedReason; set => returnedReason = value; }
public double RouteMinimum { get => routeMinimum; set => routeMinimum = value; }
public string RouteMinimum { get => routeMinimum; set => routeMinimum = value; }
public string RouteType { get => routeType; set => routeType = value; }
public string SettledAt { get => settledAt; set => settledAt = value; }
public double TaxBasisAmount { get => taxBasisAmount; set => taxBasisAmount = value; }
Expand Down
2 changes: 1 addition & 1 deletion trolley/Types/Payment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class Payment : ITrolleyMappable
public string returnedAt;
public string returnedNote;
public List<string> returnedReason;
public double? routeMinimum;
public string routeMinimum;
public string routeType;
public string settledAt;
public double? taxBasisAmount;
Expand Down
2 changes: 1 addition & 1 deletion trolley/trolley.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<RootNamespace>Trolley</RootNamespace>
<PackageId>trolleyhq</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.0.2</Version>
<Version>2.1.3</Version>
<PackageDescription>The official Trolley .NET SDK to interface with the Trolley API (https://www.trolley.com/)</PackageDescription>
<Copyright>Copyright 2020</Copyright>
<Authors>Jesse Tremblay, Jesse Silber, Joshua Cunningham, Aman Aalam</Authors>
Expand Down
6 changes: 5 additions & 1 deletion trolley/trolley.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>trolleyhq</id>
<version>2.0.2</version>
<version>2.1.3</version>
<title>$title$</title>
<authors>Jesse Tremblay, Jesse Silber, Joshua Cunningham, Aman Aalam</authors>
<owners>aman.trolley, trolley-developers, PaymentRailsJesse, joshuapr</owners>
Expand All @@ -12,5 +12,9 @@
<releaseNotes>Covered all APIs.</releaseNotes>
<copyright>Copyright 2020</copyright>
<tags>Trolley net sdk PaymentRails</tags>
<readme>docs\README.md</readme>
</metadata>
<files>
<file src="README.md" target="docs\" />
</files>
</package>

0 comments on commit 1476cbc

Please sign in to comment.