1. Make sure Lorikeet is installed with the stripe extra, by running pip install[stripe].
  2. Add 'lorikeet.extras.stripe' to your INSTALLED_APPS.
  3. Set the STRIPE_API_KEY variable in to your Stripe API key.



These examples use the js, but everything works the same if you’re using the api directly, since the JavaScript API is only a thin wrapper.

On creation, the Stripe payment method takes only one parameter, the token that you get from Stripe.js.

Stripe.card.createToken(form, function(status, response){
    if (status == 200){
        client.addPaymentMethod("StripeCard", {token:})

Once they’re created, in the cart they’ll show up with their brand and last 4 digits.

// [{
//     type: "StripeCard",
//     url: "/_cart/payment-methods/1/",
//     selected: true,
//     data: {brand: "Visa", last4: "4242"},
// }]

If you try to charge the card and the charge fails,