當前位置: 首頁>>代碼示例>>C#>>正文


C# Stripe.StripeRequestOptions類代碼示例

本文整理匯總了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))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeRecipientService.cs

示例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))
     );
 }
開發者ID:Xordal,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeInvoiceService.cs

示例3: Get

 //Sync
 public virtual StripeEvent Get(string eventId, StripeRequestOptions requestOptions = null)
 {
     return Mapper<StripeEvent>.MapFromJson(
         Requestor.GetString($"{Urls.Events}/{eventId}",
         SetupRequestOptions(requestOptions))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:8,代碼來源:StripeEventService.cs

示例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))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:8,代碼來源:StripeTransferService.cs

示例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;
        }
開發者ID:shirley-truong-volusion,項目名稱:stripe.net,代碼行數:25,代碼來源:Requestor.cs

示例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))
     );
 }
開發者ID:Xordal,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeInvoiceItemService.cs

示例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))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeCustomerService.cs

示例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))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeAccountService.cs

示例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))
     );
 }
開發者ID:richardlawley,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeBalanceService.cs

示例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))
     );
 }
開發者ID:Xordal,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeCouponService.cs

示例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))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeAccountService.cs

示例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)
     );
 }
開發者ID:Xordal,項目名稱:stripe.net,代碼行數:7,代碼來源:BankAccountService.cs

示例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))
     );
 }
開發者ID:Xordal,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeEventService.cs

示例14: Delete

 public virtual StripeDeleted Delete(string recipientId, StripeRequestOptions requestOptions = null)
 {
     return Mapper<StripeDeleted>.MapFromJson(
         Requestor.Delete($"{Urls.Recipients}/{recipientId}",
         SetupRequestOptions(requestOptions))
     );
 }
開發者ID:jaymedavis,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeRecipientService.cs

示例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))
     );
 }
開發者ID:Xordal,項目名稱:stripe.net,代碼行數:7,代碼來源:StripeInvoiceItemService.cs


注:本文中的Stripe.StripeRequestOptions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。