Table of Contents


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>");

//create a ChargeInfo object to populate and pass information to Stripe.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" 
}; 

//create the profile in Stripe and get the token.
Stripe2.Card cardObject = Stripe2.StripeData.PrepareCardObject(chargeInfo); 
Stripe2.Token cardToken = stripe.CreateCardToken(cardObject);
 
//access the token:var tokenId = cardToken.Id;

 

Below is a complete list of fields available in ChargeInfo:

FieldType
Firstnamestring
Lastnamestring
CardNumberstring
CardCvcstring (3 or 4 characters)
Descriptionstring
ExpMonthinteger
ExpYearinteger
Emailstring
Phonestring
Faxstring
Street1string
Street2string
Citystring
Countrystring
ZipCodestring