Search code examples
phplaravelpaypalpaypal-sandbox

Paypal Integration in laravel with two type of subscriptions


I am working on a Laravel project that uses Paypal as payment gateway. Paypal provides different type of transactions.

What I need is two types of functions:

  1. Subscription per month

    • a. Basic
    • b. Standard
    • c. Premium
  2. Pay as you go

    • as per the subscription plan price varies

Need to make the user subscribe to both plans with same button.

In PayPal both the above plans are separate ones. How to make it one? Is it possible?


Solution

  • Recurring purchases (subscriptions) and One-time purchases ("Pay as you go", in your case) normally require separate PayPal checkouts.

    You could try displaying a breakdown of everything together on your site and then, on opening the PayPal checkout, lumping the one-time portion of it into the setup_fee of a Subscription plan: https://developer.paypal.com/docs/api/subscriptions/v1/#definition-payment_preferences

    This seems awkward, and the breakdown wouldn't show in the PayPal.com transaction. But it would give a single checkout with totals that match what you seem to want.