getUrl method

Uri getUrl(
  1. String path, {
  2. Map<String, dynamic>? queryParameters,
})

Creates URL with the given path and currently configured environment

Implementation

Uri getUrl(String path, {Map<String, dynamic>? queryParameters}) {
  if (queryParameters != null) {
    for (var key in queryParameters.keys.toList(growable: false)) {
      if (queryParameters[key] == null) {
        queryParameters.remove(key);
      }
    }
  }

  return Uri.https(paypalEnvironment.host, path, queryParameters);
}