Properly re-architecture the library to handle various source abstractions #1275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Today, the library has multiple separate classes that "abstract" away the complexity in the API around payment sources and payout destinations.
This is partly described in details in #1066 though it was written before External Accounts existed.
This PR will attempt to rewrite or merge classes so that we end up with only three concepts:
ExternalAccount
representing the objects where funds can be paid outPaymentSource
representing the objects acting as a Source on a ChargeSource
the existing API resource which would be a subset ofPaymentSource
cc @stripe/api-libraries
StripeBankAccount
andStripeExternalAccount
resourcesPayout
destination should be anExternalAccount
CustomerBankAccount
and move everything over to StripeBankAccountExternalAccount
StripeCardService
. Those have almost never been used in a few months and this has been deprecated for over 3 years now.Figure out a way to merge. We-re going to punt on this for now until we can support nested options properly (sharing parameter names under a different parent parameter name)StripeCardCreateOptions
andStripeCreditCardOptions