Stripe.createCustomer()

Create a new customer in Stripe

Usage

Hover over inputs/exits for more info.

var Stripe = require('machinepack-stripe-subscriptions');


// Create a new customer in Stripe

Stripe.createCustomer({

apiKey: 'somestring837483749blah',

description: 'sdjasnd928u8duasd',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (newCustomer) {

 

},

});

Inputs

apiKey required

Your Stripe API key

'somestring837483749blah'
description

Arbitrary string to attach to the customer in Stripe

'sdjasnd928u8duasd'

Exits

error

An unexpected error occurred.

success

OK.

{ id: 'cus_4kmLwU2PvQBeqq',
  object: 'customer',
  created: 1410377376,
  livemode: false,
  description: 'Customer for weatherforensics@wdtinc.com',
  email: null,
  delinquent: false,
  metadata: {},
  subscriptions: 
   { object: 'list',
     total_count: 0,
     has_more: false,
     url: '/v1/customers/cus_4kmLwU2PvQBeqq/subscriptions' },
  discount: null,
  account_balance: 0,
  currency: 'usd',
  cards: 
   { object: 'list',
     total_count: 1,
     has_more: false,
     url: '/v1/customers/cus_4kmLwU2PvQBeqq/cards',
     data: 
      [ { id: 'card_14bGkv2eZvKYlo2Co1ndeHIy',
          object: 'card',
          last4: '4242',
          brand: 'Visa',
          funding: 'credit',
          exp_month: 9,
          exp_year: 2014,
          fingerprint: 'Xt5EWLLDS7FJjR1c',
          country: 'US',
          name: 'test',
          address_line1: '2324 SW 137th Street',
          address_line2: '',
          address_city: '73170',
          address_state: 'OK',
          address_zip: '73170',
          address_country: 'US',
          cvc_check: 'pass',
          address_line1_check: 'pass',
          address_zip_check: 'pass',
          customer: 'cus_4kmLwU2PvQBeqq' } ] },
  default_card: 'card_14bGkv2eZvKYlo2Co1ndeHIy' }