Skip to content

Commit

Permalink
Added stripe_obj kwarg to StripeModel.get_or_create_idempotency_key
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav13081994 committed Apr 20, 2023
1 parent c36eacf commit 2913a30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions djstripe/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def api_retrieve(self, api_key=None, stripe_account=None):
)

@classmethod
def get_or_create_idempotency_key(cls, action, idempotency_key):
def get_or_create_idempotency_key(cls, action, idempotency_key, stripe_obj_id=""):
"""
Creates and returns an idempotency_key if not given.
"""
Expand All @@ -216,7 +216,7 @@ def get_or_create_idempotency_key(cls, action, idempotency_key):
object_type=cls.__name__.lower(),
action=action,
livemode=djstripe_settings.STRIPE_LIVE_MODE,
stripe_obj_id=kwargs.get("stripe_obj_id", ""),
stripe_obj_id=stripe_obj_id,
)

return idempotency_key
Expand Down

0 comments on commit 2913a30

Please sign in to comment.