【问题标题】:Making Test Requests from Unity3D从 Unity3D 发出测试请求
【发布时间】:2015-07-05 11:04:08
【问题描述】:

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

我正在使用它从我的游戏中将付款信息发送到贝宝:

 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());
    }

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

任何帮助将不胜感激。

【问题讨论】:

    标签: c# paypal unity3d paypal-sandbox sandbox


    【解决方案1】:

    如果您将 serverURL 参数更改为“https://www.sandbox.paypal.com”,它应该可以工作,如https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/sb_overview/ 提供的文档中所述。

    【讨论】:

    • 谢谢,这对我有用,比我想象的要容易。
    猜你喜欢
    • 2014-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-06
    相关资源
    最近更新 更多