-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1071 from stripe/remi-add-account-debits
Add support for account debits
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/Stripe.net.Tests/charges/when_creating_a_charge_with_a_stripe_account.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Machine.Specifications; | ||
|
||
namespace Stripe.Tests | ||
{ | ||
public class when_creating_a_charge_with_a_stripe_account | ||
{ | ||
private static StripeAccount _stripeAccount; | ||
private static StripeCharge _stripeCharge; | ||
|
||
Establish context = () => | ||
{ | ||
// create a new custom account | ||
_stripeAccount = new StripeAccountService().Create(new StripeAccountCreateOptions() | ||
{ | ||
Country = "US", | ||
Type = StripeAccountType.Custom | ||
}); | ||
}; | ||
|
||
Because of = () => | ||
{ | ||
// charge the customer something | ||
_stripeCharge = new StripeChargeService().Create(new StripeChargeCreateOptions() | ||
{ | ||
Amount = 100, | ||
Currency = "usd", | ||
SourceTokenOrExistingSourceId = _stripeAccount.Id | ||
}); | ||
}; | ||
|
||
It should_have_the_right_source = () => | ||
_stripeCharge.Source.Account.ShouldNotBeNull(); | ||
|
||
It should_not_have_the_wrong_source = () => | ||
_stripeCharge.Source.Card.ShouldBeNull(); | ||
|
||
It should_have_the_right_source_type = () => | ||
_stripeCharge.Source.Type.ShouldEqual(SourceType.Account); | ||
|
||
It should_have_the_right_id = () => | ||
_stripeCharge.Source.Id.ShouldEqual(_stripeAccount.Id); | ||
|
||
It should_deserialize_the_account_properly = () => | ||
_stripeCharge.Source.Account.Id.ShouldEqual(_stripeAccount.Id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters