PayPal NVP部分退款全额退款,但将RefundType指定为“部分”
这是我正在使用的请求
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;
}
任何人都可以让我知道我需要包含更多参数才能获得部分退款吗?
答案 0 :(得分:1)
您可以更改currencyCode的参数值和Amount,From
"¤cy=USD" + "&AMOUNT=" + Amount
到
"CURRENCYCODE=USD" + "&AMT=" + Amount
查看RefundTransaction API Operation (NVP)。
可能是PayPal正在寻找不存在的AMT
参数,这就是为什么它在完全退款