From d996ca1ee155570230f80123f958ec1c6ba9fb0e Mon Sep 17 00:00:00 2001 From: Maarten Balliauw Date: Tue, 2 Dec 2014 21:19:14 +0100 Subject: [PATCH] SubscriptionStatus enum added --- .../{Status.cs => OrderStatus.cs} | 2 +- src/SyntaxTree.FastSpring.Api/Payment.cs | 2 +- src/SyntaxTree.FastSpring.Api/ShortOrder.cs | 2 +- src/SyntaxTree.FastSpring.Api/Subscription.cs | 4 ++-- .../SubscriptionStatus.cs | 13 +++++++++++++ .../SubscriptionStatusReason.cs | 17 +++++++++++++++++ .../SyntaxTree.FastSpring.Api.csproj | 4 +++- 7 files changed, 38 insertions(+), 6 deletions(-) rename src/SyntaxTree.FastSpring.Api/{Status.cs => OrderStatus.cs} (94%) create mode 100644 src/SyntaxTree.FastSpring.Api/SubscriptionStatus.cs create mode 100644 src/SyntaxTree.FastSpring.Api/SubscriptionStatusReason.cs diff --git a/src/SyntaxTree.FastSpring.Api/Status.cs b/src/SyntaxTree.FastSpring.Api/OrderStatus.cs similarity index 94% rename from src/SyntaxTree.FastSpring.Api/Status.cs rename to src/SyntaxTree.FastSpring.Api/OrderStatus.cs index c9f7689..ec9323d 100644 --- a/src/SyntaxTree.FastSpring.Api/Status.cs +++ b/src/SyntaxTree.FastSpring.Api/OrderStatus.cs @@ -2,7 +2,7 @@ namespace SyntaxTree.FastSpring.Api { - public enum Status + public enum OrderStatus { [XmlEnum("open")] Open, diff --git a/src/SyntaxTree.FastSpring.Api/Payment.cs b/src/SyntaxTree.FastSpring.Api/Payment.cs index 12b1c13..1b0b182 100644 --- a/src/SyntaxTree.FastSpring.Api/Payment.cs +++ b/src/SyntaxTree.FastSpring.Api/Payment.cs @@ -6,7 +6,7 @@ namespace SyntaxTree.FastSpring.Api public sealed class Payment { [XmlElement("status")] - public Status Status { get; set; } + public OrderStatus OrderStatus { get; set; } [XmlElement("statusChanged")] public DateTime StatusChanged { get; set; } diff --git a/src/SyntaxTree.FastSpring.Api/ShortOrder.cs b/src/SyntaxTree.FastSpring.Api/ShortOrder.cs index 791b81d..a0a9335 100644 --- a/src/SyntaxTree.FastSpring.Api/ShortOrder.cs +++ b/src/SyntaxTree.FastSpring.Api/ShortOrder.cs @@ -10,7 +10,7 @@ public class ShortOrder public string Reference { get; set; } [XmlElement("status")] - public Status Status { get; set; } + public OrderStatus OrderStatus { get; set; } [XmlElement("statusChanged")] public DateTime StatusChanged { get; set; } diff --git a/src/SyntaxTree.FastSpring.Api/Subscription.cs b/src/SyntaxTree.FastSpring.Api/Subscription.cs index d831f43..114fdf0 100644 --- a/src/SyntaxTree.FastSpring.Api/Subscription.cs +++ b/src/SyntaxTree.FastSpring.Api/Subscription.cs @@ -7,13 +7,13 @@ namespace SyntaxTree.FastSpring.Api public sealed class Subscription { [XmlElement("status")] - public Status Status { get; set; } + public SubscriptionStatus OrderStatus { get; set; } [XmlElement("statusChanged")] public DateTime StatusChanged { get; set; } [XmlElement("statusReason")] - public string StatusReason { get; set; } + public SubscriptionStatusReason StatusReason { get; set; } [XmlElement("cancelable")] public bool Cancelable { get; set; } diff --git a/src/SyntaxTree.FastSpring.Api/SubscriptionStatus.cs b/src/SyntaxTree.FastSpring.Api/SubscriptionStatus.cs new file mode 100644 index 0000000..4d04741 --- /dev/null +++ b/src/SyntaxTree.FastSpring.Api/SubscriptionStatus.cs @@ -0,0 +1,13 @@ +using System.Xml.Serialization; + +namespace SyntaxTree.FastSpring.Api +{ + public enum SubscriptionStatus + { + [XmlEnum("active")] + Active, + + [XmlEnum("inactive")] + Inactive + } +} \ No newline at end of file diff --git a/src/SyntaxTree.FastSpring.Api/SubscriptionStatusReason.cs b/src/SyntaxTree.FastSpring.Api/SubscriptionStatusReason.cs new file mode 100644 index 0000000..286739e --- /dev/null +++ b/src/SyntaxTree.FastSpring.Api/SubscriptionStatusReason.cs @@ -0,0 +1,17 @@ +using System.Xml.Serialization; + +namespace SyntaxTree.FastSpring.Api +{ + public enum SubscriptionStatusReason + { + [XmlEnum("canceled-non-payment")] + CanceledNonPayent, + + + [XmlEnum("completed")] + Completed, + + [XmlEnum("canceled")] + Canceled + } +} \ No newline at end of file diff --git a/src/SyntaxTree.FastSpring.Api/SyntaxTree.FastSpring.Api.csproj b/src/SyntaxTree.FastSpring.Api/SyntaxTree.FastSpring.Api.csproj index 6ae96c5..e64baa5 100644 --- a/src/SyntaxTree.FastSpring.Api/SyntaxTree.FastSpring.Api.csproj +++ b/src/SyntaxTree.FastSpring.Api/SyntaxTree.FastSpring.Api.csproj @@ -48,9 +48,11 @@ - + + +