Skip to content

Commit f2b7747

Browse files
authored
Merge pull request #44 from PurplShip/SendleIntegrationhotFix
Sendle integrationhot fix
2 parents 5ff628c + 38be4e5 commit f2b7747

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

purplship/mappers/sendle/sendle_mapper/partials/rate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _extract_quote(self, parcel_quote: ParcelQuoteResponse) -> QuoteDetails:
3939
duties_and_taxes=parcel_quote.quote.tax.amount,
4040
total_charge=parcel_quote.quote.net.amount,
4141
currency=parcel_quote.quote.net.currency,
42-
delivery_date=str(parcel_quote.eta.date_range[-1:]),
42+
delivery_date=parcel_quote.eta.date_range[-1],
4343
discount=None,
4444
extra_charges=[]
4545
)
@@ -49,7 +49,7 @@ def create_parcel_quote_request(self, payload: RateRequest) -> ParcelQuoteReques
4949
SendleMapperPartial._create_domestic_quote
5050
if (
5151
payload.recipient.country_code is None or
52-
payload.recipient.country_code == 'AUS'
52+
payload.recipient.country_code == 'AU'
5353
) else
5454
SendleMapperPartial._create_international_quote
5555
)(payload)

purplship/mappers/sendle/sendle_proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_quotes(self, parcel_quote_request: ParcelQuoteRequest) -> dict:
3030
"Content-Type": "application/json",
3131
"Authorization": f"Basic {self.authorization}",
3232
},
33-
method="POST",
33+
method="GET",
3434
)
3535
return to_dict(response)
3636

tests/sendle/quote.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_parse_quote_response_errors(self):
7171
"base_charge": 14.95,
7272
"carrier": "Sendle",
7373
"currency": "AUD",
74-
"delivery_date": "['2018-02-19']",
74+
"delivery_date": "2018-02-19",
7575
"duties_and_taxes": 1.36,
7676
"service_name": "Easy",
7777
"service_type": "Easy",
@@ -81,7 +81,7 @@ def test_parse_quote_response_errors(self):
8181
"base_charge": 13.95,
8282
"carrier": "Sendle",
8383
"currency": "AUD",
84-
"delivery_date": "['2018-02-19']",
84+
"delivery_date": "2018-02-19",
8585
"duties_and_taxes": 1.27,
8686
"service_name": "Premium",
8787
"service_type": "Premium",
@@ -91,7 +91,7 @@ def test_parse_quote_response_errors(self):
9191
"base_charge": 13.95,
9292
"carrier": "Sendle",
9393
"currency": "AUD",
94-
"delivery_date": "['2018-02-14']",
94+
"delivery_date": "2018-02-14",
9595
"duties_and_taxes": 1.27,
9696
"service_name": "Pro",
9797
"service_type": "Pro",

0 commit comments

Comments
 (0)