mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 07:43:54 +08:00
use the same error structure in apple endpoints
This commit is contained in:
parent
6e0394d980
commit
f4f2db0f04
2 changed files with 4 additions and 4 deletions
|
@ -51,7 +51,7 @@ def apple_process_payment():
|
|||
if apple_sub:
|
||||
return jsonify(ok=True), 200
|
||||
|
||||
return jsonify(ok=False), 400
|
||||
return jsonify(error="Processing failed"), 400
|
||||
|
||||
|
||||
@api_bp.route("/apple/update_notification", methods=["GET", "POST"])
|
||||
|
@ -287,7 +287,7 @@ def apple_update_notification():
|
|||
original_transaction_id,
|
||||
)
|
||||
LOG.d("request data %s", data)
|
||||
return jsonify(ok=False), 400
|
||||
return jsonify(error="Processing failed"), 400
|
||||
|
||||
|
||||
def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]:
|
||||
|
|
|
@ -24,7 +24,7 @@ def test_apple_process_payment(flask_client):
|
|||
|
||||
# will fail anyway as there's apple secret is not valid
|
||||
assert r.status_code == 400
|
||||
assert r.json == {"ok": False}
|
||||
assert r.json == {"error": "Processing failed"}
|
||||
|
||||
|
||||
def test_apple_update_notification(flask_client):
|
||||
|
@ -213,4 +213,4 @@ def test_apple_update_notification(flask_client):
|
|||
|
||||
# will fail anyway as there's no such AppleSub in Test DB
|
||||
assert r.status_code == 400
|
||||
assert r.json == {"ok": False}
|
||||
assert r.json == {"error": "Processing failed"}
|
||||
|
|
Loading…
Reference in a new issue