Calculate Fair Product Prices Based On Your Customer's Location (Purchasing Power Parity)
You can install the package via composer:
composer require christophrumpel/fair-product-prices
You can publish the config file with:
php artisan vendor:publish --provider="Christophrumpel\FairProductPrices\FairProductPricesServiceProvider" --tag="fair-product-prices-config"
This is the contents of the published config file:
<?php
return [
/*
|--------------------------------------------------------------------------
| You can override the ppp conversion factor for specific countries
|--------------------------------------------------------------------------
|
*/
'pppConversionFactor' => [
//'IT' => 0.9
],
/*
|--------------------------------------------------------------------------
| Paddle credentials for creating a Paddle pay link
|--------------------------------------------------------------------------
|
*/
'paddle' => [
'vendor_id' => env('PADDLE_VENDOR_ID'),
'auth_code' => env('PADDLE_AUTH_CODE'),
]
];
use Christophrumpel\FairProductPrices\Facades\FairProductPrices;
// Determine your customer's location
$customerLocation = FairProductPrices::getLocation('IP Address');
// Calculate a fair price
$defaultPrice = 100;
$fairPrice = FairProductPrices::getFairPrice($defaultPrice, $customerLocation->getCountryCode());
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.