Stripe - Tokenize a Customer Card
In order to Tokenize the Credit Card information with Stripe you can use the below API:
var stripe = new Stripe2.StripeApi("<STRIPE_CONNECTED_APP_NAME>");
var chargeInfo = new ChargeInfo() {
Firstname = "Jane",
Lastname = "Doe",
Amount = 1500.00M,
Currency = "USD",
Country = "US",
CardNumber = "4242424242424242",
ExpMonth = 3,
ExpYear = 2030,
CardCvc = "123",
Email = "david.smith@company.com",
City = "Toronto",
Street1 = "Main Street",
ZipCode = "A1A1A1",
State = "Ontario",
Description = "Testing Credit Card Subscription"
};
Stripe2.Card cardObject = Stripe2.StripeData.PrepareCardObject(chargeInfo);
Stripe2.Token cardToken = stripe.CreateCardToken(cardObject);
var tokenId = cardToken.Id;
Below is a complete list of fields available in ChargeInfo:
| Field | Type |
|---|
| Firstname | string |
| Lastname | string |
| CardNumber | string |
| CardCvc | string (3 or 4 characters) |
| Description | string |
| ExpMonth | integer |
| ExpYear | integer |
| Email | string |
| Phone | string |
| Fax | string |
| Street1 | string |
| Street2 | string |
| City | string |
| Country | string |
| ZipCode | string |