0

尽管将 RefundType 指定为“部分”,但 PayPal NVP 部分退款全额退款

这是我正在使用的请求

    public string Refund_Partial(string transactionID, string refundType,string Amount)
    {
        string strCredentials = "USER=" + strUsername + "&PWD=" + strPassword + "&SIGNATURE=" + strSignature;
        string strNVP = strCredentials;
        strNVP += "&METHOD=RefundTransaction&VERSION=" + strAPIVersion;

        strNVP += "&TRANSACTIONID=" + transactionID + "&REFUNDTYPE=" + refundType + "¤cy=USD" + "&AMOUNT=" + Amount;
        //Create web request and web response objects, make sure you using the correct server (sandbox/live)
        HttpWebRequest wrWebRequest = (HttpWebRequest)WebRequest.Create(strNVPSandboxServer);
        //Set WebRequest Properties
        wrWebRequest.Method = "POST";
        // write the form values into the request message
        StreamWriter requestWriter = new StreamWriter(wrWebRequest.GetRequestStream());
        requestWriter.Write(strNVP);
        requestWriter.Close();
        // Get the response.
        HttpWebResponse hwrWebResponse = (HttpWebResponse)wrWebRequest.GetResponse();
        StreamReader responseReader = new StreamReader(wrWebRequest.GetResponse().GetResponseStream());
        // and read the response
        string responseData = responseReader.ReadToEnd();
        responseReader.Close();
        return responseData;
    }

谁能让我知道我是否需要包含更多参数才能进行部分退款?

4

1 回答 1

1

您可以更改货币代码和金额的参数值,从

"¤cy=USD" + "&AMOUNT=" + Amount

"CURRENCYCODE=USD" + "&AMT=" + Amount

看看RefundTransaction API 操作 (NVP)

可能是 PayPal 正在寻找AMT不存在的参数,这就是它全额退款的原因

于 2013-03-28T09:16:35.963 回答