Cannot read property 'updateCard' of undefined - Stripe update card in jQuery

199 views
Skip to first unread message

Simon Canning

unread,
Feb 16, 2015, 11:19:22 PM2/16/15
to api-d...@lists.stripe.com
In jQuery, how can I update a Stripe card using Stripe.js?

Here is my code:

    Stripe.setPublishableKey('pk_test_**key**');

    $('#btnCharge').on('click', function (e) {

        e.preventDefault();
        e.stopPropagation();

        Stripe.customers.updateCard("cus_**customer**", "card_**card**", {
            name: "Jane Austen"
        });

    });

I am getting the following console error:

    Cannot read property 'updateCard' of undefined

Here is the api code that I am referring to:

Matthew Arkin

unread,
Feb 16, 2015, 11:21:07 PM2/16/15
to api-d...@lists.stripe.com, api-d...@lists.stripe.com
UpdateCard is part of the node.js api, not Stripe.js

 Stripe.js is only used to create card tokens


Sent from Mailbox


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at http://groups.google.com/a/lists.stripe.com/group/api-discuss/.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Simon Canning

unread,
Feb 17, 2015, 12:10:35 AM2/17/15
to api-d...@lists.stripe.com
How is the best way to update a credit card that is store for a customer in Stripe while still being PCI compliant?

Matthew Arkin

unread,
Feb 17, 2015, 2:15:42 AM2/17/15
to api-d...@lists.stripe.com
You can use Stripe Checkout or Stripe.js to generate a token, then you send that token to your server and use the appropriate server-side API
--
Matt Arkin
Kollective Solutions
Reply all
Reply to author
Forward
0 new messages