Hi every one,
i am using paypal sdk to refund a payment in c#. the code i wrote to refund is as follow
but when i execute this code, it gives erro at line Refund newRefund = sale.Refund(api context, refund); and the error is "The remote server returned an error: (400) Bad Request."
Any help on this will be greatly appreciated.
Thank you.
i am using paypal sdk to refund a payment in c#. the code i wrote to refund is as follow
Code:
string ClientId = "my client id";
string ClientSecret = "my client secret";
OAuthTokenCredential tokenCredential = new OAuthTokenCredential(ClientId, ClientSecret);
string accessToken = tokenCredential.GetAccessToken();
APIContext apicontext = new APIContext(accessToken);
Sale sale = Sale.Get(apicontext, "paypl transaction id");
Amount amount = new Amount();
amount.total = "2.34";
amount.currency = "USD";
Refund refund = new Refund();
refund.amount = amount;
Refund newRefund = sale.Refund(apicontext, refund);
Any help on this will be greatly appreciated.
Thank you.
Comment