尽管将RefundType指定为“ Partial”,但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;
}
有人可以让我知道我是否需要包括更多参数才能部分退款?
最佳答案
您能否更改currencyCode和Amount的Parameters值,从
"¤cy=USD" + "&AMOUNT=" + Amount
至
"CURRENCYCODE=USD" + "&AMT=" + Amount
看看RefundTransaction API Operation (NVP)。
可能是PayPal正在寻找不存在的
AMT
参数,这就是为什么要全额退款的原因关于paypal - Paypal NVP部分退款,全额退款,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15673462/