-
-
Notifications
You must be signed in to change notification settings - Fork 483
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 Create Calls #1909
base: master
Are you sure you want to change the base?
Commits on Apr 20, 2023
-
Configuration menu - View commit details
-
Copy full SHA for afe87b0 - Browse repository at this point
Copy the full SHA afe87b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 18f2bfe - Browse repository at this point
Copy the full SHA 18f2bfeView commit details -
Added SourceTransaction.get_stripe_dashboard_url() method
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
Configuration menu - View commit details
-
Copy full SHA for 2215029 - Browse repository at this point
Copy the full SHA 2215029View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a05fea - Browse repository at this point
Copy the full SHA 0a05feaView commit details -
Configuration menu - View commit details
-
Copy full SHA for eae5870 - Browse repository at this point
Copy the full SHA eae5870View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e8e6da - Browse repository at this point
Copy the full SHA 8e8e6daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f98077 - Browse repository at this point
Copy the full SHA 2f98077View commit details -
Refactored Source object event handler into its own independent handler
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.
Configuration menu - View commit details
-
Copy full SHA for 8dd521a - Browse repository at this point
Copy the full SHA 8dd521aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 869d3c4 - Browse repository at this point
Copy the full SHA 869d3c4View commit details -
Updated _handle_crud_like_event for SourceTransaction Objects
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.
Configuration menu - View commit details
-
Copy full SHA for ffc3f5c - Browse repository at this point
Copy the full SHA ffc3f5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9372d6f - Browse repository at this point
Copy the full SHA 9372d6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c89f6fc - Browse repository at this point
Copy the full SHA c89f6fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for bab69e7 - Browse repository at this point
Copy the full SHA bab69e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 493dd0a - Browse repository at this point
Copy the full SHA 493dd0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 066d834 - Browse repository at this point
Copy the full SHA 066d834View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ba678e - Browse repository at this point
Copy the full SHA 8ba678eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 71e35ad - Browse repository at this point
Copy the full SHA 71e35adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c56dca - Browse repository at this point
Copy the full SHA 5c56dcaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 10012c7 - Browse repository at this point
Copy the full SHA 10012c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9800773 - Browse repository at this point
Copy the full SHA 9800773View commit details -
Configuration menu - View commit details
-
Copy full SHA for 539ed88 - Browse repository at this point
Copy the full SHA 539ed88View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1e176b - Browse repository at this point
Copy the full SHA b1e176bView commit details -
Updated the get_idempotency_key function
The function whenever called always creates a new idempotency key. This was done because the older implementation was only suitable for Customer.create() method as was not generic to handle all `create` or `update` calls.
Configuration menu - View commit details
-
Copy full SHA for e4a8ba8 - Browse repository at this point
Copy the full SHA e4a8ba8View commit details -
Updated Customer.purge() method to not delete the associated idempote…
…ncy_key This was done because in the updated flow we ALWAYS generate a new idempotency_key for a request if one is not provided. The old flow was only applicable for Customer creation with a given user as a subscriber. Besides re-using these keys are pointless after a period of 24 hours anyway.
Configuration menu - View commit details
-
Copy full SHA for 94ee2dd - Browse repository at this point
Copy the full SHA 94ee2ddView commit details -
Renamed get_idempotency_key to create_idempotency_key
This was done to better reflect the functionality of the function create_idempotency_key.
Configuration menu - View commit details
-
Copy full SHA for 658df74 - Browse repository at this point
Copy the full SHA 658df74View commit details -
Added Idempotencykey.update_action_field staticmethod
This is a helper method to update the action model field post object creation with the stripe object's id to ease reference of the idempotency_key used to create or update the stripe object.
Configuration menu - View commit details
-
Copy full SHA for ba8020c - Browse repository at this point
Copy the full SHA ba8020cView commit details -
Added StripeModel.get_or_create_idempotency_key
This was done in order to populate the idempotency_key and use it to make the call on behalf of the user in case they do not provide us with one.
Configuration menu - View commit details
-
Copy full SHA for 67dee8d - Browse repository at this point
Copy the full SHA 67dee8dView commit details -
Updated StripeModel._api_create to use Idempotency Key object
The _api_create method now does the following: 1) Generated a new Idempotency Key object if not given one. 2) Uses the Idempotency key (from 1)) to make the Stripe API call. 3) Updates the action model field of the Idempotency Key object with the id of the so created Stripe object.
Configuration menu - View commit details
-
Copy full SHA for 56e4565 - Browse repository at this point
Copy the full SHA 56e4565View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01d95c1 - Browse repository at this point
Copy the full SHA 01d95c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 832fd36 - Browse repository at this point
Copy the full SHA 832fd36View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2a8672 - Browse repository at this point
Copy the full SHA d2a8672View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8e278c - Browse repository at this point
Copy the full SHA e8e278cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0308c33 - Browse repository at this point
Copy the full SHA 0308c33View commit details