1
0
mirror of synced 2025-12-30 03:02:21 -05:00

Source Paystack: enable in cloud (#24085)

* made needed changes for enabling in cloud

* added changelog

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
This commit is contained in:
Daryna Ishchenko
2023-03-16 13:45:19 +02:00
committed by GitHub
parent cd16cc8cf5
commit a1da244d3c
8 changed files with 86 additions and 66 deletions

View File

@@ -9,6 +9,7 @@ from typing import Any, Iterable, Mapping, MutableMapping, Optional
import pendulum
import requests
from airbyte_cdk.sources.streams.http import HttpStream
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
class PaystackStream(HttpStream, ABC):
@@ -93,7 +94,7 @@ class IncrementalPaystackStream(PaystackStream, ABC):
class Customers(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#customer-list
API docs: https://paystack.com/docs/api/customer#list
"""
cursor_field = "createdAt"
@@ -104,7 +105,7 @@ class Customers(IncrementalPaystackStream):
class Disputes(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#dispute-list
API docs: https://paystack.com/docs/api/dispute#list
"""
cursor_field = "createdAt"
@@ -115,7 +116,7 @@ class Disputes(IncrementalPaystackStream):
class Invoices(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#invoice-list
API docs: https://paystack.com/docs/api/payment-request
"""
cursor_field = "created_at"
@@ -126,10 +127,11 @@ class Invoices(IncrementalPaystackStream):
class Refunds(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#refund-list
API docs: https://paystack.com/docs/api/refund
"""
cursor_field = "createdAt"
transformer: TypeTransformer = TypeTransformer(TransformConfig.DefaultSchemaNormalization)
def path(self, **kwargs) -> str:
return "refund"
@@ -137,7 +139,7 @@ class Refunds(IncrementalPaystackStream):
class Settlements(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#settlement
API docs: https://paystack.com/docs/api/settlement
"""
cursor_field = "createdAt"
@@ -148,7 +150,7 @@ class Settlements(IncrementalPaystackStream):
class Subscriptions(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#subscription-list
API docs: https://paystack.com/docs/api/subscription
"""
cursor_field = "createdAt"
@@ -159,7 +161,7 @@ class Subscriptions(IncrementalPaystackStream):
class Transactions(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#transaction-list
API docs: https://paystack.com/docs/api/transaction
"""
cursor_field = "createdAt"
@@ -170,7 +172,7 @@ class Transactions(IncrementalPaystackStream):
class Transfers(IncrementalPaystackStream):
"""
API docs: https://paystack.com/docs/api/#transfer-list
API docs: https://paystack.com/docs/api/transfer
"""
cursor_field = "createdAt"