Repository: TelePay-cash/telepay-python (language: python)

Issue:
Telepay client don´t get the client secret
**Describe the bug**
Telepay client don´t get the secret key in the constructor

**To Reproduce**

    with TelePaySyncClient(secret_api_key="TELEPAY_SECRET_API_KEY") as client:
        print(client.get_invoice(invoice_id))

**Expected behavior**
print the invoice but instead raise Telepay error with the text: Telepay is no setted, I think [this line](https://github.com/TelePay-cash/telepay-python/blob/c06735190baa1f08a46edf8728e0185739d92b61/telepay/v1/auth.py#L13) isn't by default

Telepay client don´t get the client secret
**Describe the bug**
Telepay client don´t get the secret key in the constructor

**To Reproduce**

    with TelePaySyncClient(secret_api_key="TELEPAY_SECRET_API_KEY") as client:
        print(client.get_invoice(invoice_id))

**Expected behavior**
print the invoice but instead raise Telepay error with the text: Telepay is no setted, I think [this line](https://github.com/TelePay-cash/telepay-python/blob/c06735190baa1f08a46edf8728e0185739d92b61/telepay/v1/auth.py#L13) isn't by default



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a486015..c67d4e6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,14 +4,19 @@ on: [push, pull_request]
 jobs:
   CI:
     runs-on: ubuntu-latest
+    strategy:
+      max-parallel: 4
+      matrix:
+        python-version: [ "3.8", "3.9", "3.10" ]
+
     steps:
     - uses: actions/checkout@v2
       with:
         ref: ${{ github.event.pull_request.head.sha }}
-    - name: Set up Python 3.8
+    - name: Set up Python ${{ matrix.python-version }}
       uses: actions/setup-python@v2
       with:
-        python-version: 3.8
+        python-version: ${{ matrix.python-version }}
     - name: Set up Poetry 2.1.0
       uses: abatilo/actions-poetry@v2.1.0
       with:
diff --git a/telepay/v1/auth.py b/telepay/v1/auth.py
index 3e0b9b5..f3c1207 100644
--- a/telepay/v1/auth.py
+++ b/telepay/v1/auth.py
@@ -12,6 +12,13 @@
 class TelePayAuth:
     secret_api_key: str = field(default=environ["TELEPAY_SECRET_API_KEY"])
 
+    def __init__(self, secret_api_key=None):
+        if secret_api_key:
+            self.secret_api_key = secret_api_key
+        else:
+            self.secret_api_key = environ["TELEPAY_SECRET_API_KEY"]
+        self.__post_init__()
+
     def __post_init__(self):
         if not self.secret_api_key:
             raise TelePayError(0, "TELEPAY_SECRET_API_KEY is not setted")


Test patch:
diff --git a/tests/v1/_async/test_client.py b/tests/v1/_async/test_client.py
index ff997bb..463b23a 100644
--- a/tests/v1/_async/test_client.py
+++ b/tests/v1/_async/test_client.py
@@ -1,3 +1,5 @@
+import os
+
 from httpx import Timeout
 from pytest import fixture
 from pytest import mark as pytest_mark
@@ -42,6 +44,14 @@ async def test_error(client: TelePayAsyncClient):
         assert True
 
 
+@pytest_mark.anyio
+async def test_client_with_context():
+    api_key = os.environ["TELEPAY_SECRET_API_KEY"]
+    # TODO: add more tests and probate the client api is the same
+    async with TelePayAsyncClient(secret_api_key=api_key) as client:
+        assert client is not None
+
+
 @pytest_mark.anyio
 async def test_get_me(client: TelePayAsyncClient):
     await client.get_me()
diff --git a/tests/v1/_sync/test_client.py b/tests/v1/_sync/test_client.py
index 2e8f01d..5aae90c 100644
--- a/tests/v1/_sync/test_client.py
+++ b/tests/v1/_sync/test_client.py
@@ -1,3 +1,5 @@
+import os
+
 from httpx import Timeout
 from pytest import fixture
 from pytest import mark as pytest_mark
@@ -42,6 +44,14 @@ def test_error(client: TelePaySyncClient):
         assert True
 
 
+@pytest_mark.anyio
+def test_client_with_context():
+    api_key = os.environ["TELEPAY_SECRET_API_KEY"]
+    # TODO: add more tests and probate the client api is the same
+    with TelePaySyncClient(secret_api_key=api_key) as client:
+        assert client is not None
+
+
 @pytest_mark.anyio
 def test_get_me(client: TelePaySyncClient):
     client.get_me()