muhammad-umar/ppp-gateway

Purchasing Power Parity (PPP) fair pricing adjustment by countries with Stripe (or any other payment gateway supported by Laravel Cashier) integration powered by data from the World Bank

Maintainers

Package info

github.com/MuhammadQuran17/ppp_stripe

pkg:composer/muhammad-umar/ppp-gateway

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.0 2026-02-24 12:15 UTC

This package is auto-updated.

Last update: 2026-04-25 16:18:44 UTC


README

"Buy Me A Coffee"

Detailed article is availabe at https://docs.agenytics.com/blog/ppp-stripe

Implementing Purchasing Power Parity (PPP) pricing per country for a Stripe Checkout purchase flow. But you can use it for any other payment gateway, like PayPal, Paddle, Lemon Squeezy, etc. This package uses World Bank PPP data and TrustIP to detect VPN/Proxy.

Installation in Existing Laravel Project

  1. Install the package

    composer require muhammad-umar/ppp-gateway
  2. Publish the assets

    # PPP Data CSV
    php artisan vendor:publish --tag="ppp-gateway-data"

    Optional: You can also publish the config and migrations files:

    php artisan vendor:publish --tag="ppp-gateway-config"
    php artisan vendor:publish --tag="ppp-gateway-migrations"
  3. Run migrations

    php artisan migrate
  4. Import PPP data

    php artisan import:ppp

We have used lifetime product for demonstration purposes. You can use any other product you want.

  1. Configure environment variables

    STRIPE_LIFETIME_PRODUCT_ID=prod_xxxxx
    TRUSTIP_API_KEY=your_trustip_api_key
  2. Configure subscription plans

We have subscription-plans.php config file for payment products. You can configure it as you want. You should use this data to show price in frontend, sending PPPService->getAdjustedPriceData() parameter from your Controller.

  1. Checkout page

From fronted you should send a POST request to /purchase route (see PPPGatewayServiceProvider.php for route registration). It is binded to PurchaseController that will create a checkout session with adjusted price for the selected country.

License

MIT