从 Unity3D 发出测试请求

Making Test Requests from Unity3D

我正在为我的游戏创建我的商店系统,我将使用 paypal 作为支付方式,我已经完成了所有逻辑,但我需要测试调用以验证购买,我研究过并且 paypal 提供了一种方法这个"Sandbox accounts"允许在这里模拟一个虚拟的PayPal账户,现在的问题是我的系统与关于如何使用沙盒调用账户的教程的例子有点不同:Test Calls Tutorial

我正在使用它从我的游戏中将支付信息发送到 paypal:

 public void DoPayment(PaypalItem _item)
    {
        //string itemName, string itemNumber, double price, string userName
        if (!HasInfo)
        {
            Debug.Log("Dont have Info get");
            return;
        }

        StringBuilder url = new StringBuilder();

        string mod_price = string.Format("{0:0.00}", _item._price).ToString().Replace(",", ".");

        url.Append(serverURL + "?cmd=_xclick&currency_code=" + this.Currency.ToString() + "&business=" + this.Email);
        url.Append("&amount=" + mod_price);

        url.AppendFormat("&item_name={0}", _item._itemName);
        url.AppendFormat("&item_number={0}", _item._itemNumber);
        url.AppendFormat("&custom={0}", _item._customer);
        url.AppendFormat("&notify_url={0}", this.NotifyUrl);

        if (!ReturnUrl.Equals(string.Empty))
        {
            url.AppendFormat("&return={0}", this.ReturnUrl);
        }
        else if (!CancelUrl.Equals(string.Empty))
        {
            url.AppendFormat("&cancel_return={0}", this.CancelUrl);
        }
        Application.OpenURL(url.ToString());
    }

问题是我需要修改哪一部分才能调用沙盒帐户?

如有任何帮助,我们将不胜感激。

如果将 serverURL 参数更改为“https://www.sandbox.paypal.com", as denoted on the documentation available at https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/sb_overview/ .

,它应该可以工作