Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We also need development parameter to change base url #7

Open
peon501 opened this issue Sep 20, 2018 · 1 comment
Open

We also need development parameter to change base url #7

peon501 opened this issue Sep 20, 2018 · 1 comment

Comments

@peon501
Copy link

peon501 commented Sep 20, 2018

Base url should be:
production or development

BASE_URL = 'https://tripletex.no/v2';
or
BASE_URL = 'https://api.tripletex.io/v2';

@kentdahl
Copy link

Before I saw your PR #8 I did the simplest thing I thought could work; subclass TripletexClient, override method and instantiate that class before setting up $app.

If an option to change the endpoint is added, it should allow any end-point as an explicit setting.
This would allow proxying, internal network routings, testing setups etc.


<?php
namespace App\Gyre\Biz\Tripletex;
use \zaporylie\Tripletex\Client\TripletexClient;
class Client extends TripletexClient
{
    const APIT_TEST_BASE_URL = 'https://api.tripletex.io/v2';
    public static function getBaseUrl()
    {
        return config('services.tripletex.api_endpoint') ?? self::APIT_TEST_BASE_URL;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants