Table of Contents


Stripe Account Management

The following sample codes give you an idea how create customer records, or create a payment intent, account token and more.

Create Customer with Credit Card

var stripe = new Stripe2.StripeApi("<STRIPE_CONNECTED_APP_NAME>");
var chargeInfo = new ChargeInfo() {
    //...
};
Stripe2.Card cardObject = Stripe2.StripeData.PrepareCardObject(chargeInfo); 
Stripe2.Token cardToken = stripe.CreateCardToken(cardObject);
string cartTokenId = cardToken.Id;
var customrObject = Stripe2Data.PrepareCustomerObject("card", chargeInfo, cartTokenId);
var customer = stripeApi.CreateCustomer(customerObject);
string customerId = customer.Id;

Customer Properties

Property NameProperty Type
Idstring
ObjectNamestring
AddressAddress
Balancestring
Createdlong
Currencystring
DefaultSourcestring
Descriptionstring
Emailstring
InvoicePrefixstring
InvoiceSettingsInvoiceSettings
Namestring
NextInvoiceSequencestring
Phonestring
ShippingShipping
Sourcestring
TaxExemptstring (none, exempt or reverse)
TestClockstring

 

Credit Card Payment Intent

var cardSettings = new CreditCardSettings {
    RedirectUrl = "<callback_url>",
    Tokenize = false
};
var paymentIntent = Stripe2Data.PreparePaymentIntentObject(chargeInfo,
 cardSettings, 
 customerId, 
 cardId);
 
var intent = stripeApi.CreatePaymentIntent(paymentIntent);

 

Create Bank Account Token

var chargeInfo = new ChargeInfo() {
  AccountType = "individual",
  RoutingNumber = "110000000",
  AccountNumber = "000123456789", 
  BankName = "Test Bank Account",
  NameOnAccount = "Jane Doe", 
  Amount = 150.00M, 
  Currency = "USD", 
  Country = "US",
  Email = "jane.doe@gmail.com",
  City = "Toronto",
  Street1 = "Main Street",
  ZipCode = "A1A1A1",
  State = "Ontario", 
  Description = "Testing Stripe ACH" 
};
 
var stripe = new Stripe2.StripeApi("<STRIPE_CONNECTED_APP_NAME>");
var bankAccountObject = Stripe2Data.PrepareBankAccountObject(chargeInfo);
var bankAccountToken = stripe.CreateAccountToken(bankAccountObject);


Token properties

Property NameProperty Type 
Idstring 
ObjectNamestring 
CardCard (object) 
BankAccountBankAccount (object) 
Typestring 
Usedbool 

 

Verify Bank Account

var bankAccount = stripe.VerifyBankAccount(customerId, bankAccountId);


BankAccount Properties

Property NameProperty Type
Idstring
ObjectNamestring
AccountHolderNamestring
AcocuntHolderTypestring
AccountTypestring
AccountNumberstring
BankNamestring
Countrystring
Currencystring
Customerstring
Fingerprintstring
Last4Digitstring
RoutingNumberstring
Statusstring

 

Create Customer via Bank Account

var customerObject = Stripe2Data.PrepareCustomerObject("account", 
   chargeInfo, 
   bankAccountTokenId); 
var customer = stripe.CreateCustomer(customerObject);