Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

Integrating Stripe.com with WordPress

Posted on March 6, 2012 by Pippin in Advanced, Tutorials, Writing Plugins 26 Comments
Home» Series » Integrating Stripe.com with WordPress
Tweet
Love It - 5

Stripe.com is a powerful payment processor that is designed for developers and is by far one of the best payment systems I have ever worked with. This tutorial series is going to walk you through how to integrate payment forms, payment tracking, setting up recurring payment profiles, and more in WordPress with the Stripe API.

We will start simple by just building a minimal payment form that allows a user to enter their card information and make a payment to you. We will then get more advanced and work with tracking payments and creating subscriptions, as well as storing / updating credit card information.

  • Stripe Integration Part 1 - Building the Settings and a Simple Payment Form
  • Stripe Integration Part 2 - Recurring Payments
  • Stripe Integration Part 3 - Variable Prices and Enhanced Plan Handling
  • Stripe Integration Part 4 - Multiple Recurring Payment Options
  • Stripe Integration Part 5 - Accepting Discount Codes
  • Stripe Integration Part 6 - Payment Receipts
  • Stripe Integration Part 7 - Creating and Storing Customers
  • Stripe Integration Part 8 – Working with Invoices
  • Stripe Integration Part 9 - The Stripe Button
API, payments, Stripe

26 comments on “Integrating Stripe.com with WordPress”

  1. AJ Clarke says:
    March 6, 2012 at 12:33 pm

    Oh fun!

    Reply
    • Pippin says:
      March 6, 2012 at 12:38 pm

      It will be :)

  2. Pat Ramsey says:
    May 17, 2012 at 2:24 pm

    Great series on hooking up Stripe to WordPress. I’ve been looking at Stripe for recurring payments & it was serendipity that I saw this series.

    I hacked the plugin a bit to work with CMB meta boxes. instead of giving the end-user a drop-down of all the plans, I needed to put that in the backend so I can select the right recurring plan for the client.

    I also replaced the default success message with the output from a wpeditor() field, allowing me to craft a custom message.

    Once I get some downtime, I can post some code.

    Again, Thanks for the series.

    Cheers!

    Reply
    • Pippin says:
      May 17, 2012 at 4:56 pm

      That sounds like a fantastic adaptation of the code :)

  3. Steve Dimmick says:
    June 9, 2012 at 12:36 am

    Awesome Plugin!! Thanks for sharing this. Have been working with it all day and it is rocking.
    One question though, when I use the shortcode on a page, the payment form gets output before all of the page content, even though in the page I have the form at the bottom.

    Any ideas on this?

    Reply
    • Pippin says:
      June 9, 2012 at 11:35 pm

      Did you download the plugin source code, or copy the tutorial code into your own plugin?

    • Steve Dimmick says:
      June 11, 2012 at 10:33 am

      I downloaded the plugin source code

    • Pippin says:
      June 11, 2012 at 1:32 pm

      Found the problem. I’ve just updated the source code available in Part 5. Download it again and everything should work fine.

    • Steve Dimmick says:
      June 25, 2012 at 12:46 pm

      Thanks Pippin – that worked like a charm.

      Another question though, could you do another part that details how to actually add the purchaser as a “Customer” within Stripe?

    • Pippin says:
      June 25, 2012 at 4:17 pm

      Do you mean for one-time charges? When a user signs up for a recurring payment, a customer is automatically created.

    • Steve Dimmick says:
      June 25, 2012 at 5:42 pm

      Ahh, yes, I meant for 1-time charges

    • Pippin says:
      June 25, 2012 at 7:34 pm

      Ah, yes, I can probably do that. I have a couple of different parts to the series to do first, but I will try and get to that.

  4. Steve Dimmick says:
    July 5, 2012 at 1:09 pm

    After spending quite some time on working with Stripe I have reached a major issue with the service. It appears there is no way to directly associate an email address with a financial transaction.

    I am awaiting a response from Stripe, but after going thru their API docs over and over, the only way I can see to do this is to create a unique Customer object for every transaction.

    Any thoughts?
    Steve

    Reply
    • Pippin says:
      July 5, 2012 at 5:42 pm

      As far as I know, you are completely correct in this. The only option (aside from creating a customer) is to store the email in the “description” field, which is what they recommend on the API Docs page.

      Is there any reason you wouldn’t want to create a customer for each charge?

    • Steve Dimmick says:
      July 5, 2012 at 9:47 pm

      I found that, I can’t believe they suggest that.

      The reason I want all of a customer’s purchases tied together is so that I can display the historical transactions associated to that customer on their “account” page.

      So, if I was to create a new Customer record for each purchase I would have no way of making those connections. I’d have to record all of their record id’s in my own table.

      So, I’d have to confirm that Stripe have a flawed data model. That in conjunction with their lack of a response to my query (about 6 hrs ago) has really sealed their fate.

      I really liked the idea of Stripe, but until they can improve the API and the service response, it’s not something I can trust my business too.

      Thanks for your tutorial on this Pippin. I greatly appreciated it. It was great a jumping off point.

      Steve ;)

    • Pippin says:
      July 5, 2012 at 9:55 pm

      There’s no need to create a new customer with each Charge. The Charge creation function accepts a customer ID as an option parameter. See here: https://stripe.com/docs/api?lang=php#create_charge

      As long as you create a customer with the first charge they make, the future charges are super simple, and it’s really easy to get all charges made by a particular user.

      Not to play the devil’s advocate, but 6 hours is hardly enough time to be considered too long. I’m sorry, but that’s ridiculously presumptuous (sorry to be harsh). Also, just FYI, the definite best way to get answers about Stripe is in their community chat room: https://stripechat.campfirenow.com/room/314456 – They almost always have devs in their to answer your questions. I’ve asked dozens of questions there and always gotten very helpful responses in under 5 minutes.

  5. amanie says:
    August 10, 2012 at 7:34 am

    Hi, its nice one. Where can find i download Stripe wordpess plugin?

    Reply
    • Pippin says:
      August 10, 2012 at 9:18 am

      Go to the last part in the series and download it at the bottom of the post.

  6. Bret says:
    December 11, 2012 at 7:50 pm

    Do you need to use the plugin on a PCI complaint web site?

    Reply
    • Pippin says:
      December 11, 2012 at 8:24 pm

      Not required but it is a good idea.

  7. Anthony says:
    February 27, 2013 at 2:32 am

    Hey Pippin, great plugin!

    I’m running into an error though
    On one site it works perfectly, on another I get the error:

    urlencode() expects parameter 1 to be string, array given in /wp-content/plugins/wordpress-stripe-integration/lib/Stripe/ApiResource.php on line 43

    I’m not quite sure what it could be. I’ve disabled all plugins (in case of a conflict) to no avail.

    Could you Help me out? Thanks!

    Reply
    • Pippin says:
      February 27, 2013 at 3:43 pm

      When do you get that error? While processing a payment?

    • Anthony says:
      February 27, 2013 at 5:52 pm

      Thanks for replying back. Yeah, I see a charge in my account when using the form. However, no customer is created. I’m guessing it processes the card, then runs into an error before adding the customer to a plan.

    • Pippin says:
      March 2, 2013 at 4:39 pm

      At what point does that error get displayed?

  8. JC says:
    April 4, 2013 at 12:20 pm

    Hi,

    Thanks for the article. The payments seem to be working flawlessly. However, I’m having an issue with the shortcode. For some reason the payment form always appears at the top of the page, not where I’ve placed the shortcode in the editor. Any idea what’s going on here?

    Thanks!

    Reply
    • Pippin says:
      April 4, 2013 at 6:54 pm

      Make sure that you are returning the short code HTMl, not echoing it.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes
  • Plugin Development 101 – Registering a Custom Post Type
  • Plugin Development 101 – Intro to Actions

Latest Tutorials

  • Submitting Your First Pull Request to a WordPress Plugin on Github (2)

    Github is an extremely popular tool for managing WordPress plugins, and one...

  • Plugin Development 101 – Introduction to Adding Dashboard Menus (1)

    Adding new menus, both top level and sub level, to the WordPress Dashboard is a really common task for plugins...

  • Plugin Development 101 – Intro to Loading Scripts and Styles (16)

    In this part of Plugin...

Enter your email to receive automated updates when new posts are published

Latest Tweets

  • @curtismchale @Krogsgard @wpengine yes! #blamekrogs
    May 22, 2013
  • RT @andrewspittle: The Rule of Awesome: http://t.co/P3v62eTtQx
    May 22, 2013
  • @curtismchale @wpengine haha, who do I get to blame?
    May 22, 2013

Topics

featured get_user_meta the_content shortcodes contextual help Sugar Event Calendar add_options_page campaign monitor meta box Rémi Corson add_shortcode register_setting wp_enqueue_script authors attachment image plugin forms login short codes do_action Related posts mail chimp apply_filters bbpress comments recent posts post types short code taxonomies custom post type gallery Ajax images Stripe taxonomy jquery users widgets add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2011 Pippin's Plugins