diff --git a/barte/client.py b/barte/client.py index ac38572..99a7f02 100644 --- a/barte/client.py +++ b/barte/client.py @@ -109,18 +109,6 @@ def create_card_token(self, card_data: Dict[str, Any]) -> CardToken: data_class=CardToken, data=response.json(), config=DACITE_CONFIG ) - def create_pix_charge(self, data: Dict[str, Any]) -> PixCharge: - """Create a PIX charge""" - endpoint = f"{self.base_url}/v1/charges" - - pix_data = {**data, "payment_method": "pix"} - - response = requests.post(endpoint, headers=self.headers, json=pix_data) - response.raise_for_status() - return from_dict( - data_class=PixCharge, data=response.json(), config=DACITE_CONFIG - ) - def get_pix_qrcode(self, charge_id: str) -> PixCharge: """Get PIX QR Code data for a charge""" endpoint = f"{self.base_url}/v2/charges/{charge_id}" diff --git a/tests/test_client.py b/tests/test_client.py index fc31eb3..3b4f782 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -207,36 +207,6 @@ def test_create_order(self, mock_post, barte_client, mock_order_response): json=order_data, ) - @patch("requests.post") - def test_create_pix_charge(self, mock_post, barte_client, mock_pix_charge_response): - """Test creating a PIX charge""" - mock_post.return_value.json.return_value = mock_pix_charge_response - mock_post.return_value.raise_for_status = Mock() - - pix_data = { - "amount": 3, - "description": "PIX Test", - "customer": { - "name": "John Doe", - "tax_id": "123.456.789-00", - "email": "john@example.com", - }, - } - - charge = barte_client.create_pix_charge(pix_data) - - assert isinstance(charge, PixCharge) - assert charge.paymentMethod == "PIX" - assert charge.value == 3 - assert charge.customer.name == "John Doe" - - expected_data = {**pix_data, "payment_method": "pix"} - mock_post.assert_called_once_with( - f"{barte_client.base_url}/v1/charges", - headers=barte_client.headers, - json=expected_data, - ) - @patch("requests.post") def test_create_card_token(self, mock_post, barte_client): """Test creating a card token"""