2017-01-30 81 views
0

我從stripe.net 1.2.0 DLL更新命名空間StripeCustomerUpdateSubscriptionOptions無法找到

我原來的代碼是這樣的
VAR myUpdatedSubscription =新StripeCustomerUpdateSubscriptionOptions(); 但現在我沒有找到命名空間沒有找到與新的stripe.net v7錯誤 。

var myUpdatedSubscription = new StripeCustomerUpdateSubscriptionOptions(); 
         myUpdatedSubscription.PlanId = SelectedSubscription; 
         myUpdatedSubscription.TokenId = stripeToken; 
         myUpdatedSubscription.Quantity = 1; 

         var customerService = new StripeCustomerService(); 
         StripeSubscription subscription = customerService.UpdateSubscription(StripeCustomerID, myUpdatedSubscription); 

         objCompany.SubscribeCompany(CompanyID, StripeCustomerID, SelectedSubscription); 
         pnlForm.Visible = false; 
         pnlPaymentSuccessful.Visible = true; 
+1

您將需要閱讀說明如何更新現有訂閱的文檔:https://github.com/jaymedavis/stripe.net#updating-a-subscription或創建一個https://github.com /jaymedavis/stripe.net#creating-a-subscription – koopajah

回答

1

管理訂閱已經從StripeCustomerService移動到新StripeSubscriptionService。有了這個,有些類型的名稱也發生了變化。因此,例如,您現在使用StripeSubscriptionUpdateOptions而不是StripeCustomerUpdateSubscriptionOptions

+0

謝謝!你知道CurrentPeriodStart去了哪裏?它似乎應該在訂閱,但它不是。 var customerService = new StripeCustomerService(); StripeCustomer stripeCustomer = customerService.Get(StripeCustomerID); string CustomerDescription = stripeCustomer.Description.ToString(); DateTime SubscriptionStarts =(日期時間)stripeCustomer.Subscription.CurrentPeriodStart; – user713813

+0

@ user713813您現在使用傳遞customerId和subscriptionId的Get方法從StripeSubscriptionService獲取訂閱。只需使用github.com/jaymedavis/stripe.net上的文檔來了解如何執行操作。 – NineBerry

+0

萬一有人好奇你使用var subscriptionService = new StripeSubscriptionService(); IEnumerable responses = subscriptionService.List(stripeCustomer.Id.ToString());然後 foreach(var response in response) { StripeSubscriptionID = response.Id.ToString(); } – user713813

相關問題