这就是我拥有客户ID的方式,它也有条纹。客户端已经终止了其成员资格,但缺少额外的资源再次发送给普通用户。
我试过这样做:
var aktivAbonnent = stripeCustomer.StripeSubscriptionList.Data.FirstOrDefault().Status == "canceled";
或试试吧:
var aktivAbonnent = stripeCustomer.StripeSubscriptionList.Data.FirstOrDefault(x => x.CancelAtPeriodEnd == true && x.Status == "canceled");
如果我在这里运行这个解决方案,那么如果
那么请给我错误在我的数据库中有i: cus_8fuid1S7nHeTC3
var apiKey = ConfigurationManager.AppSettings["StripeApiKey"];
var customerService = new StripeCustomerService(apiKey);
var stripeCustomer = customerService.Get("cus_8fuid1S7nHeTC3");
var aktivAbonnent = stripeCustomer.StripeSubscriptionList.Data.FirstOrDefault(x => x.CancelAtPeriodEnd == true && x.Status == "canceled");
if (aktivAbonnent != null)
{ // SUCCES NOW
当我点击顶部时,所以当我站出来时,我会向他们提供这些信息。
object:
id: sub_8fuir6wScpUxuE
object: "subscription"
application_fee_percent: null
cancel_at_period_end: true
canceled_at: 1466454056
created: 1466454037
current_period_end: 1466540437
current_period_start: 1466454037
customer: cus_8fuid1S7nHeTC3
discount: null
ended_at: 1466540476
livemode: false
metadata:
plan:
id: 32645fa8bf7abb4a5b5dadfcbae2d2e509343af80446f730e1fba0791fd681bd
object: "plan"
amount: 6000
created: 1466454036
currency: "dkk"
interval: "day"
interval_count: 1
livemode: false
metadata:
Pakkeid: "32645fa8bf7abb4a5b5dadfcbae2d2e509343af80446f730e1fba0791fd681bd"
OrderId: "jkjnf21ts52016"
name: "1 måned(er) løbende (Alm pakke)"
statement_descriptor: null
trial_period_days: null
quantity: 1
start: 1466454037
status: "canceled"
tax_percent: null
trial_end: null
trial_start: null