mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +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 copy
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
import uuid
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
@@ -110,6 +111,9 @@ class PayPalHttpClient(VendorPayPalHttpClient):
|
|||||||
if self.environment.partner_id:
|
if self.environment.partner_id:
|
||||||
request.headers["PayPal-Partner-Attribution-Id"] = 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):
|
def execute(self, request):
|
||||||
reqCpy = copy.deepcopy(request)
|
reqCpy = copy.deepcopy(request)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user