c# - 退款 Paypal Rest API 中的销售使用 C# 捕获了内部服务错误 500

标签 c# paypal

我正在尝试通过 Paypal 对销售进行退款。 我正在使用 Paypal REST API。

这是我的示例代码:

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 newRefund = sale.Refund(apiContext, refund);” 它说:远程服务器返回错误:(500)内部服务器错误。

有人能回答吗?谢谢!

最佳答案

如果您使用的是.Net SDK,请将其更新到最新版本(刚刚发布,IINM 版本1.2.1),was a bugSale.Refund 中是 fixed

嗯....

关于c# - 退款 Paypal Rest API 中的销售使用 C# 捕获了内部服务错误 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27814976/

相关文章:

C# 图像裁剪、拆分、保存

c# - 从 C# Windows 应用程序创建 .exe

c# - 如何在值元组中使用泛型类型?

c# - 如何从正在运行的服务中获取 WSDL 文件?

使用 Payflow Pro 退还费用的 PHP 代码

c# - 如何在代码中为 DataTemplate 分配事件处理程序?

javascript - PayPal 预先批准的付款按钮

php - Paypal mass pay soap php集成

c# - Paypal 整合到网站

c# - 错误代码 : 12114 Invalid Item URL. 交易因参数无效而被拒绝