本文介绍了使用 PayPal Checkout Express 时是否可以通过 SetExpressCheckout 传递送货地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是在玩 PayPal API,尝试实现 Checkout Express 以便我可以接受信用卡,优先考虑那些没有贝宝帐户的人,因此我设置了 encoder["LANDINGPAGE"] = "Billing";.

Just playing around with the PayPal API, trying to implement Checkout Express so I can accept credit cards, prioritizing those who don't have a paypal account hence I set encoder["LANDINGPAGE"] = "Billing";.

在我的应用程序中,用户将从选择付款选项菜单,因此他们已经输入了他们的地址到我的发货单中,使用 CheckoutExpress 时是否可以将此地址传递给 PayPal?我正在尝试使用以下值进行徒劳的测试,但似乎当用户被重定向到 PayPal 上的信用卡详细信息条目页面,地址字段为空.我可以通过 GetExpressCheckout 获取他们输入的地址,但这超出了重点我正在努力实现的目标.

In my application the user will be redirected to the PayPal site fromthe select payment option menu, hence they would have already entered their addressinto my shipping form, is there anyway to pass this address to PayPal when using CheckoutExpress ?I am trying in vain testing with the values below but it seems when usergets redirected the credit card details entry page on PayPal the address fields are blank.I can get the address they enter with GetExpressCheckout, but this beats the pointof what I am trying to achieve.

    public string ECSetExpressCheckoutCode(string returnURL,string cancelURL,string amount,string paymentType,string currencyCode)
    {
        NVPCallerServices caller = new NVPCallerServices();
        IAPIProfile profile = ProfileFactory.createSignatureAPIProfile();

    // Set up your API credentials, PayPal end point, API operation and version.
    profile.APIUsername = "seller_324454235454_biz_api1.isp.net.au";
    profile.APIPassword = "135454354";
    profile.APISignature = "An5ns1Kso7MWUSSDFggfdgdfGHHGDSddGnbHJgMVp-rU03jS";
        profile.Environment="sandbox";
        caller.APIProfile = profile;

        NVPCodec encoder = new NVPCodec();
        encoder["VERSION"] =  "51.0";
        encoder["METHOD"] =  "SetExpressCheckout";

    // Add request-specific fields to the request.
        encoder["RETURNURL"] =  returnURL;
        encoder["CANCELURL"] =  cancelURL;
        encoder["AMT"] =  amount;
        encoder["PAYMENTACTION"] =  paymentType;
        encoder["CURRENCYCODE"] =  currencyCode;
    encoder["LANDINGPAGE"] = "Billing";
    encoder["PAYMENTREQUEST_0_SHIPTOSTREET"] = "345/3 Moomy St.";
    encoder["PAYMENTREQUEST_0_SHIPTOCITY"] = "Umpa Lumpa";
    encoder["PAYMENTREQUEST_0_SHIPTONAME"] = "Johnny Walker";
    encoder["PAYMENTREQUEST_0_SHIPTOSTATE"] = "NSW";
    encoder["PAYMENTREQUEST_0_SHIPTOZIP"] = "2673";
    encoder["PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE"] = "AU";
    encoder["PAYMENTREQUEST_0_SHIPPINGAMT"] = "56.00";

    encoder["NOSHIPPING"] = "0";

    // Execute the API operation and obtain the response.
        string pStrrequestforNvp= encoder.Encode();
        string pStresponsenvp=caller.Call(pStrrequestforNvp);

        NVPCodec decoder = new NVPCodec();
        decoder.Decode(pStresponsenvp);


   string Response = decoder["ACK"] == "Success" ? decoder["TOKEN"]: "ERROR";

   return Response;
    }

推荐答案

更新您的 API 版本.PAYMENTREQUEST 仅适用于 65.3 及更高版本.这就是为什么它现在被忽略了.除此之外,您的请求看起来不错.

Update your API version. PAYMENTREQUEST is only available at 65.3 and higher. That's why it's getting ignored now. Other than that your request appears fine.

来自:encoder["VERSION"] = "51.0";

至:
encoder["VERSION"] = "84.0";

这篇关于使用 PayPal Checkout Express 时是否可以通过 SetExpressCheckout 传递送货地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 13:50