48 lines
1.8 KiB
PHP
48 lines
1.8 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/*
|
||
|
|
|--------------------------------------------------------------------------
|
||
|
|
| Box Now credentials
|
||
|
|
|--------------------------------------------------------------------------
|
||
|
|
|
|
||
|
|
| Box Now uses OAuth2 client-credentials: exchange BOXNOW_CLIENT_ID /
|
||
|
|
| BOXNOW_CLIENT_SECRET for a Bearer access token (POST /auth-sessions,
|
||
|
|
| ~1hr expiry), then attach it as an Authorization header on every call.
|
||
|
|
| Unlike ACS, there is no separate per-request credential body — the
|
||
|
|
| token alone authorizes all calls once obtained.
|
||
|
|
|
|
||
|
|
| Set these via environment variables — never commit real values.
|
||
|
|
|
|
||
|
|
| BOXNOW_BASE_URL Root REST endpoint for delivery-requests/parcels.
|
||
|
|
| BOXNOW_LOCATION_API_URL Separate, faster endpoint for origins/destinations
|
||
|
|
| lookups (Box Now recommends this over the main
|
||
|
|
| base URL for those two calls specifically).
|
||
|
|
| BOXNOW_CLIENT_ID OAuth2 client id.
|
||
|
|
| BOXNOW_CLIENT_SECRET OAuth2 client secret.
|
||
|
|
| BOXNOW_ORIGIN_LOCATION_ID Your warehouse's Box Now locationId, used as
|
||
|
|
| the pickup origin on every delivery request.
|
||
|
|
| BOXNOW_SENDER_* Static sender contact details reused on every
|
||
|
|
| delivery request.
|
||
|
|
|
|
||
|
|
*/
|
||
|
|
|
||
|
|
return [
|
||
|
|
|
||
|
|
'base_url' => env('BOXNOW_BASE_URL', 'https://api-production.boxnow.gr/api/v1'),
|
||
|
|
'location_api_url' => env('BOXNOW_LOCATION_API_URL', 'https://locationapi-production.boxnow.gr/api/v1'),
|
||
|
|
|
||
|
|
'client_id' => env('BOXNOW_CLIENT_ID'),
|
||
|
|
'client_secret' => env('BOXNOW_CLIENT_SECRET'),
|
||
|
|
|
||
|
|
'origin_location_id' => env('BOXNOW_ORIGIN_LOCATION_ID'),
|
||
|
|
|
||
|
|
'sender' => [
|
||
|
|
'name' => env('BOXNOW_SENDER_NAME'),
|
||
|
|
'email' => env('BOXNOW_SENDER_EMAIL'),
|
||
|
|
'phone' => env('BOXNOW_SENDER_PHONE'),
|
||
|
|
],
|
||
|
|
|
||
|
|
'timeout' => env('BOXNOW_HTTP_TIMEOUT', 10),
|
||
|
|
|
||
|
|
];
|