-
-
Notifications
You must be signed in to change notification settings - Fork 485
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 idempotency to Stripe Update Calls #1910
Open
arnav13081994
wants to merge
26
commits into
master
Choose a base branch
from
add_idempotency_to_update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
arnav13081994
force-pushed
the
add_idempotency_to_update
branch
from
April 2, 2023 05:04
ee12925
to
2c40e40
Compare
How is this PR split from #1909? I don't understand |
arnav13081994
force-pushed
the
add_idempotency_to_update
branch
from
April 20, 2023 13:24
2c40e40
to
3e01016
Compare
This was done because Stripe does not expose a separate url to access these objects and they can only be accessed with the Related Source Object
This was done because the "Source" event handler was receiving all events of the type source.X.Y which was causing a mismatch between the event type and the target object type. This is why the target object type was explicitly checked as done for the "Charge" event handler.
This was done because newly created Sourcetransaction objects cannot be retrieved as Stripe doesn't allow `retrieve` operation yet. And in order to retrieve by the related "Source" object we need the source to be attached to a "Customer" instance which will not always be the case and can't be known ahead of time as the order of webhooks is unreliable. This is why retrieving the data of the SourceTransaction object was skipped.
arnav13081994
force-pushed
the
add_idempotency_to_update
branch
from
April 20, 2023 14:00
3e01016
to
a4e1020
Compare
… Model This was done because one can create multiple independent update requests for the exact same Stripe object.
arnav13081994
force-pushed
the
add_idempotency_to_update
branch
from
April 20, 2023 15:20
a4e1020
to
2913a30
Compare
The _api_update() method now does the following: 1) Generates a new Idempotency Key object if not given one using the Stripe object's ID that is being updated. 2) Uses the Idempotency key (from 1)) to make the Stripe API call.
arnav13081994
force-pushed
the
add_idempotency_to_update
branch
from
April 20, 2023 15:22
2913a30
to
95dc37e
Compare
@jleclanche This PR builds on top of PR #1909 so only after that it is merged this would make sense. The first commit is PR #1909 squashed. |
jleclanche
force-pushed
the
master
branch
5 times, most recently
from
April 25, 2024 14:48
15e04c3
to
8727894
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR #1909 needs to be merged before merging this as this PR builds on top of it.
This PR adds support for the user to: