尽管将 RefundType 指定为“Partial”,但 PayPal NVP Partial refunds 退还全额
这是我正在使用的请求
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;
}
谁能告诉我是否需要包含更多参数才能进行部分退款?
你能改变 currencyCode 和 Amount, From 的参数值吗
"¤cy=USD" + "&AMOUNT=" + Amount
到
"CURRENCYCODE=USD" + "&AMT=" + Amount
看看RefundTransaction API Operation (NVP) .
可能是 PayPal 正在寻找不存在的 AMT
参数,这就是它全额退款的原因
我是一名优秀的程序员,十分优秀!