cancelSubscription method
Implementation
@override
Future<Map> cancelSubscription(
String token, String subscriptionId, String prorationBehavior) async {
final baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/api/v1/subscriptions/$subscriptionId/cancel");
var bodyData = {"proration_behavior": prorationBehavior};
var jsonBody = jsonEncode(bodyData);
var response = await http.post(
url,
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $token",
"x-jwt-account-id": "string"
},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}