Reputation: 100
I'm trying to refund a sale in a Paypal. I'm using Paypal REST API.
Here's my sample code:
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
};
Getting error on this line: "var newRefund = sale.Refund(apiContext, refund);" It said that: The remote server returned an error: (500) Internal Server Error.
Can anyone answer this? Thanks!
Upvotes: 2
Views: 501