123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class PayTest : MonoBehaviour
- {
- public Text text;
- public void Test()
- {
- GetAlipayProductID("com.dashgame.garden.test01", (pid) =>
- {
- Debug.Log(pid);
- AliplayManager.Instance.Init();
- try
- {
- AliplayManager.Instance.Pay(pid, "");
- }
- catch (Exception e)
- {
- text.text = e.ToString();
- }
- });
- }
- public void GetAlipayProductID(string id, URLRequest.URLRequestCallBackDelegate callback)
- {
- URLRequestData urlData = new URLRequestData();
- urlData.Add("t", 1);
- urlData.Add("i", id);
- urlData.Add("u", "12315646849845648");
- URLRequest.CreateStrURLRequest(true, HttpManager.AlipayIdURL, urlData, callback, URLRequest.Method.POST);
- }
- }
|