Skip to content

Commit

Permalink
🎉 Source Stripe: add checkout_sessions stream, checkout_sessions_line…
Browse files Browse the repository at this point in the history
…_item stream and promotion_codes stream (#7345)

* update: add checkout_sessions and checkout_sessions_line_item streams

* update: add discount object to checkout_session_line_items, update json schema and requests_params

* fix: checkout_session_line_items json schema

* update: add new stream promotion_codes

* fix: json schemas

* fix: checkout sessions line items json schema

* update: add new streams to integration tests

* format streams file

* fix type in checkout_sessions_line_items json schema

* update parse_response in CheckoutSessionsLineItems

* bump version + docs

* generate seed and format

Co-authored-by: Marcos Marx <marcosmarxm@gmail.com>
  • Loading branch information
vladimir-remar and marcosmarxm committed Nov 6, 2021
1 parent 65d1956 commit 1b08e30
Show file tree
Hide file tree
Showing 14 changed files with 571 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "e094cb9a-26de-4645-8761-65c0c425d1de",
"name": "Stripe",
"dockerRepository": "airbyte/source-stripe",
"dockerImageTag": "0.1.21",
"dockerImageTag": "0.1.22",
"documentationUrl": "https://docs.airbyte.io/integrations/sources/stripe",
"icon": "stripe.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
- name: Stripe
sourceDefinitionId: e094cb9a-26de-4645-8761-65c0c425d1de
dockerRepository: airbyte/source-stripe
dockerImageTag: 0.1.21
dockerImageTag: 0.1.22
documentationUrl: https://docs.airbyte.io/integrations/sources/stripe
icon: stripe.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5400,7 +5400,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-stripe:0.1.21"
- dockerImage: "airbyte/source-stripe:0.1.22"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/stripe"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-stripe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.21
LABEL io.airbyte.version=0.1.22
LABEL io.airbyte.name=airbyte/source-stripe
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"disputes": { "created": 161099630500 },
"products": { "created": 158551134100 },
"refunds": { "created": 161959562900 },
"payment_intents": { "created": 161959562900 }
"payment_intents": { "created": 161959562900 },
"promotion_codes": { "created": 163534157100 }
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["created"]
},
{
"stream": {
"name": "checkout_sessions",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "checkout_sessions_line_items",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "coupons",
Expand Down Expand Up @@ -186,6 +206,19 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["created"]
},
{
"stream": {
"name": "promotion_codes",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"cursor_field": ["created"]
},
{
"stream": {
"name": "refunds",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "checkout_sessions",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "checkout_sessions_line_items",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["created"]
},
{
"stream": {
"name": "promotion_codes",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"cursor_field": ["created"]
},
{
"stream": {
"name": "refunds",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": ["null", "object"],
"properties": {
"id": { "type": ["null", "string"] },
"object": { "type": ["null", "string"] },
"after_expiration": {
"type": ["null", "object"],
"properties": {
"recovery": {
"type": ["null", "object"],
"properties": {
"allow_promotion_codes": { "type": ["null", "boolean"] },
"enabled": { "type": ["null", "boolean"] },
"expires_at": { "type": ["null", "integer"] },
"url": { "type": ["null", "string"] }
}
}
}
},
"allow_promotion_codes": { "type": ["null", "boolean"] },
"amount_subtotal": { "type": ["null", "integer"] },
"amount_total": { "type": ["null", "integer"] },
"automatic_tax": {
"type": ["null", "object"],
"properties": {
"enabled": { "type": ["null", "boolean"] },
"status": { "type": ["null", "string"] }
}
},
"billing_address_collection": { "type": ["null", "string"] },
"cancel_url": { "type": ["null", "string"] },
"client_reference_id": { "type": ["null", "string"] },
"consent": {
"type": ["null", "object"],
"properties": {
"promotions": { "type": ["null", "string"] }
}
},
"consent_collection": {
"type": ["null", "object"],
"properties": {
"promotions": { "type": ["null", "string"] }
}
},
"currency": { "type": ["null", "string"] },
"customer": { "type": ["null", "string"] },
"customer_details": {
"type": ["null", "object"],
"properties": {
"email": { "type": ["null", "string"] },
"phone": { "type": ["null", "string"] },
"tax_exempt": { "type": ["null", "string"] },
"tax_ids": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"type": { "type": ["null", "string"] },
"value": { "type": ["null", "string"] }
}
}
}
}
},
"customer_email": { "type": ["null", "string"] },
"expires_at": { "type": ["null", "integer"] },
"livemode": { "type": ["null", "boolean"] },
"locale": { "type": ["null", "string"] },
"metadata": {
"type": ["null", "object"],
"properties": {}
},
"mode": { "type": ["null", "string"] },
"payment_intent": { "type": ["null", "string"] },
"payment_method_options": {
"type": ["null", "object"],
"properties": {
"acss_debit": {
"type": ["null", "object"],
"properties": {
"currency": { "type": ["null", "string"] },
"mandate_options": {
"type": ["null", "object"],
"properties": {
"custom_mandate_url": { "type": ["null", "string"] },
"default_for": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
},
"interval_description": { "type": ["null", "string"] },
"payment_schedule": { "type": ["null", "string"] },
"transaction_type": { "type": ["null", "string"] }
}
},
"verification_method": { "type": ["null", "string"] }
}
},
"boleto": {
"type": ["null", "object"],
"properties": {
"expires_after_days": { "type": ["null", "integer"] }
}
},
"oxxo": {
"type": ["null", "object"],
"properties": {
"expires_after_days": { "type": ["null", "integer"] }
}
}
}
},
"payment_method_types": {
"type": ["null", "array"],
"items": {
"card": { "type": ["null", "string"] }
}
},
"payment_status": { "type": ["null", "string"] },
"phone_number_collection": {
"type": ["null", "object"],
"properties": {
"enabled": { "type": ["null", "boolean"] }
}
},
"recovered_from": { "type": ["null", "string"] },
"setup_intent": { "type": ["null", "string"] },
"shipping": {
"type": ["null", "object"],
"properties": {
"address": {
"type": ["null", "object"],
"properties": {
"city": { "type": ["null", "string"] },
"country": { "type": ["null", "string"] },
"line1": { "type": ["null", "string"] },
"line2": { "type": ["null", "string"] },
"postal_code": { "type": ["null", "string"] },
"state": { "type": ["null", "string"] }
}
},
"name": { "type": ["null", "string"] }
}
},
"shipping_address_collection": {
"type": ["null", "object"],
"properties": {
"allowed_countries": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
}
}
},
"submit_type": { "type": ["null", "string"] },
"subscription": { "type": ["null", "string"] },
"success_url": { "type": ["null", "string"] },
"tax_id_collection": {
"type": ["null", "object"],
"properties": {
"enabled": { "type": ["null", "boolean"] }
}
},
"total_details": {
"type": ["null", "object"],
"properties": {
"amount_discount": { "type": ["null", "integer"] },
"amount_shipping": { "type": ["null", "integer"] },
"amount_tax": { "type": ["null", "integer"] },
"breakdown": {
"type": ["null", "object"],
"properties": {
"discounts": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"amount": { "type": ["null", "integer"] },
"discount": {
"type": ["null", "object"],
"properties": {}
}
}
}
},
"taxes": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"amount": { "type": ["null", "integer"] },
"rate": {
"type": ["null", "object"],
"properties": {
"id": { "type": ["null", "string"] },
"object": { "type": ["null", "string"] },
"active": { "type": ["null", "boolean"] },
"country": { "type": ["null", "string"] },
"created": { "type": ["null", "integer"] },
"description": { "type": ["null", "string"] },
"display_name": { "type": ["null", "string"] },
"inclusive": { "type": ["null", "boolean"] },
"jurisdiction": { "type": ["null", "string"] },
"livemode": { "type": ["null", "boolean"] },
"metadata": {
"type": ["null", "object"],
"properties": {}
},
"percentage": { "type": ["null", "number"] },
"state": { "type": ["null", "string"] },
"tax_type": { "type": ["null", "string"] }
}
}
}
}
}
}
}
}
},
"url": { "type": ["null", "string"] }
}
}

0 comments on commit 1b08e30

Please sign in to comment.