In an earlier post in this series, I covered how you create an HTML form for securely handling payments via Stripe. In the previous post, I walked through the JavaScript that goes with that form. As explained in that post, thanks to the Stripe.js library, the proper HTML, and a bit of JavaScript, you can easily and securely handle payments on your site without getting mired in the PCI compliance muck. The secret is the Stripe.js library: it sends the customer’s payment information from the client to Stripe’s server and returns a token that Stripe associated with that payment information. Then, when the form is submitted, the token can be used by the PHP on your site to actually process the payment. The customer’s payment information, however, never touches your server. You get paid and the customer is protected.
In this post, I’ll walk through the necessary PHP code that actually processes the payment request. Note that this article assumes that you have read the previous articles and are comfortable with PHP.
Continue Reading...