forked from getconversio/go-shopify
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Create custom unmarshaller for ShippingLines - Implemented custom unmarshaler to handle requested_fulfillment_service_id sometimes being returned as json numbers or json nulls instead of json strings.
- Loading branch information
Showing
6 changed files
with
330 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
fixtures/shippinglines/requested_fulfillment_service_id_invalid.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"id": 254721542, | ||
"code": "INT.TP", | ||
"price": "4.00", | ||
"price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"discounted_price": "4.00", | ||
"discounted_price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"source": "canada_post", | ||
"title": "Small Packet International Air", | ||
"tax_lines": [ | ||
{ | ||
"price": 13.50, | ||
"rate": 0.06, | ||
"title": "State tax" | ||
}, | ||
{ | ||
"price": 12.50, | ||
"rate": 0.05, | ||
"title": "Federal tax" | ||
} | ||
], | ||
"carrier_identifier": "third_party_carrier_identifier", | ||
"requested_fulfillment_service_id": | ||
} |
42 changes: 42 additions & 0 deletions
42
fixtures/shippinglines/requested_fulfillment_service_id_null.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"id": 254721542, | ||
"code": "INT.TP", | ||
"price": "4.00", | ||
"price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"discounted_price": "4.00", | ||
"discounted_price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"source": "canada_post", | ||
"title": "Small Packet International Air", | ||
"tax_lines": [ | ||
{ | ||
"price": 13.50, | ||
"rate": 0.06, | ||
"title": "State tax" | ||
}, | ||
{ | ||
"price": 12.50, | ||
"rate": 0.05, | ||
"title": "Federal tax" | ||
} | ||
], | ||
"carrier_identifier": "third_party_carrier_identifier", | ||
"requested_fulfillment_service_id": null | ||
} |
42 changes: 42 additions & 0 deletions
42
fixtures/shippinglines/requested_fulfillment_service_id_number.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"id": 254721542, | ||
"code": "INT.TP", | ||
"price": "4.00", | ||
"price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"discounted_price": "4.00", | ||
"discounted_price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"source": "canada_post", | ||
"title": "Small Packet International Air", | ||
"tax_lines": [ | ||
{ | ||
"price": 13.50, | ||
"rate": 0.06, | ||
"title": "State tax" | ||
}, | ||
{ | ||
"price": 12.50, | ||
"rate": 0.05, | ||
"title": "Federal tax" | ||
} | ||
], | ||
"carrier_identifier": "third_party_carrier_identifier", | ||
"requested_fulfillment_service_id": 123456 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"id": 254721542, | ||
"code": "INT.TP", | ||
"price": "4.00", | ||
"price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"discounted_price": "4.00", | ||
"discounted_price_set": { | ||
"shop_money": { | ||
"amount": "4.00", | ||
"currency_code": "USD" | ||
}, | ||
"presentment_money": { | ||
"amount": "3.17", | ||
"currency_code": "EUR" | ||
} | ||
}, | ||
"source": "canada_post", | ||
"title": "Small Packet International Air", | ||
"tax_lines": [ | ||
{ | ||
"price": 13.50, | ||
"rate": 0.06, | ||
"title": "State tax" | ||
}, | ||
{ | ||
"price": 12.50, | ||
"rate": 0.05, | ||
"title": "Federal tax" | ||
} | ||
], | ||
"carrier_identifier": "third_party_carrier_identifier", | ||
"requested_fulfillment_service_id": "third_party_fulfillment_service_id" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters