diff --git a/modules/connectors/canadapost/karrio/providers/canadapost/shipment/create.py b/modules/connectors/canadapost/karrio/providers/canadapost/shipment/create.py index e2f9fecc88..1a34664c81 100644 --- a/modules/connectors/canadapost/karrio/providers/canadapost/shipment/create.py +++ b/modules/connectors/canadapost/karrio/providers/canadapost/shipment/create.py @@ -49,7 +49,7 @@ def _extract_shipment( carrier_name=settings.carrier_name, carrier_id=settings.carrier_id, tracking_number=info.tracking_pin, - shipment_identifier=info.tracking_pin, + shipment_identifier=info.shipment_id, docs=models.Documents(label=label), label_type=ctx["label_type"], meta=lib.to_dict( diff --git a/modules/connectors/canadapost/tests/canadapost/test_shipment.py b/modules/connectors/canadapost/tests/canadapost/test_shipment.py index 2e1eb5115e..44f94e3b75 100644 --- a/modules/connectors/canadapost/tests/canadapost/test_shipment.py +++ b/modules/connectors/canadapost/tests/canadapost/test_shipment.py @@ -87,11 +87,11 @@ def test_cancel_shipment(self): info_call, cancel_call = mocks.call_args_list self.assertEqual( info_call[1]["url"], - f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/123456789012", + f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/545021584835957806", ) self.assertEqual( cancel_call[1]["url"], - f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/123456789012", + f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/545021584835957806", ) def test_cancel_transmitted_shipment(self): @@ -103,11 +103,11 @@ def test_cancel_transmitted_shipment(self): info_call, refund_call = mocks.call_args_list self.assertEqual( info_call[1]["url"], - f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/123456789012", + f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/545021584835957806", ) self.assertEqual( refund_call[1]["url"], - f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/123456789012/refund", + f"{gateway.settings.server_url}/rs/2004381/2004381/shipment/545021584835957806/refund", ) def test_parse_shipment_response(self): @@ -156,7 +156,7 @@ def test_parse_multi_piece_shipment_response(self): shipment_cancel_data = { - "shipment_identifier": "123456789012", + "shipment_identifier": "545021584835957806", "options": {"email": "test@test.com"}, } @@ -292,7 +292,7 @@ def test_parse_multi_piece_shipment_response(self): "carrier_name": "canadapost", "carrier_id": "canadapost", "tracking_number": "123456789012", - "shipment_identifier": "123456789012", + "shipment_identifier": "545021584835957806", "label_type": "PDF", "docs": {"label": ANY}, "meta": { @@ -317,7 +317,7 @@ def test_parse_multi_piece_shipment_response(self): "manifest_required": False, }, "label_type": "PDF", - "shipment_identifier": "123456789012", + "shipment_identifier": "545021584835957806", "tracking_number": "123456789012", }, [],