retrieveWebhook method

Future<Map<String, dynamic>> retrieveWebhook(
  1. String webhookId
)

Implementation

Future<Map<String, dynamic>> retrieveWebhook(String webhookId) async {
  Options dioOptions = Options(
    headers: {
      "Authorization": "Bearer $apiKey",
      "Accept": "application/vnd.api+json",
      "Content-Type": "application/vnd.api+json",
    },
  );

  try {
    Response response = await dio.get(
      "https://api.lemonsqueezy.com/v1/webhooks/$webhookId",
      options: dioOptions,
    );

    return response.data;
  } catch (e) {
    return {'error': e.toString()};
  }
}