cancel method

Future<MollieSubscriptionResponse> cancel(
  1. String customerId,
  2. String subId
)

A subscription can be canceled any time by calling DELETE on the resource endpoint.

Implementation

Future<MollieSubscriptionResponse> cancel(String customerId, String subId) async {
  var res = await http.delete(
    Uri.parse("$_apiEndpoint/$customerId/subscriptions/$subId"),
    headers: _headers,
  );

  dynamic data = json.decode(res.body);

  return MollieSubscriptionResponse.build(data);
}