-
Notifications
You must be signed in to change notification settings - Fork 23
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
stripe connect support? #12
Comments
It's a good idea. Right now our stripe-erlang library only supports one private token per application, so implementing stripe connect (and all the refactoring it will require) can open up more possibilities. We'd need to implement these for standalone:
...and these for managed:
The managed flow is a lot more complex with more possible error scenarios (file uploads required?!), but that's the only route to go if we want a 100% custom-branded shop interface. The best path forward will be to add new functions with a required state/config/parameter variable as the first argument. We can retain the old API, default all old functions to create private state using the single-env-var key, then call the new config-based functions. I think the refactoring would look something like this: % Generate a default config map (or record) with our global key.
default_config() -> #{secretKey => env(auth_token)}.
% Original function arity. Move body of original to new config-accepting function.
% Now old function generates a default config and calls new config-accepting function.
charge_card(Amount, Currency, Card, Desc) ->
charge_card(default_config(), Amount, Currency, Card, Desc).
% New function (with body of original function) taking a Config parameter.
charge_card(Config, Amount, Currency, Card, Desc) ->
.
.
.
request_charge(Config, Fields). Beyond the In So, it's definitely possible, just slightly time consuming. I haven't looked into the testing endpoints for stripe connect yet, but if they exist we also need to add stripe connect testing of everything to the test suite as well. |
Forked it, gonna take a stab at this. Stay tuned. |
@mattsta : are you sure the refactoring you recommended is correct for managed accounts ? The secret key is always the same (it's your platform's secret key) but the only thing that's extra for managed accounts is the destination account (see for example here https://stripe.com/docs/recipes/on-demand-app how you process payments, you need to have a -d source={TOKEN} -d destination=acct_blabla). Lemme know if I'm missing something, please - thank you. |
https://stripe.com/docs/connect
So Stripe recently upgraded connect to be a proper marketplaces API (kickstarter, for instance, would be using a marketplace type system..
@mattsta i don't know if you've looked into this, but I was wondering if it would be better to integrate that into this library, or... ?
The text was updated successfully, but these errors were encountered: