Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 521

PayPal in MVC Sending Order Request In Live Mode

$
0
0

I was struggling to get an access token when I switched from sandbox to live but found the answer on How to get access token from PayPal in MVC. My issue now is with the next step, getting the order set up. The code that I found is:

string url = PaypalUrl +"/v2/checkout/orders/" + orderID +"/capture";using (var client = new HttpClient()){client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);var requestMessage = new HttpRequestMessage(HttpMethod.Post, url);requestMessage.Content = new StringContent("", null, "application/json");var responseTask = client.SendAsync(requestMessage);responseTask.Wait();var result = responseTask.Result;if (result.IsSuccessStatusCode){

result.IsSuccessStatusCode is returning false. I've tried to follow the example given for getting the access code but nothing seems to work. I am guessing that the access token that is returned is correct.


Viewing all articles
Browse latest Browse all 521

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>