[英]Adding multiple cards for a customer stripe.net
有沒有辦法使用stripe.net為客戶添加多張卡片,我知道我們需要檢索客戶並使用源對象添加一張新卡片,如下所示( https://stripe.com/docs/api #create_card )。 但是對於stripe.net,我似乎無法弄清楚如何做到這一點,任何指針都會有很大幫助。
弄清楚了。 如果它對這里的任何人有幫助,我就是這樣做的:
var myCustomer = new StripeCardCreateOptions();
myCustomer.SourceCard = new SourceCard
{
Number = txtnumero.Text,
ExpirationYear = txtyear.Text,
ExpirationMonth = txtmonth.Text,
Cvc = txtCVV.Text
};
StripeCardService NewStripeCardService = new StripeCardService();
StripeCard stripeCustomer = NewStripeCardService.Create(**CustomerID**,myCustomer);
更新以解決 Stripe API 中的更改。
var myCustomerCardNested = new Stripe.CardCreateNestedOptions();
myCustomerCardNested.Number = cardNumber;
myCustomerCardNested.ExpYear = year;
myCustomerCardNested.ExpMonth = month;
myCustomerCardNested.Cvc = CVC;
var myCustomerCard = new Stripe.CardCreateOptions() { SourceCard = myCustomerCardNested };
stripeCustomerCard = NewStripeCardService.Create(stripeCustomer.Id, myCustomerCard);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.