Abhinav Rai

Stripe Vs Paypal

My Developer friendly rating: Stripe — 9, Paypal — 7

Use case: I want to purchase Analytics & Tools of Grambuddy Subscription for 6 months.

Stripe

Stripe payment portal Stripe payment portal

  1. I send a call from frontend to backend with the Instagram username, Instagram ID, Time ID, Currency ID, and Features array ID after user selected the desired things.
  2. Backend makes the token by making a call to stripe. Specify the things and image url to be shown on the stripe screen.
  3. After frontend receives this token, it redirects to stripe checkout pages with this token. With this token, stripe knows how much money and for what it is. User pays by their card and are redirected to the redirect url we specify in making the token.
  4. Also, as soon as the payment is complete and before the redirect happens, a call to webhook url happens. In this webhook url, I validate the request in the backend from stripe and then add 6 months for Analytics and tools feature for the specific user.
  5. On redirect url, we get the same token. I store it in the backend for analytics purpose but anyone coming on the redirect url is not the source of truth for payment to happen

Paypal

Paypal works a little bit different from Stripe. Also, they have their checkout with Paypal buttons where you can choose Paypal, Mastercard, Visa, etc.

I didn’t like their UX much as compared to Stripe. It didn’t have the startup aura in it. Also too much constraints for creating a sandbox client unlike some test cards in Stripe. The Process -

  1. The user has selected the package features and time frames and we already know the Payment amount to deduct, the currency and time frame so we make a call to order api by createOrder.
  2. When the call succeeds, we get the data in onApprove with data like unique transaction id, payee name, address, etc. We then make a call to our backend saving all these details for a specific user and updating the user’s features and time in our db.

Sandbox feature was down when I was working on this and thus felt kinda frustated. Although Paypal’s approach is pretty easy that stripe. But because of Stripe’s awesome support and UX, I would always go for Stripe until I want some feature which Stripe doesn’t have and is served by paypal.

Some learnings while building a payment portal —

  1. Always make interfaces (both on frontend and backend). You don’t want to change everywhere when you shift from one to other.