mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-28 06:48:47 +00:00
docs: Add Ruby SDK README with comprehensive API documentation and implement modular architecture with HTTParty integration
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Refactor TelecomSDK::Client to use modular API clients (SubscriberAPI, UsageAPI, PaymentAPI, RatingPlanAPI, SystemAPI, GraphQLAPI) - Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token methods) - Add HTTPClient base class with retry
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
module TelecomSDK
|
||||
# API for payment management
|
||||
class PaymentAPI
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
def create_transaction(request)
|
||||
@client.post("/v1/payments/transactions", request)
|
||||
end
|
||||
|
||||
def get_transaction(transaction_id)
|
||||
@client.get("/v1/payments/transactions/#{transaction_id}")
|
||||
end
|
||||
|
||||
def list_transactions(subscriber_id: nil, status: nil, page: 1, page_size: 50)
|
||||
params = { page: page, page_size: page_size }
|
||||
params[:subscriber_id] = subscriber_id if subscriber_id
|
||||
params[:status] = status if status
|
||||
@client.get("/v1/payments/transactions", params)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user