2

有没有办法可以使用 stripe.net 为客户添加多张卡,我知道我们需要检索客户并使用源对象添加新卡,如下所示(https://stripe.com/docs/api #create_card)。但是对于 stripe.net,我似乎无法弄清楚如何做到这一点,任何指针都会有很大的帮助。

4

2 回答 2

2

更新以解决 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);
于 2018-11-24T15:22:36.130 回答
2

弄清楚了。如果它对这里的任何人有帮助,那么我就是这样做的:

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);
于 2016-05-09T14:20:09.960 回答