i am trying to get a paypal payment list in flutter, but i can't get it. This is the documentation: doc paypal api
but I don't know where I'm wrong. This is my code:
var response = await http.post(
Uri.parse(
"https://api-m.sandbox.paypal.com/v1/payments/payment?count=10&start_index=0&sort_by=create_time&sort_order=desc"),
headers: {
"content-type": "application/json",
'Authorization': 'Bearer ' + accessToken
});
I'm getting a 400's error: INVALID_REQUEST a help? thank you
sorry for the nonsense I realized now that it is of type get and not post. Correct code:
var response = await http.get(
Uri.parse(
"https://api-m.sandbox.paypal.com/v1/payments/payment?count=10&start_index=0&sort_by=create_time&sort_order=desc"),
headers: {
"content-type": "application/json",
'Authorization': 'Bearer ' + accessToken
});