feat: Flexion 先验签后消费支付流程 + playerId 绑定
实现 Flexion 渠道支付验签重构:支付成功后不立即消费,将 purchaseJson/signature/purchaseToken 回调至 Unity,由服务端 SHA1withRSA 验签并校验 developerPayload.playerId 后再调用 consume。 同步更新 SDKManager 接口、UnityBridgeFunc 桥接、TYSdkModel 字段及 ExtraPluginCfgs。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,7 @@ namespace tysdk
|
||||
|
||||
if (purchaseInfo == null)
|
||||
purchaseInfo = new JObject();
|
||||
// purchaseInfo["playerId"] = _accountInfo.strUserId;
|
||||
|
||||
string extraInfo = purchaseInfo.ToString(Newtonsoft.Json.Formatting.None);
|
||||
extraInfo = Convert.ToBase64String(Encoding.UTF8.GetBytes(extraInfo));
|
||||
@@ -56,18 +57,16 @@ namespace tysdk
|
||||
#elif UNITY_ANDROID
|
||||
|
||||
var pType = ChannelConfig.PayType;
|
||||
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<PaymentInfo>(TimeSpan.FromSeconds(30));
|
||||
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<PaymentInfo>(TimeSpan.FromSeconds(90));
|
||||
try
|
||||
{
|
||||
UnityBridgeFunc.UnityKnowNew(prodId, prodPrice, prodName, count.ToString(), orderId, extraInfo, pType);
|
||||
|
||||
var result = await task;
|
||||
result.count = count;
|
||||
result.orderId = orderId;
|
||||
result.productId = prodId;
|
||||
result.price = prodPrice;
|
||||
result.Check(orderId, prodId);
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -112,6 +111,9 @@ namespace tysdk
|
||||
var result = new PaymentInfo();
|
||||
result.code = jresult["code"].ToString();
|
||||
result.msg = jresult["errStr"].ToString();
|
||||
result.purchaseJson = jresult["purchaseJson"]?.ToString();
|
||||
result.signature = jresult["signature"]?.ToString();
|
||||
result.purchaseToken = jresult["purchaseToken"]?.ToString();
|
||||
if (result.code == "-1")
|
||||
{
|
||||
if (!_payFirstNegativeHandled)
|
||||
|
||||
Reference in New Issue
Block a user