public async Task <Credit> GetCredit(Guid creditId, RequestOptions inputOptions, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.CREDITS_PATH + "/" + creditId; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Credit>(uri, requestOptions)); }
// ACCOUNT TIMELINE public async Task <AccountTimeline> GetAccountTimeline(Guid accountId, RequestOptions inputOptions, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.ACCOUNTS_PATH + "/" + accountId + "/" + Configuration.TIMELINE; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <AccountTimeline>(uri, requestOptions)); }
public async Task <InvoicePayments> GetInvoicePaymentsForAccount(Guid accountId, RequestOptions inputOptions, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.ACCOUNTS_PATH + "/" + accountId + "/" + Configuration.INVOICE_PAYMENTS; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <InvoicePayments>(uri, requestOptions)); }
// PAYMENT METHODS public async Task <PaymentMethod> GetPaymentMethod(Guid paymentMethodId, RequestOptions inputOptions, bool withPluginInfo = false, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.PAYMENT_METHODS_PATH + "/" + paymentMethodId; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_WITH_PLUGIN_INFO, withPluginInfo.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <PaymentMethod>(uri, requestOptions)); }
// BUNDLES public async Task <Bundles> GetBundles(RequestOptions inputOptions, long offset = 0L, long limit = 100L, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.BUNDLES_PATH + "/" + Configuration.PAGINATION; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_SEARCH_OFFSET, offset.ToString()); queryParams.Add(Configuration.QUERY_SEARCH_LIMIT, limit.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Bundles>(uri, requestOptions)); }
public async Task <PaymentMethods> GetPaymentMethodsForAccount(Guid accountId, RequestOptions inputOptions, Dictionary <string, string> pluginProperties = null, bool withPluginInfo = false, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.ACCOUNTS_PATH + "/" + accountId + "/" + Configuration.PAYMENT_METHODS; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_WITH_PLUGIN_INFO, withPluginInfo.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); StorePluginPropertiesAsParams(pluginProperties, ref queryParams); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <PaymentMethods>(uri, requestOptions)); }
public async Task <Accounts> GetAccounts(long offset, long limit, RequestOptions inputOptions, AuditLevel auditLevel = AuditLevel.NONE) { var uri = Configuration.ACCOUNTS_PATH + "/" + Configuration.PAGINATION; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_SEARCH_OFFSET, offset.ToString()); queryParams.Add(Configuration.QUERY_SEARCH_LIMIT, limit.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Accounts>(uri, requestOptions)); }
private async Task <Invoice> GetInvoiceByIdOrNumber(string invoiceIdOrNumber, RequestOptions inputOptions, bool withItems = false, bool withChildrenItems = false, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.INVOICES_PATH + "/" + invoiceIdOrNumber; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_INVOICE_WITH_ITEMS, withItems.ToString()); queryParams.Add(Configuration.QUERY_INVOICE_WITH_CHILDREN_ITEMS, withChildrenItems.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Invoice>(uri, requestOptions)); }
public async Task <Invoices> GetInvoicesForAccount(Guid accountId, RequestOptions inputOptions, bool withItems = false, bool unpaidOnly = false, bool includeMigrationInvoices = false, AuditLevel auditLevel = DefaultAuditLevel) { var uri = Configuration.ACCOUNTS_PATH + "/" + accountId + "/" + Configuration.INVOICES; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_INVOICE_WITH_ITEMS, withItems.ToString()); queryParams.Add(Configuration.QUERY_UNPAID_INVOICES_ONLY, unpaidOnly.ToString()); queryParams.Add(Configuration.QUERY_WITH_MIGRATION_INVOICES, includeMigrationInvoices.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Invoices>(uri, requestOptions)); }
public async Task <Invoices> GetInvoices(bool withItems, long offset, long limit, RequestOptions inputOptions, AuditLevel auditLevel = AuditLevel.NONE) { var uri = Configuration.INVOICES_PATH + "/" + Configuration.PAGINATION; var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_SEARCH_OFFSET, offset.ToString()); queryParams.Add(Configuration.QUERY_SEARCH_LIMIT, limit.ToString()); queryParams.Add(Configuration.QUERY_INVOICE_WITH_ITEMS, withItems.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Invoices>(uri, requestOptions)); }
private async Task <Invoices> SearchInvoices(string key, long offset, long limit, AuditLevel auditLevel, RequestOptions inputOptions) { var utf = Encoding.UTF8.GetBytes(key); var uri = Configuration.INVOICES_PATH + "/" + Configuration.SEARCH + "/" + Encoding.UTF8.GetString(utf); var queryParams = new MultiMap <string>().Create(inputOptions.QueryParams); queryParams.Add(Configuration.QUERY_SEARCH_OFFSET, offset.ToString()); queryParams.Add(Configuration.QUERY_SEARCH_LIMIT, limit.ToString()); queryParams.Add(Configuration.QUERY_AUDIT, auditLevel.ToString()); var requestOptions = inputOptions.Extend().WithQueryParams(queryParams).Build(); return(await _client.Get <Invoices>(uri, requestOptions)); }
public static void WriteLine(string callerId, AuditLevel auditLevel, string text, string callerMethodName, string prefixText = null) { WriteLine(callerId, prefixText + "AuditLevel." + auditLevel.ToString() + " " + text, callerMethodName); }
public static void WriteLine(string callerId, AuditLevel auditLevel, Exception ex, string callerMethodName) { WriteLine(callerId, ex, callerMethodName, "AuditLevel." + auditLevel.ToString() + " "); }
public static void TaskEnd(string callerId, AuditLevel auditLevel, Exception ex, string callerMethodName) { WriteLine(callerId, ex, callerMethodName, "Task End with Error ======= AuditLevel." + auditLevel.ToString()); }