[M] sync with n3

This commit is contained in:
2024-11-28 14:00:57 +08:00
parent 5f81ddafed
commit 7401a30ebf
7 changed files with 177 additions and 54 deletions

View File

@@ -36,7 +36,9 @@ namespace tysdk
public class PaymentInfo : ITYSdkCallback
{
public bool isSuccess => code == "0";
public bool isSuccessFromSdk => code == "0";
public bool isSuccess => isSuccessFromSdk && confirmed;
private bool confirmed {get; set;} = false;
public int count;
public string orderId;
public string productId;
@@ -45,6 +47,15 @@ namespace tysdk
public string code;
public string msg;
public bool Check(string orderId, string productId)
{
confirmed = orderId == this.orderId && productId == this.productId;
if(!confirmed)
UnityEngine.Debug.LogWarning("[TYSdk Pay] order not confirmed");
return confirmed;
}
public override string ToString()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);