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.
Create custom unmarshaller for orders (#100)
* Create custom unmarshaller for orders - We noticed an issue where some older orders were being sent with line items that had their properties field set an empty JSON object rather than the expected array. This was causing an error when attempting to unmarshal. * cleanup tests Co-authored-by: Gord Currie <[email protected]>
- Loading branch information
1 parent
c833331
commit 2fe6b77
Showing
8 changed files
with
533 additions
and
0 deletions.
There are no files selected for viewing
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,3 @@ | ||
{ | ||
"properties": {} | ||
} |
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,3 @@ | ||
{ | ||
"properties": { | ||
} |
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,5 @@ | ||
{ | ||
"properties": { | ||
"name": 2 | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"properties": [ | ||
{ | ||
"name": 2 | ||
} | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"properties": { | ||
"name": "property 1", | ||
"value": 3 | ||
} | ||
} |
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,88 @@ | ||
{ | ||
"fulfillable_quantity": 1, | ||
"fulfillment_service": "manual", | ||
"fulfillment_status": "partial", | ||
"gift_card": true, | ||
"grams": 100, | ||
"id": 254721536, | ||
"name": "Soda", | ||
"pre_tax_price": "9.00", | ||
"price": "12.34", | ||
"product_exists": true, | ||
"product_id": 111475476, | ||
"properties": [ | ||
{ | ||
"name": "note 1", | ||
"value": "one" | ||
}, | ||
{ | ||
"name": "note 2", | ||
"value": 2 | ||
} | ||
], | ||
"quantity": 1, | ||
"requires_shipping": true, | ||
"sku": "sku-123", | ||
"tax_lines": [ | ||
{ | ||
"price": 13.50, | ||
"rate": 0.06, | ||
"title": "State tax" | ||
}, | ||
{ | ||
"price": 12.50, | ||
"rate": 0.05, | ||
"title": "Federal tax" | ||
} | ||
], | ||
"taxable": true, | ||
"title": "Soda Title", | ||
"total_discount": "1.23", | ||
"variant_id": 1234, | ||
"variant_inventory_management": "shopify", | ||
"variant_title": "Test Variant", | ||
"vendor": "Test Vendor", | ||
"origin_location": { | ||
"id": 123, | ||
"address1": "100 some street", | ||
"address2": "", | ||
"city": "Winnipeg", | ||
"company": "Acme Corporation", | ||
"country": "Canada", | ||
"country_code": "CA", | ||
"first_name": "Bob", | ||
"last_name": "Smith", | ||
"latitude": 49.811550, | ||
"longitude": -97.189480, | ||
"name": "test address", | ||
"phone": "8675309", | ||
"province": "Manitoba", | ||
"province_code": "MB", | ||
"zip": "R3Y 0L6" | ||
}, | ||
"destination_location": { | ||
"id": 124, | ||
"address1": "200 some street", | ||
"address2": "", | ||
"city": "Winnipeg", | ||
"company": "Acme Corporation", | ||
"country": "Canada", | ||
"country_code": "CA", | ||
"first_name": "Bob", | ||
"last_name": "Smith", | ||
"latitude": 49.811550, | ||
"longitude": -97.189480, | ||
"name": "test address", | ||
"phone": "8675309", | ||
"province": "Manitoba", | ||
"province_code": "MB", | ||
"zip": "R3Y 0L6" | ||
}, | ||
"applied_discount": { | ||
"applied_discount": "test discount", | ||
"description": "my test discount", | ||
"value": "0.05", | ||
"value_type": "percent", | ||
"amount": "25.00" | ||
} | ||
} |
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
Oops, something went wrong.