update method
Future<MollieSubscriptionResponse>
update(
- MollieSubscriptionRequest sub,
- String subId,
- String customerId
Some fields of a subscription can be updated by calling PATCH on the resource endpoint. Each field is optional. You cannot update a canceled subscription.
Implementation
Future<MollieSubscriptionResponse> update(MollieSubscriptionRequest sub, String subId, String customerId) async {
var res = await http.patch(Uri.parse("$_apiEndpoint/$customerId/subscriptions/$subId"),
headers: _headers, body: sub.toJson());
dynamic data = json.decode(res.body);
return MollieSubscriptionResponse.build(data);
}