Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

VertexBuffer's avatar

Best way to approach payment gateway?

So I want to create a payment "gateway" of such that allows me to use multiple payment providers on my website with a consistent API.

I've seen https://github.com/thephpleague/omnipay and want and have tried to use it, but honestly the lack of documentation and people willing to help with learning it is just so scarce that I don't even see a point. So I was wondering what other options I had to tackle this.

I was also hoping to get some sort of clarification on what sort of payment flow I should be using for Stripe when I've got my backend in Laravel but a frontend that's an SPA. Because Stripe seems to have so many different ways of integrating it and I'm not entirely sure what is and isn't deprecated anymore...

0 likes
13 replies
VertexBuffer's avatar

Hey @jlrdw

Sadly Cashier doesn't fit my needs. I'm only interested in making 1 off payments, not subscriptions. :)

jlrdw's avatar

Have you looked at spatie. I think that's very limited however.

You probably just need to go with PayPal. I've used it in the past but it's been a while.

VertexBuffer's avatar

Hey @jlrdw ,

The repo has been archived and is labelled as unmaintained so I wouldn't feel comfortable putting this into production. On top of that they currently only have 1 implementation which I have no use for.

Thanks for the suggestion though.

jlrdw's avatar

Did you see my PayPal suggestion that's what I would use.

VertexBuffer's avatar

@jlrdw I don't like PayPal and don't want to use it. + Even if I did that would then restrict me to just PayPal and doesn't make it much of a gateway! Just a single payment processor then.

@deladels Not interested in PayPal. Sorry!

daugaard47's avatar

Best way to approach payment gateway?

Use Stripe, there's really is no other reason not to. I've been down this road and have tried other gateways and all roads lead back to Stripe. It does:

  1. One-Off payments
  2. Subscription
  3. ACH with the use of Plaid this is amazing. Plaid now has a pay as you go plan. $1.50 per ACH transaction, though you would only really need this if your doing subscriptions. (One-time $1.50 fee, for the first recurring setup only, not each month)

Also Cashier does do one-off charges too. https://laravel.com/docs/5.7/billing#single-charges

But honestly, I don't use Cashier, the Stripe docs are amazing.

Single Charge:

  1. Create your customer
  2. Charge your customer
  3. Catch any errors if necessary

Braintree is good too, but I prefer not to use it. I have no reason too.

Why do you need multiple gateways?

If you need help getting up and running with Stripe I would be happy to help.

1 like
VertexBuffer's avatar

@daugaard47

By the way it was worded in the Cashier docs it sounded like you could only make a one-off charge IF the user is already a paying subscriber.

I do intend to use Stripe, but I need a payment gateway to allow payments from other countries. Not everyone has a card and in some cases, especially in Europe, people prefer paying with things like iDEAL, SOFORT, etc...

I wanted to use OmniPay as the gateway and use Stripe, Mollie, and possibly a few others. But the docs for OmniPay and its accompanying drivers are just awful. The Stripe one especially is incredibly confusing because the docs imply it should receive a card token first from the user, then you create the PaymentIntent on the server.

Where as the actual Stripe docs state you should create a Payment Intent first, then collect the card information and send it to the server to fulfil the Payment Intent.

daugaard47's avatar

@zyxxyzyxz I always check if the customer exists in Stripe first so I don't have duplicate customers. And if they are already a customer of yours you can simply ask if they want to pay with their current payment method within Stripe. No need to enter in their card again.

Also Stripe supports processing payments in 135+ currencies

They also support iDeal, Sofort, etc..

Sorry, not trying to sway you away from OmniPay, you seem pretty set on it. I just think using OmniPay will make more work for you than there needs to be.

Stripe is covering all their bases.

deladels's avatar

@daugaard47 I haven't used stripe myself before. should the need arise? I'd definitely reach out.

Please or to participate in this conversation.