listTransactions method

Future<TransactionsList> listTransactions(
  1. String subscriptionId,
  2. String startTime,
  3. String endTime
)

Lists transactions for a subscription.

Parameter subscriptionId: The ID of the subscription

Parameter startTime: The start time of the range of transactions to list.

Parameter endTime: The end time of the range of transactions to list.

Implementation

Future<TransactionsList> listTransactions(
    String subscriptionId, String startTime, String endTime) async {
  var url = _payPalHttpClient.getUrl(
      '/v1/billing/subscriptions/$subscriptionId/transactions',
      queryParameters: {
        'start_time': startTime,
        'end_time': endTime,
      });

  var response = await _payPalHttpClient.get(url);
  return TransactionsList.fromJson(jsonDecode(response.body));
}