The Payment Orchestration SDK is a Python library that simplifies payment processing by providing a unified interface to multiple payment providers. It uses Basis Theory for secure card tokenization and supports multiple payment processors.
- Unified payment processing interface
- Support for multiple payment providers
- Support for one-time payments and card-on-file transactions
- 3DS authentication support
- Comprehensive error handling and categorization
- Providers documentation for each provider supported by the SDK.
pip install payment-orchestration-sdk
from orchestration_sdk import PaymentOrchestrationSDK
from orchestration_sdk.models import RecurringType
# Initialize the SDK with your chosen provider
sdk = PaymentOrchestrationSDK.init({
'isTest': True, # Use test environment
'btApiKey': 'YOUR_BASIS_THEORY_API_KEY',
'providerConfig': {
# Configure your chosen provider
'adyen': {
'apiKey': 'YOUR_PROVIDER_API_KEY',
'merchantAccount': 'YOUR_MERCHANT_ACCOUNT',
}
}
})
# Create a transaction request
transaction_request = TransactionRequest(
reference='unique-transaction-reference',
type=RecurringType.ONE_TIME,
amount=Amount(
value=1000, # Amount in cents
currency='USD'
),
source=Source(
type=SourceType.BASIS_THEORY_TOKEN,
id='YOUR_BASIS_THEORY_TOKEN_ID',
store_with_provider=False
),
customer=Customer(
reference='customer-reference'
)
)
# Process the transaction with your chosen provider
response = await sdk.adyen.transaction(transaction_request) # Use sdk.<provider>.transaction()
For support, please contact support@basistheory.com or open an issue on GitHub.