Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adds setup fee support on subscriptions to the .NET library

  • Loading branch information...
commit bb037d9103cf27e2a133d7f42bc701698fe9fcb4 1 parent b5714da
@timrogers timrogers authored
View
3  GoCardlessSdk.Tests/Connect/ConnectTests.cs
@@ -148,6 +148,7 @@ public void NewSubscriptionUrl_IncOptionalParams_GeneratesCorrectUrl()
Name = "Premium Account",
Description = "test subscription",
IntervalCount = 12,
+ SetupFee = 10.00,
User = new UserRequest
{
Name = "John Smith",
@@ -169,7 +170,7 @@ public void NewSubscriptionUrl_IncOptionalParams_GeneratesCorrectUrl()
var url = GoCardless.Connect.NewSubscriptionUrl(request);
var expected =
- "https://sandbox.gocardless.com/connect/subscriptions/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=7b5a1fe9abc37a21c9cd8b22cd09dfbca9ec3d8d9cd1083796c6a4cbef666984&subscription%5Bamount%5D=15.00&subscription%5Bdescription%5D=test%20subscription&subscription%5Bexpires_at%5D=2013-03-24T19%3A32%3A22Z&subscription%5Binterval_count%5D=12&subscription%5Binterval_length%5D=1&subscription%5Binterval_unit%5D=month&subscription%5Bmerchant_id%5D=0190G74E3J&subscription%5Bname%5D=Premium%20Account&subscription%5Bstart_at%5D=2012-03-24T19%3A32%3A22Z&subscription%5Buser%5D%5Bbilling_address1%5D=Flat%201&subscription%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&subscription%5Buser%5D%5Bbilling_county%5D=Countyshire&subscription%5Buser%5D%5Bbilling_postcode%5D=N1%201AB&subscription%5Buser%5D%5Bbilling_town%5D=Townville&subscription%5Buser%5D%5Bemail%5D=john.smith%40example.com&subscription%5Buser%5D%5Bfirst_name%5D=John&subscription%5Buser%5D%5Blast_name%5D=Smith&subscription%5Buser%5D%5Bname%5D=John%20Smith&timestamp=2012-03-21T08%3A55%3A56Z";
+ "https://sandbox.gocardless.com/connect/subscriptions/new?client_id=test_id&nonce=Q9gMPVBZixfRiQ9VnRdDyrrMiskqT0ox8IT%2BHO3ReWMxavlco0Fw8rva%2BZcI&signature=7b5a1fe9abc37a21c9cd8b22cd09dfbca9ec3d8d9cd1083796c6a4cbef666984&subscription%5Bamount%5D=15.00&subscription%5Bdescription%5D=test%20subscription&subscription%5Bexpires_at%5D=2013-03-24T19%3A32%3A22Z&subscription%5Binterval_count%5D=12&subscription%5Binterval_length%5D=1&subscription%5Binterval_unit%5D=month&subscription%5Bmerchant_id%5D=0190G74E3J&subscription%5Bname%5D=Premium%20Account&subscription%5Bsetup_fee%5D=10.00&subscription%5Bstart_at%5D=2012-03-24T19%3A32%3A22Z&subscription%5Buser%5D%5Bbilling_address1%5D=Flat%201&subscription%5Buser%5D%5Bbilling_address2%5D=100%20Main%20Street&subscription%5Buser%5D%5Bbilling_county%5D=Countyshire&subscription%5Buser%5D%5Bbilling_postcode%5D=N1%201AB&subscription%5Buser%5D%5Bbilling_town%5D=Townville&subscription%5Buser%5D%5Bemail%5D=john.smith%40example.com&subscription%5Buser%5D%5Bfirst_name%5D=John&subscription%5Buser%5D%5Blast_name%5D=Smith&subscription%5Buser%5D%5Bname%5D=John%20Smith&timestamp=2012-03-21T08%3A55%3A56Z";
Assert.AreEqual(expected, url);
}
}
View
19 GoCardlessSdk/Connect/SubscriptionRequest.cs
@@ -3,15 +3,15 @@
namespace GoCardlessSdk.Connect
{
public class SubscriptionRequest
- {
- public SubscriptionRequest(string merchantId, decimal amount, int intervalLength, string intervalUnit)
- {
- Amount = amount;
- MerchantId = merchantId;
- IntervalLength = intervalLength;
- IntervalUnit = intervalUnit;
- }
-
+ {
+ public SubscriptionRequest(string merchantId, decimal amount, int intervalLength, string intervalUnit)
+ {
+ Amount = amount;
+ MerchantId = merchantId;
+ IntervalLength = intervalLength;
+ IntervalUnit = intervalUnit;
+ }
+
public decimal Amount { get; set; }
public string MerchantId { get; set; }
public int IntervalLength { get; set; }
@@ -22,6 +22,7 @@ public SubscriptionRequest(string merchantId, decimal amount, int intervalLength
public string Name { get; set; }
public string Description { get; set; }
public int? IntervalCount { get; set; }
+ public decimal SetupFee { get; set; }
public UserRequest User { get; set; }
}
Please sign in to comment.
Something went wrong with that request. Please try again.