r/PHPhelp • u/Ok-Television-8678 • Aug 21 '25
Solved Which payment system should I choose for a native PHP application, and why?
Hi everyone,
I’m currently working on a project with a native PHP application (no framework, just plain PHP), and I need to integrate a secure payment system.
I’m a bit lost between different options (Stripe, PayPal, Payoneer, Flutterwave, etc.), and I’d love to hear your advice on:
Which payment gateway works best with a PHP-based system
The pros and cons (fees, integration complexity, security, global support, etc.)
What you personally recommend and why
My main priorities are security, ease of integration, and support for international payments.
Thanks in advance!
23
u/PrizeSyntax Aug 21 '25
You don't choose the payment system based on the language used. It's a business decision, you might choose the easy one to integrate, but if the terms aren't good, it's no good and at the end of the day, you will loose money
Stripe is a breeze, haven't done PayPal in a while, but it was ok, as far as I remember, haven't integrated the rest from the list
3
u/NoDoze- Aug 22 '25
PHP works with all major payment gateways: PayPal, square, stripe, 2checkout, authorize.net, the list goes on. I haven't found a gateway that didn't work. PHP via API using curl. Its easy peazy.
2
u/tekagami Aug 21 '25
Stripe has proven to have the easiest implementation for both subscriptions and products. I have been using it for the last two years and it has not let me down. I likewise work without using frameworks and the workflow is essentially three files.
1
u/VRStocks31 Aug 22 '25
Stripe is good but also check out paddle if you want to support international payment and not having to handle VAT
1
u/somewhat-usefull Aug 22 '25
Id say stripe mostly because I’ve done it before.
It’s not a one click install, it requires some dev around it.
Make sure you at least use composer to save a-lot of time and install the php stripe library.
The install the Stripe web hook CLI tools for local dev.
If you’re doing subscriptions or one time payments, they slightly differ in configurations.
Here is the gist to get you started:
Stripe will give you a token for the webhook
(NOTE You should always work on test accounts especially with the webhook and must use the STRIPE WEBHOOK CLI)
Then your webhook listens for events from stripe… eg : stripe.invoice.paid = customer paid etc… then you can handle & track that yourself.
It’s good practice to have a database table for simple data storage about a customers payments & subscriptions.
Lastly, heres a useful simple Vanilla PHP youtube videos thats decent.
https://youtu.be/1KxD8J8CAFg?si=bqrVI7Kqkr2wa8iz
Goodluck
1
u/Anxious-Insurance-91 Aug 22 '25
People usually chose based on how much commission they charge per transaction... and usually the lowest wins unless you the payment processor covers a specific niece case.
Now there are cases where you can chose to have the payment form in your app and make the request to the different gateways and cases where you can make a form post to an outside url and let them handle the card form data.
in the first case you should keep some of the payment card data, be it not in clear along side an internal ID that you use to pivot with their own API
In the second case you still need to have that ID.
Look into different packages based on my first statement.
1
u/ameotoko255 Aug 22 '25
I had the best experience with Stripe. Solutions range from low-level building blocks to production ready Stripe-hosted checkout page with pregenerated link, zero-code. Also the best DX, fantastic docs, dev tools.
1
u/phpMartian Aug 22 '25
I implemented square a few years ago and it is solid for our use case.
1
u/SnooCookies3815 Aug 22 '25
generalize all payment systems:
/methods/paypal <- same input
/method/stripe <- same input
etc
for output:
same output url
/callback/paypal
/callback/stripe
/callback/...
return url
/thank-you/
this way you can build all of the methods without changing your code over and over.
1
u/Moceannl Aug 22 '25
Gold coins by mail!
1
u/3dom Aug 22 '25
I've implemented a bunch of payment system in my current project (~10). Stripe is the easiest.
Not to mention how good their development and support teams are. We've discovered two conflicts with our existing libraries and they've fixed both within the same week (on mobile/Android).
1
u/geilt Aug 22 '25
The big feature I love for stripe is the customer portal. It was a huge time saver.
1
u/[deleted] Aug 23 '25
This is really a cart before the horse question from what I can see. You're using "vanilla" PHP rather than any of the excellent PHP frameworks available to you -- this is a personal project, and you can't figure out how to get a simple webhook working.
And yet, you are asking for advice on which payment processor you should use?
THe answer to your question, as articulated previously, is to utilize a payment library (of which there are many) or to write your own, such that it be designed to support various payment processors, which is something you can do with adequate understanding of OOP, PHP OOP specific syntax like Interfaces, and Dependency Injection.
Examples of existing libraries are Sylius and Omnipay, amongst many others you could evaluate. If by "vanilla" php, you actually mean that you intend to write PHP 5.x style code, throw all your non namespaced scripts under the webroot rather than implement a front controller, reinvent the wheel for all HTTP processing and pretend that there aren't already robust well designed, tested and documented component libraries available (which the best known frameworks bundle together for you) then picking a payment processor is the least of your concerns.
In summary, are you using composer? Are you looking for components that will save you from making design mistakes or reinventing the wheel with low quality code that lacks unit tests? Best as I can tell, that seems to be the direction taken, and is adjacent to an X/Y.
1
u/UnspokenFears Aug 23 '25
https://mollie.com
1
u/OkActuator1742 Aug 24 '25
Stripe, PayPal, Square all work well with PHP. Adding XMoney too makes sense if you don’t want to calculate tax rules for cross border payments.
0
u/[deleted] Aug 22 '25
Stripe is if you are US based. Paddle, for other countries, paddle also has MOR, which makes handling tax in other countries easier. PayPal not as popular these days.
As for security:
0
u/Guimedev Aug 22 '25
Bizum
1
u/[deleted] Aug 22 '25
[removed] — view removed comment