Closed kennethormandy closed 4 years ago
Hey thanks for the PR! This is interesting... I'm hesitant to save the entire token model, but I definitely see the need for it in this case. Let's think about this for a little bit. Eventually, I'd like to add support for public user registrations via OAuth and I worry that saving raw responses in a non-normalized format in bulk could put us in a corner.
Are you trying to store this information: https://stripe.com/docs/connect/oauth-reference#post-token-response
Or do you just need to access it prior to the token being saved?
Here are my ideas:
TokenModel::fromLeagueToken($tokenResponse);
to the TokenService and trigger an event, like you suggestedLet me know if you have any preference or comments on any of these implementations.
Are you trying to store this information: https://stripe.com/docs/connect/oauth-reference#post-token-response
Yes that’s correct, I’m saving the stripe_user_id
, but might also need access to livemode
too.
I think any of the options would work for me, my preference would probably be one of the first two as well. Right now I’m storing it independently in another field, so I don’t need the whole request stored indefinitely.
Just released 2.1.3 that should address this!
In the integration I’m making, I found there was extra information from Stripe I needed to save from the original token response.
This adds that original token as
response
, so it’s accessible via events.If you’d prefer, I could add a new
EVENT_BEFORE_TOKEN_RESPONSE_MODIFIED
event or similar instead, before the token is passed toTokenModel::fromLeagueToken()
Or, open to other suggestions if this is already possible to work around and I’m missing something. Thanks!