mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
- 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
24 lines
654 B
Ruby
24 lines
654 B
Ruby
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
|