Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Stripe: Add new stream (credit_notes) #24666

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-stripe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]



LABEL io.airbyte.version=3.5.0
LABEL io.airbyte.version=3.6.0
LABEL io.airbyte.name=airbyte/source-stripe
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: e094cb9a-26de-4645-8761-65c0c425d1de
dockerImageTag: 3.5.0
dockerImageTag: 3.6.0
dockerRepository: airbyte/source-stripe
githubIssueLabel: source-stripe
icon: stripe.svg
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"type": [
"null",
"object"
],
"properties": {
"metadata": {
"type": [
"null",
"object"
],
"properties": {}
},
"id": {
"type": [
"null",
"string"
]
},
"total": {
"type": [
"null",
"number"
]
},
"amount": {
"type": [
"null",
"number"
]
},
"voided_at": {
"type": [
"null",
"integer"
]
},
"created": {
"type": [
"null",
"integer"
]
},
"number": {
"type": [
"null",
"string"
]
},
"subtotal": {
"type": [
"null",
"number"
]
},
"livemode": {
"type": [
"null",
"boolean"
]
},
"reason": {
"type": [
"null",
"string"
]
},
"pdf": {
"type": [
"null",
"string"
]
},
"invoice": {
"type": [
"null",
"string"
]
},
"status": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
},
"currency": {
"type": [
"null",
"string"
]
},
"refund": {
"type": [
"null",
"string"
]
},
"memo": {
"type": [
"null",
"string"
]
},
"customer_balance_transaction": {
"type": [
"null",
"string"
]
},
"discount_amount": {
"type": [
"null",
"number"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Charges,
CheckoutSessions,
CheckoutSessionsLineItems,
CreditNotes,
Coupons,
CustomerBalanceTransactions,
Customers,
Expand Down Expand Up @@ -69,6 +70,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
Charges(**incremental_args),
CheckoutSessions(**args),
CheckoutSessionsLineItems(**args),
CreditNotes(**incremental_args),
Coupons(**incremental_args),
CustomerBalanceTransactions(**args),
Customers(**incremental_args),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ def stream_slices(
continue
yield customer

class CreditNotes(IncrementalStripeStream):
cursor_field = "created"
Comment on lines +218 to +219
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@archangelic This class should similar to this one:

class EarlyFraudWarnings(StripeStream):
"""
API docs: https://stripe.com/docs/api/radar/early_fraud_warnings/list
"""
def request_params(
self,
stream_state: Mapping[str, Any],
stream_slice: Mapping[str, Any] = None,
next_page_token: Mapping[str, Any] = None,
) -> MutableMapping[str, Any]:
params = {}
if next_page_token:
params.update(next_page_token)
def path(self, **kwargs):
return "radar/early_fraud_warnings"

because CreditNotes doesn't support incremental.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is CreditNotes allow you to set the limit parameter so you can keep that in request_params.


def path(self, **kwargs):
return "credit_notes"


class Coupons(IncrementalStripeStream):
"""
Expand Down
14 changes: 7 additions & 7 deletions connectors.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Airbyte Connectors

A list of all airbyte connectors can now be found [here](https://connectors.airbyte.com/files/generated_reports/connector_registry_report.html) (or in the [docs](https://docs.airbyte.com/integrations/)).

This report is generated from the **Airbyte Catalog Registries**
* [OSS Registry JSON](https://connectors.airbyte.com/files/registries/v0/oss_registry.json)
* [Cloud Registry JSON](https://connectors.airbyte.com/files/registries/v0/cloud_registry.json)
# Airbyte Connectors
A list of all airbyte connectors can now be found [here](https://connectors.airbyte.com/files/generated_reports/connector_registry_report.html) (or in the [docs](https://docs.airbyte.com/integrations/)).
This report is generated from the **Airbyte Catalog Registries**
* [OSS Registry JSON](https://connectors.airbyte.com/files/registries/v0/oss_registry.json)
* [Cloud Registry JSON](https://connectors.airbyte.com/files/registries/v0/cloud_registry.json)
3 changes: 2 additions & 1 deletion docs/integrations/sources/stripe.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ The Stripe connector should not run into Stripe API limitations under normal usa

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3.6.0 | 2023-05-24 | [24666](https://github.com/airbytehq/airbyte/pull/24666) | Add new stream (credit_notes) |
| 3.5.0 | 2023-05-20 | [22859](https://github.com/airbytehq/airbyte/pull/22859) | Add stream `Early Fraud Warnings` |
| 3.4.3 | 2023-05-10 | [25965](https://github.com/airbytehq/airbyte/pull/25965) | Fix Airbyte date-time data-types |
| 3.4.2 | 2023-05-04 | [25795](https://github.com/airbytehq/airbyte/pull/25795) | Added `CDK TypeTransformer` to guarantee declared JSON Schema data-types |
Expand Down Expand Up @@ -136,4 +137,4 @@ The Stripe connector should not run into Stripe API limitations under normal usa
| 0.1.11 | 2021-05-30 | [3744](https://github.com/airbytehq/airbyte/pull/3744) | Fix types in schema |
| 0.1.10 | 2021-05-28 | [3728](https://github.com/airbytehq/airbyte/pull/3728) | Update data types to be number instead of int |
| 0.1.9 | 2021-05-13 | [3367](https://github.com/airbytehq/airbyte/pull/3367) | Add acceptance tests for connected accounts |
| 0.1.8 | 2021-05-11 | [3566](https://github.com/airbytehq/airbyte/pull/3368) | Bump CDK connectors |
| 0.1.8 | 2021-05-11 | [3566](https://github.com/airbytehq/airbyte/pull/3368) | Bump CDK connectors |