Skip to content

Commit

Permalink
Add BECS Source Type (#1568)
Browse files Browse the repository at this point in the history
* Add AU DD Source Type and Change Mandate Shape to Support Online Offline

* code review fix: BecsDebit to AuBecsDebit and parameter ordering changes
  • Loading branch information
shengwei-stripe authored and ob-stripe committed Apr 5, 2019
1 parent 063b17e commit 272239e
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Stripe.net/Entities/Sources/Source.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public class Source : StripeEntity, IHasId, IHasMetadata, IHasObject, IPaymentSo
[JsonProperty("alipay")]
public SourceAlipay Alipay { get; set; }

[JsonProperty("au_becs_debit")]
public SourceAuBecsDebit AuBecsDebit { get; set; }

[JsonProperty("bancontact")]
public SourceBancontact Bancontact { get; set; }

Expand Down
19 changes: 19 additions & 0 deletions src/Stripe.net/Entities/Sources/SourceAuBecsDebit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace Stripe
{
using Newtonsoft.Json;

public class SourceAuBecsDebit : StripeEntity
{
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

[JsonProperty("bsb_number")]
public string BsbNumber { get; set; }

[JsonProperty("fingerprint")]
public string Fingerprint { get; set; }

[JsonProperty("last3")]
public string Last3 { get; set; }
}
}
13 changes: 13 additions & 0 deletions src/Stripe.net/Services/Sources/SourceAuBecsDebitCreateOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Stripe
{
using Newtonsoft.Json;

public class SourceAuBecsDebitCreateOptions : INestedOptions
{
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

[JsonProperty("bsb_number")]
public string BsbNumber { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/Stripe.net/Services/Sources/SourceCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public class SourceCreateOptions : BaseOptions
Below we group all Source type specific paramters
*/

[JsonProperty("au_becs_debit")]
public SourceAuBecsDebitCreateOptions AuBecsDebit { get; set; }

[JsonProperty("bancontact")]
public SourceBancontactCreateOptions Bancontact { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Stripe
{
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class SourceMandateAcceptanceOfflineOptions : INestedOptions
{
[JsonProperty("contact_email")]
public string ContactEmail { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Stripe
{
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class SourceMandateAcceptanceOnlineOptions : INestedOptions
{
[JsonProperty("date")]
public DateTime? Date { get; set; }

[JsonProperty("ip")]
public string Ip { get; set; }

[JsonProperty("user_agent")]
public string UserAgent { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ public class SourceMandateAcceptanceOptions : INestedOptions
[JsonProperty("notification_method")]
public string NotificationMethod { get; set; }

[JsonProperty("offline")]
public SourceMandateAcceptanceOfflineOptions Offline { get; set; }

[JsonProperty("online")]
public SourceMandateAcceptanceOnlineOptions Online { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("user_agent")]
public string UserAgent { get; set; }
}
Expand Down

0 comments on commit 272239e

Please sign in to comment.