Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added StripeTransfer/Summary entities so they can be parsed in events…

… (still need to document this) and made mapper public (thanks Chris). fixed some small nits with the readme
  • Loading branch information...
commit fa2da0dabf82296a583e4d40a299a934f9d4674c 1 parent dd73c3a
@jaymedavis jaymedavis authored
View
2  Stripe.net.nuspec
@@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Stripe.net</id>
- <version>1.1.10</version>
+ <version>1.1.11</version>
<authors>Jayme Davis</authors>
<owners>Jayme Davis</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
View
BIN  build/Stripe.net 1.1.10.zip
Binary file not shown
View
BIN  build/Stripe.net 1.1.11.zip
Binary file not shown
View
2  rakefile.rb
@@ -1,6 +1,6 @@
require 'albacore'
-VERSION = "1.1.10"
+VERSION = "1.1.11"
task :default => [:build, :merge, :output, :package]
View
4 readme.md
@@ -143,7 +143,7 @@ a credit card or token, and various meta data.
// set these properties if using a card
myCustomer.CardNumber = "4242424242424242";
- myCustomer.CardExpirationYear = "2012"
+ myCustomer.CardExpirationYear = "2012";
myCustomer.CardExpirationMonth = "10";
myCustomer.CardAddressCountry = "US"; // optional
myCustomer.CardAddressLine1 = "24 Beef Flank St"; // optional
@@ -156,7 +156,7 @@ a credit card or token, and various meta data.
// set this property if using a token
myCustomer.TokenId = *tokenId*;
- myCustomer.Plan = *planId*; // only if you have a plan
+ myCustomer.PlanId = *planId*; // only if you have a plan
myCustomer.Coupon = *couponId*; // only if you have a coupon
myCustomer.TrialEnd = DateTime.UtcNow.AddMonths(1); // when the customers trial ends (overrides the plan if applicable)
View
9 src/SharedAssemblyInfo.cs
@@ -0,0 +1,9 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+[assembly: AssemblyTitle("Stripe.net")]
+[assembly: AssemblyDescription("A .net client api for http://stripe.com")]
+[assembly: AssemblyCompany("Jayme Davis")]
+[assembly: AssemblyProduct("Stripe.net")]
+[assembly: AssemblyCopyright("Copyright (C) Jayme Davis 2012")]
+[assembly: AssemblyVersion("1.1.11")]
+
View
38 src/Stripe/Entities/StripeEventData.cs
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
namespace Stripe
{
@@ -9,42 +10,5 @@ public class StripeEventData
[JsonProperty("object")]
public dynamic Object { get; set; }
-
- public object StripeType { get; private set; }
-
- public void ParseStripeType()
- {
- if (Object == null) return;
-
- Newtonsoft.Json.Linq.JObject data = (Newtonsoft.Json.Linq.JObject) Object;
- Newtonsoft.Json.Linq.JToken value;
- if (data.TryGetValue("object", out value))
- {
- switch (value.ToString())
- {
- case "charge":
- StripeType = Mapper<StripeCharge>.MapFromJson(Object.ToString());
- break;
- case "coupon":
- StripeType = Mapper<StripeCoupon>.MapFromJson(Object.ToString());
- break;
- case "customer":
- StripeType = Mapper<StripeCustomer>.MapFromJson(Object.ToString());
- break;
- case "event":
- StripeType = Mapper<StripeEvent>.MapFromJson(Object.ToString());
- break;
- case "invoice":
- StripeType = Mapper<StripeInvoice>.MapFromJson(Object.ToString());
- break;
- case "subscription":
- StripeType = Mapper<StripeSubscription>.MapFromJson(Object.ToString());
- break;
- case "transfer":
- StripeType = Mapper<StripeTransfer>.MapFromJson(Object.ToString());
- break;
- }
- }
- }
}
}
View
37 src/Stripe/Entities/StripeTransfer.cs
@@ -5,27 +5,28 @@
namespace Stripe
{
- public class StripeTransfer
- {
- [JsonProperty("date")]
- [JsonConverter(typeof(StripeDateTimeConverter))]
- public DateTime Date { get; set; }
+ public class StripeTransfer
+ {
+ [JsonProperty("id")]
+ public string Id { get; set; }
- [JsonProperty("amount")]
- public int? AmountInCents { get; set; }
+ [JsonProperty("date")]
+ [JsonConverter(typeof(StripeDateTimeConverter))]
+ public DateTime Date { get; set; }
- [JsonProperty("status")]
- public string Status { get; set; }
+ [JsonProperty("amount")]
+ public int? AmountInCents { get; set; }
- [JsonProperty("description")]
- public string Description { get; set; }
+ [JsonProperty("status")]
+ public string Status { get; set; }
- [JsonProperty("other_transfers")]
- public List<string> OtherTransfers { get; set; }
+ [JsonProperty("description")]
+ public string Description { get; set; }
- [JsonProperty("summary")]
- public StripeTransferSummary Summary { get; set; }
+ [JsonProperty("other_transfers")]
+ public List<string> OtherTransfers { get; set; }
-
- }
-}
+ [JsonProperty("summary")]
+ public StripeTransferSummary Summary { get; set; }
+ }
+}
View
79 src/Stripe/Entities/StripeTransferSummary.cs
@@ -2,66 +2,39 @@
namespace Stripe
{
- public class StripeTransferSummary
- {
- /// <summary>
- /// Count of adjustments
- /// </summary>
- [JsonProperty("adjustment_count")]
- public int? AdjustmentCount { get; set; }
+ public class StripeTransferSummary
+ {
+ [JsonProperty("adjustment_count")]
+ public int? AdjustmentCount { get; set; }
- /// <summary>
- /// Total of adjustments applied to account, in cents.
- /// </summary>
- [JsonProperty("adjustment_gross")]
- public int? AdjustmentAmountInCents { get; set; }
+ [JsonProperty("adjustment_gross")]
+ public int? AdjustmentAmountInCents { get; set; }
- /// <summary>
- /// Count of successful charges
- /// </summary>
- [JsonProperty("charge_count")]
- public int? ChargeCount { get; set; }
+ [JsonProperty("charge_count")]
+ public int? ChargeCount { get; set; }
- /// <summary>
- /// Total fees, in cents
- /// </summary>
- [JsonProperty("charge_fees")]
- public int? ChargeFeesInCents { get; set; }
+ [JsonProperty("charge_fees")]
+ public int? ChargeFeesInCents { get; set; }
- /// <summary>
- /// Total amount successfully charged to customers, in cents.
- /// </summary>
- [JsonProperty("charge_gross")]
- public int? ChargeAmountInCents { get; set; }
+ [JsonProperty("charge_gross")]
+ public int? ChargeAmountInCents { get; set; }
- /// <summary>
- /// Net transfer, in cents
- /// </summary>
- [JsonProperty("net")]
- public int? NetAmountInCents { get; set; }
+ [JsonProperty("net")]
+ public int? NetAmountInCents { get; set; }
- /// <summary>
- /// Count of refunds issued
- /// </summary>
- [JsonProperty("refund_count")]
- public int? RefundCount { get; set; }
+ [JsonProperty("refund_count")]
+ public int? RefundCount { get; set; }
- /// <summary>
- /// Total fee amount for refunds, in cents
- /// </summary>
- [JsonProperty("refund_fees")]
- public int? RefundFeesInCents { get; set; }
+ [JsonProperty("refund_fees")]
+ public int? RefundFeesInCents { get; set; }
- /// <summary>
- /// Total amount of refunds issued, in cents
- /// </summary>
- [JsonProperty("refund_gross")]
- public int? RefundAmountInCents { get; set; }
+ [JsonProperty("refund_gross")]
+ public int? RefundAmountInCents { get; set; }
- [JsonProperty("validation_count")]
- public int? ValidationCount { get; set; }
+ [JsonProperty("validation_count")]
+ public int? ValidationCount { get; set; }
- [JsonProperty("validation_fees")]
- public int? ValidationFeeAmountInCents { get; set; }
- }
-}
+ [JsonProperty("validation_fees")]
+ public int? ValidationFeeAmountInCents { get; set; }
+ }
+}
View
2  src/Stripe/Infrastructure/Mapper.cs
@@ -7,7 +7,7 @@
namespace Stripe
{
- internal static class Mapper<T>
+ public static class Mapper<T>
{
public static List<T> MapCollectionFromJson(string json, string token = "data")
{
Please sign in to comment.
Something went wrong with that request. Please try again.