Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for managing External Accounts #1072

Merged
merged 2 commits into from
Jan 16, 2018

Conversation

remi-stripe
Copy link
Contributor

@remi-stripe remi-stripe commented Dec 15, 2017

This PR adds support for managing External Accounts on Custom accounts.

  • Support passing a token (card or bank account) for creation
  • Support passing bank account details for creation
  • No support for passing card details as this breaks PCI compliance and is blocked by the API.
  • Support updating card information on an external account

cc @ob-stripe

Fixes #980.

@remi-stripe remi-stripe force-pushed the remi-add-external-accounts branch 2 times, most recently from 7629b01 to 3c7a82d Compare December 15, 2017 14:32
@remi-stripe remi-stripe force-pushed the remi-add-external-accounts branch from 3c7a82d to ec60dae Compare December 15, 2017 15:34
@@ -1,29 +0,0 @@
using System.Linq;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this because I don't think it's useful to verify the exception. Especially because it's an API decision that we will likely lift in the future

}

[Fact]
public void list_contents_equal()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged the list tests to avoid having extra fixtures

@@ -50,7 +50,7 @@ public class StripeAccount : StripeEntityWithId
public string Email { get; set; }

[JsonProperty("external_accounts")]
public StripeList<Source> ExternalAccounts { get; set; }
public StripeList<StripeExternalAccount> ExternalAccounts { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this makes it a breaking change. be careful @ob-stripe


namespace Stripe
{
public class StripeExternalAccountCardUpdateOptions : INestedOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed an extra class because:

  • you can only update some properties
  • those are sent as a top level parameter and not under external_account


[JsonProperty("external_account")]
public StripeAccountBankAccountOptions ExternalAccountBankAccount { get; set; }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support card on creation because it's blocked in the API by default. would be trivial to add if needed since there's StripeAccountCardOptions

@remi-stripe
Copy link
Contributor Author

r? @ob-stripe
cc @stripe/api-libraries

@ob-stripe
Copy link
Contributor

@remi-stripe Is this still a WIP?

@remi-stripe remi-stripe changed the title [WIP] Add support for managing External Accounts Add support for managing External Accounts Dec 27, 2017
@remi-stripe
Copy link
Contributor Author

@ob-stripe sorry for the mixup, it's ready to be reviewed

@ob-stripe
Copy link
Contributor

lgtm overall, though I think we should wait until after the holiday freeze to release this as it's a breaking change.

We'll also need to update the API reference to document these new methods.

@brandur-stripe
Copy link
Contributor

Love the "Breaking API Change" label, haha (and this PR is great).

Just bumping this now that we're post-holiday. Let me know if you guys need any support on the changes to the reference documentation (or just file a DX ticket — Tim's on run, so it should have eyes on it tout suite).

@ob-stripe ob-stripe merged commit e783add into master Jan 16, 2018
@ob-stripe ob-stripe deleted the remi-add-external-accounts branch January 16, 2018 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants