issueRefund method
ACTION: issue_refund
Used to refund a batch donation
using a path like this: https://api.planningcenteronline.com/giving/v2/donations/1/issue_refund
data
can be a JSON String, or JSON serializable Object that follows
the JSON:API specifications. The PlanningCenterApiData helper class has been
provided for just such a purpose.
Details:
This action refunds a batch donation.
It will respond with unprocessable_entity
if the donation cannot be refunded, or if the donation is not part of a batch.
refunded_at
is optional, but recommended for data accuracy.
{
"data": {
"attributes": {
"refunded_at": "1959-02-03"
}
}
}
Implementation
Future<PlanningCenterApiResponse> issueRefund(Object data) async {
if (id == null) {
return PlanningCenterApiError.messageOnly(
'Actions must be called on items that already exist on the remote server',
);
}
var url = '$apiEndpoint/issue_refund';
return api.call(url, verb: 'post', data: data, apiVersion: apiVersion);
}