Class: Paid::AsyncClient
- Inherits:
-
Object
- Object
- Paid::AsyncClient
- Defined in:
- lib/paid_ruby.rb
Instance Attribute Summary collapse
- #agents ⇒ Paid::AsyncAgentsClient readonly
- #contacts ⇒ Paid::AsyncContactsClient readonly
- #customers ⇒ Paid::AsyncCustomersClient readonly
- #orders ⇒ Paid::AsyncOrdersClient readonly
- #usage ⇒ Paid::AsyncUsageClient readonly
Instance Method Summary collapse
- #capture(*args, external_customer_id:, &block) ⇒ Object
- #initialize(token:, base_url: nil, environment: Paid::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil) ⇒ Paid::AsyncClient constructor
- #initialize_tracing ⇒ Object
Constructor Details
#initialize(token:, base_url: nil, environment: Paid::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil) ⇒ Paid::AsyncClient
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/paid_ruby.rb', line 82 def initialize(token:, base_url: nil, environment: Paid::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil) @async_request_client = Paid::AsyncRequestClient.new( base_url: base_url, environment: environment, max_retries: max_retries, timeout_in_seconds: timeout_in_seconds, token: token ) @customers = Paid::AsyncCustomersClient.new(request_client: @async_request_client) @agents = Paid::AsyncAgentsClient.new(request_client: @async_request_client) @contacts = Paid::AsyncContactsClient.new(request_client: @async_request_client) @orders = Paid::AsyncOrdersClient.new(request_client: @async_request_client) @usage = Paid::AsyncBatchUsageClient.new(request_client: @async_request_client) end |
Instance Attribute Details
#agents ⇒ Paid::AsyncAgentsClient (readonly)
68 69 70 |
# File 'lib/paid_ruby.rb', line 68 def agents @agents end |
#contacts ⇒ Paid::AsyncContactsClient (readonly)
70 71 72 |
# File 'lib/paid_ruby.rb', line 70 def contacts @contacts end |
#customers ⇒ Paid::AsyncCustomersClient (readonly)
66 67 68 |
# File 'lib/paid_ruby.rb', line 66 def customers @customers end |
#orders ⇒ Paid::AsyncOrdersClient (readonly)
72 73 74 |
# File 'lib/paid_ruby.rb', line 72 def orders @orders end |
#usage ⇒ Paid::AsyncUsageClient (readonly)
74 75 76 |
# File 'lib/paid_ruby.rb', line 74 def usage @usage end |
Instance Method Details
#capture(*args, external_customer_id:, &block) ⇒ Object
107 108 109 |
# File 'lib/paid_ruby.rb', line 107 def capture(*args, external_customer_id:, &block) Paid::Tracing.capture(*args, external_customer_id: external_customer_id, &block) end |
#initialize_tracing ⇒ Object
98 99 100 101 102 |
# File 'lib/paid_ruby.rb', line 98 def initialize_tracing token = @async_request_client.token api_key = token.gsub(/^Bearer /, "") Paid::Tracing.initialize_tracing(api_key: api_key) end |