1. Go to this page and download the library: Download oseintow/baremetrics-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
5
use Oseintow\Baremetrics\Facades\Baremetrics;
Route::get("baremetric_sources",function()
{
// If you have "BAREMETRICS_API_KEY" set in your env file then the will be no need to set `setApiKey`
$apiKey = "xx-xx-x-xx-xx-xx"
// Use isLiveMode to set your mode to production / sandbox
// True for production and false for sandbox
// It is false by default
$response = Baremetrics::setApiKey($apikey)->isLiveMode(true)->get("sources");
$sourceId = "";
foreach($response['sources] as $sourece){
if($source['provider'] == "baremetrics"){
$sourceId = $source['id'];
}
}
});