In this post, I’m going to demonstrate how to accept payments in a Symfony project by integrating Stripe, a cloud-based platform (PaaS) that offers secure payment processing and recurring billing for all major debit and credit cards from customers in every country. Card details are some of the most sensitive customer data you can store, and while it may be tempting to handle payment processing yourself, both your software and business must be PCI DSS compliant and regularly audited to confirm this fact. Stripe minimises this burden by ensuring that no sensitive information passes through your application server, instead, they capture payment details client-side and send back a tokenized representation you can then use to make a charge with their API.
To add some real-world context I’ve implemented a companion web app – a blog site with premium content which we’ll modify so that users can pay a nominal fee to access. I’ll cover how to use Stripe’s pre-built UI components and PHP SDK, as well as how to utilize webhooks to handle refund events. Therefore, this article does assume you have a development environment capable of running a Symfony project and some experience with the framework. If you’re looking to start using Symfony then I’d recommend Knp University’s screencast on Joyful Development with Symfony 3. You may notice when running the web app that users can also verify their phone number to upgrade to premium, if you’re interested in learning more about this feature then check out our previous article “How to verify phone numbers with PHP, Symfony, and Twilio.” https://goo.gl/MdXHnh #DataIntegration #ML