C# 在Paypal Rest API中退款销售使用C捕获内部服务错误500#
我想在贝宝网站上退款。 我正在使用贝宝RESTAPI 以下是我的示例代码:C# 在Paypal Rest API中退款销售使用C捕获内部服务错误500#,c#,paypal,C#,Paypal,我想在贝宝网站上退款。 我正在使用贝宝RESTAPI 以下是我的示例代码: APIContext apiContext = APiConfig(); Sale sale = Sale.Get(apiContext, "0D952456WY462504J"); Amount refundAmount = new Amount(); refundAmount.total = "0.01"; refundAmount.currency = currency; Refund refund = new
APIContext apiContext = APiConfig();
Sale sale = Sale.Get(apiContext, "0D952456WY462504J");
Amount refundAmount = new Amount();
refundAmount.total = "0.01";
refundAmount.currency = currency;
Refund refund = new Refund();
refund.amount = refundAmount;
var newRefund = sale.Refund(apiContext, refund);
response = new PaypalResponse() {
amount = newRefund.amount,
create_time = Convert.ToDateTime(newRefund.create_time),
update_time = Convert.ToDateTime(newRefund.update_time),
state = newRefund.state,
parent_payment = newRefund.parent_payment,
id = newRefund.id
};
此行出现错误:“var newreturn=sale.return(apiContext,return);”
它说:远程服务器返回了一个错误:(500)内部服务器错误
谁能回答这个问题?谢谢 如果您使用的是.Net SDK,请将其更新至最新版本(刚刚发布,IINM版本1.2.1),在
销售.退款
中有
嗯……解决了!以前版本的paypal sdk在销售中有一个bug。退款。如果有人有同样的问题,只需将您的Paypal SDK更新至最新版本(1.2.1),谢谢@EdSF:)