您好我正在使用条带流程进行付款,我正在从下面的代码中生成Stripe客户ID。
StripeCustomerId = CreateStripeCustomer(fname, lname, Email, objStripeRequestOptions);
另外
IEnumerable<StripeCard> AllStripeCardResponse = cardService.List(StripeCustomerId);
string strLast4 = CardNumber.Replace(" ", "").Substring(CardNumber.Replace(" ", "").Length - 4);
dynamic ExistingCard = (from x in AllStripeCardResponse where x.Last4 == strLast4 & x.ExpirationMonth == Convert.ToInt32(Month.Trim()) & x.ExpirationYear == Convert.ToInt32(Year.Trim()) select x).ToList();
它将现有卡片设为0
任何人都可以告诉我如何从生成的条带客户ID中获取卡号,名称,月份年份等卡片详细信息?
答案 0 :(得分:3)
您无法检索整张卡信息 您可以从客户API中的源对象获取一些信息 检索来源将为您提供最后4位数的卡号和有效期。
FORCE
,在客户的回应中,您将拥有source属性。请参阅返回的JSON响应。它包含源列表(添加的卡列表。)
您将获得与此类似的示例对象,在这里您可以看到卡的最后4位数作为对象返回,在我的情况下它是 StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
StripeConfiguration.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
var customerService = new StripeCustomerService();
StripeCustomer customer = customerService.Get("cus_BwS21a7fAH22uk");
1111
另见
#<Stripe::ListObject:0x5ea1a78> JSON: {
"object": "list",
"data": [
{"id":"card_1BY6nrCaMyPmWTcG3uosK2up","object":"card","address_city":null,"address_country":null,"address_line1":null,"address_line1_check":null,"address_line2":null,"address_state":null,"address_zip":null,"address_zip_check":null,"brand":"Visa","country":"US","customer":"cus_BvylB8PAVap2JQ","cvc_check":"pass","dynamic_last4":null,"exp_month":12,"exp_year":2017,"fingerprint":"yE1mPcIGvqTYGcxQ","funding":"unknown","last4":"1111","metadata":{},"name":null,"tokenization_method":null}
],
"has_more": false,
"total_count": 1,
"url": "/v1/customers/cus_BvylB8PAVap2JQ/sources"
}