#jimmy_97753
1 messages · Page 1 of 1 (latest)
If you visit the above link to see the request in your dashboard, you can see the problem. You're passing this single string in items: "price: 1344-CAD-3999-MONTH-1".
That shouldn't be a string. That really should be an object (key value pairs)
have you ever done this in dart?
var response = await http.post(
Uri.parse('https://api.stripe.com/v1/subscriptions'),
headers: {
'Authorization':
'Bearer ...',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: {
'customer': widget.usagerGlobal.usagerStripe!.idstripe!,
'items': {
'price': '1344-CAD-3999-MONTH-1',
}.toString(),
},
);
No I haven't
And we don't have an official client library for Dart, so there's a limited amount I can support
Main thing is to make sure your body is url form encoded
application/x-www-form-urlencoded is right
But as I haven't used dart before, I'm not sure if you're passing body the right way
I think you'd need to do like items[0][price]
But don't use postman regularly
We also have this postman collection: https://github.com/stripe/stripe-postman