Skip to content

Commit 67b7fc9

Browse files
author
Baz
authored
🎉 Source Shopify: add tender_transactions stream (#10449)
1 parent 1e0ac30 commit 67b7fc9

File tree

11 files changed

+123
-5
lines changed

11 files changed

+123
-5
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@
669669
- name: Shopify
670670
sourceDefinitionId: 9da77001-af33-4bcd-be46-6252bf9342b9
671671
dockerRepository: airbyte/source-shopify
672-
dockerImageTag: 0.1.31
672+
dockerImageTag: 0.1.32
673673
documentationUrl: https://docs.airbyte.io/integrations/sources/shopify
674674
icon: shopify.svg
675675
sourceType: api

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7041,7 +7041,7 @@
70417041
supportsNormalization: false
70427042
supportsDBT: false
70437043
supported_destination_sync_modes: []
7044-
- dockerImage: "airbyte/source-shopify:0.1.31"
7044+
- dockerImage: "airbyte/source-shopify:0.1.32"
70457045
spec:
70467046
documentationUrl: "https://docs.airbyte.io/integrations/sources/shopify"
70477047
connectionSpecification:

airbyte-integrations/connectors/source-shopify/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ COPY source_shopify ./source_shopify
2828
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
2929
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
3030

31-
LABEL io.airbyte.version=0.1.31
31+
LABEL io.airbyte.version=0.1.32
3232
LABEL io.airbyte.name=airbyte/source-shopify

airbyte-integrations/connectors/source-shopify/integration_tests/abnormal_state.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,8 @@
5555
},
5656
"fulfillments": {
5757
"updated_at": "2024-07-08T05:40:38-07:00"
58+
},
59+
"tender_transactions": {
60+
"processed_at": "2024-07-08T05:40:38-07:00"
5861
}
5962
}

airbyte-integrations/connectors/source-shopify/integration_tests/configured_catalog.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@
132132
"cursor_field": ["created_at"],
133133
"destination_sync_mode": "append"
134134
},
135+
{
136+
"stream": {
137+
"name": "tender_transactions",
138+
"json_schema": {},
139+
"supported_sync_modes": ["incremental", "full_refresh"],
140+
"source_defined_cursor": true,
141+
"default_cursor_field": ["processed_at"]
142+
},
143+
"sync_mode": "incremental",
144+
"cursor_field": ["processed_at"],
145+
"destination_sync_mode": "append"
146+
},
135147
{
136148
"stream": {
137149
"name": "pages",

airbyte-integrations/connectors/source-shopify/integration_tests/state.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,8 @@
5555
},
5656
"fulfillments": {
5757
"updated_at": "2021-09-10T06:48:10-07:00"
58+
},
59+
"tender_transactions": {
60+
"processed_at": "2021-12-13T20:43:39-08:00"
5861
}
5962
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"id": {
5+
"type": [
6+
"null",
7+
"integer"
8+
]
9+
},
10+
"order_id": {
11+
"type": [
12+
"null",
13+
"integer"
14+
]
15+
},
16+
"amount": {
17+
"type": [
18+
"null",
19+
"string"
20+
]
21+
},
22+
"currency": {
23+
"type": [
24+
"null",
25+
"string"
26+
]
27+
},
28+
"user_id": {
29+
"type": [
30+
"null",
31+
"integer"
32+
]
33+
},
34+
"test": {
35+
"type": [
36+
"null",
37+
"boolean"
38+
]
39+
},
40+
"processed_at": {
41+
"type": [
42+
"null",
43+
"string"
44+
],
45+
"format": "date-time"
46+
},
47+
"remote_reference": {
48+
"type": [
49+
"null",
50+
"string"
51+
]
52+
},
53+
"payment_details": {
54+
"type": ["null", "object"],
55+
"properties": {
56+
"credit_card_number": {
57+
"type": [
58+
"null",
59+
"string"
60+
]
61+
},
62+
"credit_card_company": {
63+
"type": [
64+
"null",
65+
"string"
66+
]
67+
}
68+
}
69+
70+
},
71+
"payment_method": {
72+
"type": [
73+
"null",
74+
"string"
75+
]
76+
}
77+
}
78+
}

airbyte-integrations/connectors/source-shopify/source_shopify/source.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,15 @@ def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
322322
return f"orders/{order_id}/{self.data_field}.json"
323323

324324

325+
class TenderTransactions(IncrementalShopifyStream):
326+
data_field = "tender_transactions"
327+
cursor_field = "processed_at"
328+
filter_field = "processed_at_min"
329+
330+
def path(self, **kwargs) -> str:
331+
return f"{self.data_field}.json"
332+
333+
325334
class Pages(IncrementalShopifyStream):
326335
data_field = "pages"
327336

@@ -473,6 +482,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
473482
Collects(config),
474483
OrderRefunds(config),
475484
OrderRisks(config),
485+
TenderTransactions(config),
476486
Transactions(config),
477487
Pages(config),
478488
PriceRules(config),

airbyte-integrations/connectors/source-shopify/source_shopify/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
SCOPES_MAPPING = {
1313
"read_customers": ["Customers"],
14-
"read_orders": ["Orders", "AbandonedCheckouts", "Transactions", "Fulfillments", "OrderRefunds", "OrderRisks"],
14+
"read_orders": ["Orders", "AbandonedCheckouts", "TenderTransactions", "Transactions", "Fulfillments", "OrderRefunds", "OrderRisks"],
1515
"read_draft_orders": ["DraftOrders"],
1616
"read_products": ["Products", "CustomCollections", "Collects"],
1717
"read_content": ["Pages"],

airbyte-integrations/connectors/source-shopify/unit_tests/unit_test.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ def test_privileges_validation(requests_mock, basic_config):
3131
requests_mock.get("https://test_shop.myshopify.com/admin/oauth/access_scopes.json", json={"access_scopes": [{"handle": "read_orders"}]})
3232
source = SourceShopify()
3333

34-
expected = ["orders", "abandoned_checkouts", "metafields", "order_refunds", "order_risks", "transactions", "fulfillments", "shop"]
34+
expected = [
35+
"orders",
36+
"abandoned_checkouts",
37+
"metafields",
38+
"order_refunds",
39+
"order_risks",
40+
"tender_transactions",
41+
"transactions",
42+
"fulfillments",
43+
"shop",
44+
]
3545

3646
assert [stream.name for stream in source.streams(basic_config)] == expected

docs/integrations/sources/shopify.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This Source is capable of syncing the following core Streams:
3333
* [Orders Risks](https://shopify.dev/api/admin/rest/reference/orders/order-risk)
3434
* [Products](https://help.shopify.com/en/api/reference/products)
3535
* [Transactions](https://help.shopify.com/en/api/reference/orders/transaction)
36+
* [Tender Transactions](https://shopify.dev/api/admin-rest/2022-01/resources/tendertransaction))
3637
* [Pages](https://help.shopify.com/en/api/reference/online-store/page)
3738
* [Price Rules](https://help.shopify.com/en/api/reference/discounts/pricerule)
3839
* [Locations](https://shopify.dev/api/admin-rest/2021-10/resources/location)
@@ -101,6 +102,7 @@ This connector support both: `OAuth 2.0` and `API PASSWORD` (for private applica
101102

102103
| Version | Date | Pull Request | Subject |
103104
| :--- | :--- | :--- | :--- |
105+
| 0.1.32 | 2022-02-18 | [10449](https://github.com/airbytehq/airbyte/pull/10449) | Added `tender_transactions` stream |
104106
| 0.1.31 | 2022-02-08 | [10175](https://github.com/airbytehq/airbyte/pull/10175) | Fixed compatibility issues for legacy user config |
105107
| 0.1.30 | 2022-01-24 | [9648](https://github.com/airbytehq/airbyte/pull/9648) | Added permission validation before sync |
106108
| 0.1.29 | 2022-01-20 | [9049](https://github.com/airbytehq/airbyte/pull/9248) | Added `shop_url` to the record for all streams |

0 commit comments

Comments
 (0)