本文整理汇总了C#中Stripe.StripeRequestOptions类的典型用法代码示例。如果您正苦于以下问题:C# StripeRequestOptions类的具体用法?C# StripeRequestOptions怎么用?C# StripeRequestOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StripeRequestOptions类属于Stripe命名空间,在下文中一共展示了StripeRequestOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get
public virtual StripeRecipient Get(string recipientId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeRecipient>.MapFromJson(
Requestor.GetString(this.ApplyAllParameters(null, $"{Urls.Recipients}/{recipientId}", false),
SetupRequestOptions(requestOptions))
);
}
示例2: Pay
public virtual StripeInvoice Pay(string invoiceId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeInvoice>.MapFromJson(
Requestor.PostString(this.ApplyAllParameters(null, $"{Urls.Invoices}/{invoiceId}/pay", false),
SetupRequestOptions(requestOptions))
);
}
示例3: Get
//Sync
public virtual StripeEvent Get(string eventId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeEvent>.MapFromJson(
Requestor.GetString($"{Urls.Events}/{eventId}",
SetupRequestOptions(requestOptions))
);
}
示例4: Create
//Sync
public virtual StripeTransfer Create(StripeTransferCreateOptions createOptions, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeTransfer>.MapFromJson(
Requestor.PostString(this.ApplyAllParameters(createOptions, Urls.Transfers, false),
SetupRequestOptions(requestOptions))
);
}
示例5: GetWebRequest
internal static WebRequest GetWebRequest(string url, string method, StripeRequestOptions requestOptions, bool useBearer = false)
{
requestOptions.ApiKey = requestOptions.ApiKey ?? StripeConfiguration.GetApiKey();
var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = method;
if(!useBearer)
request.Headers.Add("Authorization", GetAuthorizationHeaderValue(requestOptions.ApiKey));
else
request.Headers.Add("Authorization", GetAuthorizationHeaderValueBearer(requestOptions.ApiKey));
request.Headers.Add("Stripe-Version", StripeConfiguration.ApiVersion);
if (requestOptions.StripeConnectAccountId != null)
request.Headers.Add("Stripe-Account", requestOptions.StripeConnectAccountId);
if (requestOptions.IdempotencyKey != null)
request.Headers.Add("Idempotency-Key", requestOptions.IdempotencyKey);
request.ContentType = "application/x-www-form-urlencoded";
request.UserAgent = "Stripe.net (https://github.com/jaymedavis/stripe.net)";
return request;
}
示例6: ListAsync
public virtual async Task<IEnumerable<StripeInvoiceLineItem>> ListAsync(StripeInvoiceItemListOptions listOptions = null, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeInvoiceLineItem>.MapCollectionFromJson(
await Requestor.GetStringAsync(this.ApplyAllParameters(listOptions, Urls.InvoiceItems, true),
SetupRequestOptions(requestOptions))
);
}
示例7: Update
public virtual StripeCustomer Update(string customerId, StripeCustomerUpdateOptions updateOptions, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeCustomer>.MapFromJson(
Requestor.PostString(this.ApplyAllParameters(updateOptions, $"{Urls.Customers}/{customerId}", false),
SetupRequestOptions(requestOptions))
);
}
示例8: Delete
public virtual StripeDeleted Delete(string accountId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeDeleted>.MapFromJson(
Requestor.Delete(this.ApplyAllParameters(null, $"{Urls.Accounts}/{accountId}", false),
SetupRequestOptions(requestOptions))
);
}
示例9: Get
public virtual StripeBalanceTransaction Get(string id, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeBalanceTransaction>.MapFromJson(
Requestor.GetString(this.ApplyAllParameters(null, $"{Urls.BalanceTransactions}/{id}", false),
SetupRequestOptions(requestOptions))
);
}
示例10: Get
public virtual StripeCoupon Get(string couponId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeCoupon>.MapFromJson(
Requestor.GetString(this.ApplyAllParameters(null, $"{Urls.Coupons}/{couponId}", false),
SetupRequestOptions(requestOptions))
);
}
示例11: Update
public virtual StripeAccount Update(string accountId, StripeAccountUpdateOptions updateOptions, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeAccount>.MapFromJson(
Requestor.PostString(this.ApplyAllParameters(updateOptions, $"{Urls.Accounts}/{accountId}", false),
SetupRequestOptions(requestOptions))
);
}
示例12: Delete
public virtual void Delete(string customerId, string bankAccountId, StripeRequestOptions requestOptions = null)
{
Requestor.Delete(
this.ApplyAllParameters(null, $"{Urls.BaseUrl}/customers/{customerId}/sources/{bankAccountId}"),
SetupRequestOptions(requestOptions)
);
}
示例13: GetAsync
public virtual async Task<StripeEvent> GetAsync(string eventId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeEvent>.MapFromJson(
await Requestor.GetStringAsync($"{Urls.Events}/{eventId}",
SetupRequestOptions(requestOptions))
);
}
示例14: Delete
public virtual StripeDeleted Delete(string recipientId, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeDeleted>.MapFromJson(
Requestor.Delete($"{Urls.Recipients}/{recipientId}",
SetupRequestOptions(requestOptions))
);
}
示例15: CreateAsync
public virtual async Task<StripeInvoiceLineItem> CreateAsync(StripeInvoiceItemCreateOptions createOptions, StripeRequestOptions requestOptions = null)
{
return Mapper<StripeInvoiceLineItem>.MapFromJson(
await Requestor.PostStringAsync(this.ApplyAllParameters(createOptions, Urls.InvoiceItems, false),
SetupRequestOptions(requestOptions))
);
}