tuurbo/spreedly

Question about Base Url

Closed this issue · 5 comments

We need the ability to change the base URL with a config. This is because we need to route our spreedly calls through another service first then do some mappings and let that other service then forward to spreedly.

If I submit a PR which would allow overriding the Base spreedly URL (but still defaulting to the correct url) would that be something you would approve or is this something you'd rather me maintain in a separate fork?

Yes, a PR is fine with me

@tuurbo I just had a thought, but I'm not sure how to implement. I could also make a facade and override the Client.php class but I'm not sure how I would get my code to load that new file instead of the normal file.

If I understand your comment, wouldn't you just remove any Tuurbo\Spreedly\... lines and add to your config/app.php file

'providers' => [
    ...
    MyApp\Foo\CustomSpreedlyServiceProvider::class,
],
'aliases' => [
    ...
    'Spreedly' => MyApp\Foo\CustomSpreedlyFacade::class,
]

@tuurbo another question about this - I couldn't quite figure out how to override it, so I'm proceeding with my original plan of including base url in the config so it can be set through Spreedly::mergeConfig().

It took me a couple minutes to figure out how to run the unit tests. Would you be opposed to me adding a package.json simply so people can do npm test to run phpspec? Also, I can update the readme with test instructions for development. Any opposition?