Align avatar recharge plan IDs with WeChat virtual products
This commit is contained in:
@@ -30,8 +30,7 @@ def test_huihui_virtual_callback_requires_signature_and_exact_order_details(auth
|
||||
user = db.query(User).filter(User.id == context["owner"].id).one()
|
||||
user.wechat_mp_openid = "openid-huihui-callback"
|
||||
user.wechat_mp_session_key = "session-huihui-callback"
|
||||
plan = db.query(TokenPlan).filter(TokenPlan.id == "1").one()
|
||||
plan.virtual_product_id = "points_plan_1"
|
||||
plan = db.query(TokenPlan).filter(TokenPlan.id == "Basic").one()
|
||||
db.commit()
|
||||
finally:
|
||||
db.close()
|
||||
@@ -47,14 +46,14 @@ def test_huihui_virtual_callback_requires_signature_and_exact_order_details(auth
|
||||
created = client.post(
|
||||
"/api/token/charge",
|
||||
headers=context["owner_headers"],
|
||||
json={"planId": "1", "paymentMethod": "wechat", "payScene": "LITE"},
|
||||
json={"planId": "Basic", "paymentMethod": "wechat", "payScene": "LITE"},
|
||||
).json()["data"]
|
||||
payload = {
|
||||
"orderNo": created["orderNo"],
|
||||
"paymentNo": f"huihui-virtual-payment-{context['suffix']}",
|
||||
"status": "SUCCESS",
|
||||
"amountCents": 1000,
|
||||
"productId": "points_plan_1",
|
||||
"productId": "Basic",
|
||||
"openId": "openid-huihui-callback",
|
||||
"env": 1,
|
||||
}
|
||||
@@ -91,8 +90,7 @@ def test_virtual_payment_callback_and_refund_are_idempotent(authorization_contex
|
||||
user = db.query(User).filter(User.id == context["owner"].id).one()
|
||||
user.wechat_mp_openid = "openid-flow"
|
||||
user.wechat_mp_session_key = "session-flow"
|
||||
plan = db.query(TokenPlan).filter(TokenPlan.id == "1").one()
|
||||
plan.virtual_product_id = "points_plan_1"
|
||||
plan = db.query(TokenPlan).filter(TokenPlan.id == "Basic").one()
|
||||
db.commit()
|
||||
finally:
|
||||
db.close()
|
||||
@@ -108,7 +106,7 @@ def test_virtual_payment_callback_and_refund_are_idempotent(authorization_contex
|
||||
created = client.post(
|
||||
"/api/token/charge",
|
||||
headers=context["owner_headers"],
|
||||
json={"planId": "1", "paymentMethod": "wechat", "payScene": "LITE"},
|
||||
json={"planId": "Basic", "paymentMethod": "wechat", "payScene": "LITE"},
|
||||
).json()["data"]
|
||||
assert created["provider"] == "wechat_virtual"
|
||||
params = json.loads(created["payMessage"])
|
||||
@@ -120,7 +118,7 @@ def test_virtual_payment_callback_and_refund_are_idempotent(authorization_contex
|
||||
"OutTradeNo": created["orderNo"],
|
||||
"OpenId": "openid-flow",
|
||||
"Env": 1,
|
||||
"GoodsInfo": json.dumps({"ProductId": "points_plan_1", "ActualPrice": 1000}),
|
||||
"GoodsInfo": json.dumps({"ProductId": "Basic", "ActualPrice": 1000}),
|
||||
"WeChatPayInfo": json.dumps({"TransactionId": "wx-transaction-1"}),
|
||||
}
|
||||
query = {"timestamp": "100", "nonce": "nonce", "signature": _signature("callback-token", "100", "nonce")}
|
||||
|
||||
Reference in New Issue
Block a user