我正在为自己的游戏创建商店系统,我将使用贝宝作为付款方式,并且已经完成了所有逻辑,但是我需要测试通话以验证购买,我研究了贝宝为“沙盒帐户”提供了一种方法”,它可以在此处模拟虚拟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”,它应该可以工作,如https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/sb_overview/上可用的文档所述。

关于c# - 从Unity3D发出测试请求,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29888204/

10-12 05:30