mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
PayPal: Add idempotency ID as per https://developer.paypal.com/api/rest/reference/idempotency/
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
import copy
|
||||
import hashlib
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
import requests
|
||||
from django.core.cache import cache
|
||||
@@ -110,6 +111,9 @@ class PayPalHttpClient(VendorPayPalHttpClient):
|
||||
if self.environment.partner_id:
|
||||
request.headers["PayPal-Partner-Attribution-Id"] = self.environment.partner_id
|
||||
|
||||
if "PayPal-Request-Id" not in request.headers:
|
||||
request.headers["PayPal-Request-Id"] = str(uuid.uuid4())
|
||||
|
||||
def execute(self, request):
|
||||
reqCpy = copy.deepcopy(request)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user