jtrotsky / wise-cli

Command line tool to show using the Wise API in Go
MIT License
4 stars 0 forks source link

sandbox URL #2

Open gedw99 opened 3 years ago

gedw99 commented 3 years ago

Hey

Currently the URL is hardcoded to this in the code. // DefaultAPIBaseURL is the default base URL for API requests const DefaultAPIBaseURL = "https://api.transferwise.com"

Would it be useful to also be able to tell it to use the sandbox URL ? https://api.sandbox.transferwise.tech/

Maybe best way is to have a config boolean called "useSandbox", and then in pkg/client.go pick the right URL.


Also i noticed that there use different versions in the URL depending on the operation. https://api-docs.transferwise.com/#exchange-rates-list

https://api-docs.transferwise.com/#quotes-create

saw that your using the old one "/v1/quotes/" for some reason. Maybe the Sandbox and Production use different versions ?

jtrotsky commented 3 years ago

Good idea @gedw99 , sorry I took ages to see this. Have upgraded to v2 quotes , and will consider adding the env toggle as a config like you suggest (shouldn't be too hard)

gedw99 commented 3 years ago

Thanks @jtrotsky.