refund method

Future<void> refund(
  1. String packageName,
  2. String orderId, {
  3. bool? revoke,
  4. String? $fields,
})

Refunds a user's subscription or in-app purchase order.

Orders older than 3 years cannot be refunded.

Request parameters:

packageName - The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing').

orderId - The order ID provided to the user when the subscription or in-app order was purchased.

revoke - Whether to revoke the purchased item. If set to true, access to the subscription or in-app item will be terminated immediately. If the item is a recurring subscription, all future payments will also be terminated. Consumed in-app items need to be handled by developer's app. (optional).

$fields - Selector specifying which fields to include in a partial response.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<void> refund(
  core.String packageName,
  core.String orderId, {
  core.bool? revoke,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (revoke != null) 'revoke': ['${revoke}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'androidpublisher/v3/applications/' +
      commons.escapeVariable('$packageName') +
      '/orders/' +
      commons.escapeVariable('$orderId') +
      ':refund';

  await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}