take into account /verifyReceipt can return 5**

This commit is contained in:
Son NK 2020-06-30 16:11:44 +02:00
parent 3754cee8f8
commit 40b4273111
1 changed files with 3 additions and 0 deletions

View File

@ -302,6 +302,9 @@ def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]:
r = requests.post(
_PROD_URL, json={"receipt-data": receipt_data, "password": password}
)
if r.status_code >= 500:
LOG.error("Apple server error, response:%s %s", r, r.content)
return None
if r.json() == {"status": 21007}:
# try sandbox_url