How do you create a customer using stripe?

224 views
Skip to first unread message

Phillip Senn

unread,
May 20, 2015, 4:06:02 PM5/20/15
to cfpa...@googlegroups.com
I see their ruby, python, php and node examples but I don't understand how to translate

https://stripe.com/docs/tutorials/subscriptions#subscribing-a-customer-to-a-plan

into ColdFusion.

Where does "stripe.customers.create" come from in the node example, or
"\Stripe\Customer::create" in the php?


Phil Cruz

unread,
May 20, 2015, 4:16:49 PM5/20/15
to cfpa...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "cfpayment" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfpayment+...@googlegroups.com.
To post to this group, send email to cfpa...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfpayment.
For more options, visit https://groups.google.com/d/optout.

Brian G

unread,
May 31, 2015, 2:37:35 PM5/31/15
to cfpa...@googlegroups.com, phill...@gmail.com

Phillip,

You create a customer in Stripe from a stripe.js token OR a credit card or bank account struct you pass.  So basically, get your cfpayment Stripe gateway, then:

token = cfpayment.createToken().setID(token-value-from-stripejs);
customer = gw.store(token);

I've made a series of major changes today to Stripe in cfpayment which I'll detail separately in a moment.  But to charge, you would do either:

amount = cfpayment.createMoney(5000);

// charge the one-time token from stripejs by converting it to a cfpayment token and passing to purchase as the account
charge = gw.purchase(money = amount, account = token);

// charge the customer instead by converting the customer token (cus_*) into a cfpayment token and passing to purchase
customer_token = cfpayment.createToken().setID(customer.getTransactionId());
charge = gw.purchase(money = amount, options = {customer: customer_token});

Harold Loving

unread,
Aug 27, 2015, 8:40:16 AM8/27/15
to cfpayment
I think it would be helpful to have this line somewhere in the docs or examples:

token = cfpayment.createToken().setID(token-value-from-stripejs);

Thanks

Brian G

unread,
Aug 27, 2015, 11:05:59 AM8/27/15
to cfpayment

Samples for all the stripe functionality can be found in the unit tests:

https://github.com/ghidinelli/cfpayment/tree/master/api/gateway/stripe/tests

I have a branch I'm working on with some improvements and more tests coming soon.

Brian
Reply all
Reply to author
Forward
0 new messages