PayPal NVP部分退款全额退款,退款类型指定为"Partial"
这是我使用的请求
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的参数值吗?
"¤cy=USD" + "&AMOUNT=" + Amount
"CURRENCYCODE=USD" + "&AMT=" + Amount
看一下退款交易API操作(NVP)
可能是PayPal正在寻找不存在的AMT
参数,这就是为什么它全额退款