griffnode 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +17 -0
- data/README.md +24 -0
- data/Rakefile +10 -0
- data/docs/Account.md +22 -0
- data/docs/AccountApi.md +339 -0
- data/docs/AccountLimits.md +22 -0
- data/docs/AccountPlan.md +24 -0
- data/docs/AccountUsage.md +22 -0
- data/docs/Balance.md +24 -0
- data/docs/BillingApi.md +75 -0
- data/docs/CreateBillingCheckoutRequest.md +22 -0
- data/docs/CreateDetailedTransactionRequest.md +32 -0
- data/docs/CreateTransactionRequest.md +30 -0
- data/docs/CryptoSymbol.md +15 -0
- data/docs/Cryptocurrency.md +26 -0
- data/docs/DefaultApi.md +78 -0
- data/docs/Error.md +22 -0
- data/docs/FiatCurrency.md +15 -0
- data/docs/GetAccount200Response.md +20 -0
- data/docs/GetHealth200Response.md +22 -0
- data/docs/GetPrices200Response.md +20 -0
- data/docs/GetPrices200ResponseData.md +22 -0
- data/docs/GetStats200Response.md +20 -0
- data/docs/GetStats200ResponseData.md +24 -0
- data/docs/InlineObject.md +24 -0
- data/docs/InlineObjectAllOfExistingTransaction.md +22 -0
- data/docs/Invoice.md +34 -0
- data/docs/LineItem.md +22 -0
- data/docs/ListBalances200Response.md +20 -0
- data/docs/ListBalances200ResponseData.md +18 -0
- data/docs/ListCryptocurrencies200Response.md +20 -0
- data/docs/ListCryptocurrencies200ResponseData.md +20 -0
- data/docs/ListInvoices200Response.md +20 -0
- data/docs/ListInvoices200ResponseData.md +20 -0
- data/docs/ListPlans200Response.md +20 -0
- data/docs/ListPlans200ResponseData.md +20 -0
- data/docs/ListTransactions200Response.md +20 -0
- data/docs/ListTransactions200ResponseData.md +20 -0
- data/docs/MarketDataApi.md +202 -0
- data/docs/Pagination.md +22 -0
- data/docs/PaymentSplit.md +28 -0
- data/docs/Plan.md +38 -0
- data/docs/PlanTier.md +15 -0
- data/docs/SystemApi.md +139 -0
- data/docs/Transaction.md +66 -0
- data/docs/TransactionEnvelope.md +20 -0
- data/docs/TransactionStatus.md +15 -0
- data/docs/TransactionsApi.md +295 -0
- data/docs/WebhookPayload.md +40 -0
- data/git_push.sh +57 -0
- data/griffnode.gemspec +43 -0
- data/lib/griffnode/api/account_api.rb +315 -0
- data/lib/griffnode/api/billing_api.rb +88 -0
- data/lib/griffnode/api/default_api.rb +84 -0
- data/lib/griffnode/api/market_data_api.rb +187 -0
- data/lib/griffnode/api/system_api.rb +158 -0
- data/lib/griffnode/api/transactions_api.rb +300 -0
- data/lib/griffnode/api_client.rb +394 -0
- data/lib/griffnode/api_error.rb +58 -0
- data/lib/griffnode/configuration.rb +308 -0
- data/lib/griffnode/models/account.rb +232 -0
- data/lib/griffnode/models/account_limits.rb +232 -0
- data/lib/griffnode/models/account_plan.rb +264 -0
- data/lib/griffnode/models/account_usage.rb +234 -0
- data/lib/griffnode/models/balance.rb +241 -0
- data/lib/griffnode/models/create_billing_checkout_request.rb +284 -0
- data/lib/griffnode/models/create_detailed_transaction_request.rb +349 -0
- data/lib/griffnode/models/create_transaction_request.rb +313 -0
- data/lib/griffnode/models/crypto_symbol.rb +53 -0
- data/lib/griffnode/models/cryptocurrency.rb +284 -0
- data/lib/griffnode/models/error.rb +251 -0
- data/lib/griffnode/models/fiat_currency.rb +42 -0
- data/lib/griffnode/models/get_account200_response.rb +233 -0
- data/lib/griffnode/models/get_health200_response.rb +232 -0
- data/lib/griffnode/models/get_prices200_response.rb +233 -0
- data/lib/griffnode/models/get_prices200_response_data.rb +238 -0
- data/lib/griffnode/models/get_stats200_response.rb +233 -0
- data/lib/griffnode/models/get_stats200_response_data.rb +241 -0
- data/lib/griffnode/models/inline_object.rb +267 -0
- data/lib/griffnode/models/inline_object_all_of_existing_transaction.rb +254 -0
- data/lib/griffnode/models/invoice.rb +311 -0
- data/lib/griffnode/models/line_item.rb +267 -0
- data/lib/griffnode/models/list_balances200_response.rb +233 -0
- data/lib/griffnode/models/list_balances200_response_data.rb +216 -0
- data/lib/griffnode/models/list_cryptocurrencies200_response.rb +233 -0
- data/lib/griffnode/models/list_cryptocurrencies200_response_data.rb +225 -0
- data/lib/griffnode/models/list_invoices200_response.rb +233 -0
- data/lib/griffnode/models/list_invoices200_response_data.rb +225 -0
- data/lib/griffnode/models/list_plans200_response.rb +233 -0
- data/lib/griffnode/models/list_plans200_response_data.rb +227 -0
- data/lib/griffnode/models/list_transactions200_response.rb +233 -0
- data/lib/griffnode/models/list_transactions200_response_data.rb +239 -0
- data/lib/griffnode/models/pagination.rb +253 -0
- data/lib/griffnode/models/payment_split.rb +262 -0
- data/lib/griffnode/models/plan.rb +330 -0
- data/lib/griffnode/models/plan_tier.rb +42 -0
- data/lib/griffnode/models/transaction.rb +535 -0
- data/lib/griffnode/models/transaction_envelope.rb +233 -0
- data/lib/griffnode/models/transaction_status.rb +44 -0
- data/lib/griffnode/models/webhook_payload.rb +387 -0
- data/lib/griffnode/version.rb +15 -0
- data/lib/griffnode.rb +84 -0
- data/openapi.yaml +791 -0
- data/openapitools.json +15 -0
- data/spec/api/account_api_spec.rb +87 -0
- data/spec/api/billing_api_spec.rb +46 -0
- data/spec/api/default_api_spec.rb +47 -0
- data/spec/api/market_data_api_spec.rb +65 -0
- data/spec/api/system_api_spec.rb +60 -0
- data/spec/api/transactions_api_spec.rb +84 -0
- data/spec/models/account_limits_spec.rb +48 -0
- data/spec/models/account_plan_spec.rb +54 -0
- data/spec/models/account_spec.rb +48 -0
- data/spec/models/account_usage_spec.rb +48 -0
- data/spec/models/balance_spec.rb +54 -0
- data/spec/models/create_billing_checkout_request_spec.rb +48 -0
- data/spec/models/create_detailed_transaction_request_spec.rb +78 -0
- data/spec/models/create_transaction_request_spec.rb +72 -0
- data/spec/models/crypto_symbol_spec.rb +30 -0
- data/spec/models/cryptocurrency_spec.rb +64 -0
- data/spec/models/error_spec.rb +48 -0
- data/spec/models/fiat_currency_spec.rb +30 -0
- data/spec/models/get_account200_response_spec.rb +42 -0
- data/spec/models/get_health200_response_spec.rb +48 -0
- data/spec/models/get_prices200_response_data_spec.rb +48 -0
- data/spec/models/get_prices200_response_spec.rb +42 -0
- data/spec/models/get_stats200_response_data_spec.rb +54 -0
- data/spec/models/get_stats200_response_spec.rb +42 -0
- data/spec/models/inline_object_all_of_existing_transaction_spec.rb +48 -0
- data/spec/models/inline_object_spec.rb +54 -0
- data/spec/models/invoice_spec.rb +84 -0
- data/spec/models/line_item_spec.rb +48 -0
- data/spec/models/list_balances200_response_data_spec.rb +36 -0
- data/spec/models/list_balances200_response_spec.rb +42 -0
- data/spec/models/list_cryptocurrencies200_response_data_spec.rb +42 -0
- data/spec/models/list_cryptocurrencies200_response_spec.rb +42 -0
- data/spec/models/list_invoices200_response_data_spec.rb +42 -0
- data/spec/models/list_invoices200_response_spec.rb +42 -0
- data/spec/models/list_plans200_response_data_spec.rb +42 -0
- data/spec/models/list_plans200_response_spec.rb +42 -0
- data/spec/models/list_transactions200_response_data_spec.rb +42 -0
- data/spec/models/list_transactions200_response_spec.rb +42 -0
- data/spec/models/pagination_spec.rb +48 -0
- data/spec/models/payment_split_spec.rb +66 -0
- data/spec/models/plan_spec.rb +96 -0
- data/spec/models/plan_tier_spec.rb +30 -0
- data/spec/models/transaction_envelope_spec.rb +42 -0
- data/spec/models/transaction_spec.rb +184 -0
- data/spec/models/transaction_status_spec.rb +30 -0
- data/spec/models/webhook_payload_spec.rb +106 -0
- data/spec/spec_helper.rb +111 -0
- metadata +286 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#GriffNode API
|
|
3
|
+
|
|
4
|
+
#Accept Bitcoin, Litecoin, Dogecoin, Dash, Ethereum and ERC-20 tokens. Server-to-server, authenticated with a secret API key (`Authorization: Bearer sk_live_…` for live, or `sk_test_…` for test mode — same base URL). All monetary amounts in API responses are JSON numbers; **webhook** amounts are strings to preserve decimal precision (see the `webhooks` section). **Rate limits.** Every request is rate-limited per API key in two windows — per minute and per hour — by plan tier (min/hour): starter 30/500, business 100/2000, professional 300/5000, enterprise 1000/20000. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix seconds) for the per-minute window. On `429` the body is `error: \"RATE_LIMIT_EXCEEDED\"` (either window) with a `Retry-After` header (seconds) — clients should retry after it. A separate `429` with `error: \"MONTHLY_LIMIT_REACHED\"` means the plan's monthly transaction quota (not the request rate).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module GriffNode
|
|
16
|
+
class SystemApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# API health check
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [GetHealth200Response]
|
|
25
|
+
def get_health(opts = {})
|
|
26
|
+
data, _status_code, _headers = get_health_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# API health check
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(GetHealth200Response, Integer, Hash)>] GetHealth200Response data, response status code and response headers
|
|
33
|
+
def get_health_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: SystemApi.get_health ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/health'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'GetHealth200Response'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:debug_auth_names] || []
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"SystemApi.get_health",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: SystemApi#get_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Hosted-checkout redirect (browser flow, publishable key)
|
|
78
|
+
# Browser-facing redirect to the hosted payment page, authenticated by a **publishable** key in the query string (safe to expose client-side). Not used by the server-side SDKs — included for completeness.
|
|
79
|
+
# @param pk [String] Publishable key, pk_live_… / pk_test_…
|
|
80
|
+
# @param amount [String] Fiat amount (≥ 1.00 USD equivalent).
|
|
81
|
+
# @param crypto [CryptoSymbol]
|
|
82
|
+
# @param [Hash] opts the optional parameters
|
|
83
|
+
# @option opts [String] :link Payment-link slug for attribution.
|
|
84
|
+
# @return [nil]
|
|
85
|
+
def hosted_checkout_redirect(pk, amount, crypto, opts = {})
|
|
86
|
+
hosted_checkout_redirect_with_http_info(pk, amount, crypto, opts)
|
|
87
|
+
nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Hosted-checkout redirect (browser flow, publishable key)
|
|
91
|
+
# Browser-facing redirect to the hosted payment page, authenticated by a **publishable** key in the query string (safe to expose client-side). Not used by the server-side SDKs — included for completeness.
|
|
92
|
+
# @param pk [String] Publishable key, pk_live_… / pk_test_…
|
|
93
|
+
# @param amount [String] Fiat amount (≥ 1.00 USD equivalent).
|
|
94
|
+
# @param crypto [CryptoSymbol]
|
|
95
|
+
# @param [Hash] opts the optional parameters
|
|
96
|
+
# @option opts [String] :link Payment-link slug for attribution.
|
|
97
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
98
|
+
def hosted_checkout_redirect_with_http_info(pk, amount, crypto, opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: SystemApi.hosted_checkout_redirect ...'
|
|
101
|
+
end
|
|
102
|
+
# verify the required parameter 'pk' is set
|
|
103
|
+
if @api_client.config.client_side_validation && pk.nil?
|
|
104
|
+
fail ArgumentError, "Missing the required parameter 'pk' when calling SystemApi.hosted_checkout_redirect"
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'amount' is set
|
|
107
|
+
if @api_client.config.client_side_validation && amount.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'amount' when calling SystemApi.hosted_checkout_redirect"
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'crypto' is set
|
|
111
|
+
if @api_client.config.client_side_validation && crypto.nil?
|
|
112
|
+
fail ArgumentError, "Missing the required parameter 'crypto' when calling SystemApi.hosted_checkout_redirect"
|
|
113
|
+
end
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/pay'
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = opts[:query_params] || {}
|
|
119
|
+
query_params[:'pk'] = pk
|
|
120
|
+
query_params[:'amount'] = amount
|
|
121
|
+
query_params[:'crypto'] = crypto
|
|
122
|
+
query_params[:'link'] = opts[:'link'] if !opts[:'link'].nil?
|
|
123
|
+
|
|
124
|
+
# header parameters
|
|
125
|
+
header_params = opts[:header_params] || {}
|
|
126
|
+
# HTTP header 'Accept' (if needed)
|
|
127
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body]
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type]
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || []
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"SystemApi.hosted_checkout_redirect",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: SystemApi#hosted_checkout_redirect\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#GriffNode API
|
|
3
|
+
|
|
4
|
+
#Accept Bitcoin, Litecoin, Dogecoin, Dash, Ethereum and ERC-20 tokens. Server-to-server, authenticated with a secret API key (`Authorization: Bearer sk_live_…` for live, or `sk_test_…` for test mode — same base URL). All monetary amounts in API responses are JSON numbers; **webhook** amounts are strings to preserve decimal precision (see the `webhooks` section). **Rate limits.** Every request is rate-limited per API key in two windows — per minute and per hour — by plan tier (min/hour): starter 30/500, business 100/2000, professional 300/5000, enterprise 1000/20000. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix seconds) for the per-minute window. On `429` the body is `error: \"RATE_LIMIT_EXCEEDED\"` (either window) with a `Retry-After` header (seconds) — clients should retry after it. A separate `429` with `error: \"MONTHLY_LIMIT_REACHED\"` means the plan's monthly transaction quota (not the request rate).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module GriffNode
|
|
16
|
+
class TransactionsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create an itemized transaction (Professional/Enterprise plans)
|
|
23
|
+
# @param create_detailed_transaction_request [CreateDetailedTransactionRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :x_idempotency_key Optional unique key for a create request (e.g. a UUID). A retried create with the same key returns the original transaction instead of creating a duplicate — send it on every create so a network retry can't double-charge the customer.
|
|
26
|
+
# @return [TransactionEnvelope]
|
|
27
|
+
def create_detailed_transaction(create_detailed_transaction_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_detailed_transaction_with_http_info(create_detailed_transaction_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create an itemized transaction (Professional/Enterprise plans)
|
|
33
|
+
# @param create_detailed_transaction_request [CreateDetailedTransactionRequest]
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [String] :x_idempotency_key Optional unique key for a create request (e.g. a UUID). A retried create with the same key returns the original transaction instead of creating a duplicate — send it on every create so a network retry can't double-charge the customer.
|
|
36
|
+
# @return [Array<(TransactionEnvelope, Integer, Hash)>] TransactionEnvelope data, response status code and response headers
|
|
37
|
+
def create_detailed_transaction_with_http_info(create_detailed_transaction_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.create_detailed_transaction ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'create_detailed_transaction_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && create_detailed_transaction_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_detailed_transaction_request' when calling TransactionsApi.create_detailed_transaction"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/transactions/create-detailed'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
header_params[:'X-Idempotency-Key'] = opts[:'x_idempotency_key'] if !opts[:'x_idempotency_key'].nil?
|
|
61
|
+
|
|
62
|
+
# form parameters
|
|
63
|
+
form_params = opts[:form_params] || {}
|
|
64
|
+
|
|
65
|
+
# http body (model)
|
|
66
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_detailed_transaction_request)
|
|
67
|
+
|
|
68
|
+
# return_type
|
|
69
|
+
return_type = opts[:debug_return_type] || 'TransactionEnvelope'
|
|
70
|
+
|
|
71
|
+
# auth_names
|
|
72
|
+
auth_names = opts[:debug_auth_names] || ['SecretKey']
|
|
73
|
+
|
|
74
|
+
new_options = opts.merge(
|
|
75
|
+
:operation => :"TransactionsApi.create_detailed_transaction",
|
|
76
|
+
:header_params => header_params,
|
|
77
|
+
:query_params => query_params,
|
|
78
|
+
:form_params => form_params,
|
|
79
|
+
:body => post_body,
|
|
80
|
+
:auth_names => auth_names,
|
|
81
|
+
:return_type => return_type
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
85
|
+
if @api_client.config.debugging
|
|
86
|
+
@api_client.config.logger.debug "API called: TransactionsApi#create_detailed_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
87
|
+
end
|
|
88
|
+
return data, status_code, headers
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Create a payment transaction
|
|
92
|
+
# @param create_transaction_request [CreateTransactionRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @option opts [String] :x_idempotency_key Optional unique key for a create request (e.g. a UUID). A retried create with the same key returns the original transaction instead of creating a duplicate — send it on every create so a network retry can't double-charge the customer.
|
|
95
|
+
# @return [TransactionEnvelope]
|
|
96
|
+
def create_transaction(create_transaction_request, opts = {})
|
|
97
|
+
data, _status_code, _headers = create_transaction_with_http_info(create_transaction_request, opts)
|
|
98
|
+
data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Create a payment transaction
|
|
102
|
+
# @param create_transaction_request [CreateTransactionRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @option opts [String] :x_idempotency_key Optional unique key for a create request (e.g. a UUID). A retried create with the same key returns the original transaction instead of creating a duplicate — send it on every create so a network retry can't double-charge the customer.
|
|
105
|
+
# @return [Array<(TransactionEnvelope, Integer, Hash)>] TransactionEnvelope data, response status code and response headers
|
|
106
|
+
def create_transaction_with_http_info(create_transaction_request, opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.create_transaction ...'
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'create_transaction_request' is set
|
|
111
|
+
if @api_client.config.client_side_validation && create_transaction_request.nil?
|
|
112
|
+
fail ArgumentError, "Missing the required parameter 'create_transaction_request' when calling TransactionsApi.create_transaction"
|
|
113
|
+
end
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/transactions/create'
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = opts[:query_params] || {}
|
|
119
|
+
|
|
120
|
+
# header parameters
|
|
121
|
+
header_params = opts[:header_params] || {}
|
|
122
|
+
# HTTP header 'Accept' (if needed)
|
|
123
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
124
|
+
# HTTP header 'Content-Type'
|
|
125
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
126
|
+
if !content_type.nil?
|
|
127
|
+
header_params['Content-Type'] = content_type
|
|
128
|
+
end
|
|
129
|
+
header_params[:'X-Idempotency-Key'] = opts[:'x_idempotency_key'] if !opts[:'x_idempotency_key'].nil?
|
|
130
|
+
|
|
131
|
+
# form parameters
|
|
132
|
+
form_params = opts[:form_params] || {}
|
|
133
|
+
|
|
134
|
+
# http body (model)
|
|
135
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_transaction_request)
|
|
136
|
+
|
|
137
|
+
# return_type
|
|
138
|
+
return_type = opts[:debug_return_type] || 'TransactionEnvelope'
|
|
139
|
+
|
|
140
|
+
# auth_names
|
|
141
|
+
auth_names = opts[:debug_auth_names] || ['SecretKey']
|
|
142
|
+
|
|
143
|
+
new_options = opts.merge(
|
|
144
|
+
:operation => :"TransactionsApi.create_transaction",
|
|
145
|
+
:header_params => header_params,
|
|
146
|
+
:query_params => query_params,
|
|
147
|
+
:form_params => form_params,
|
|
148
|
+
:body => post_body,
|
|
149
|
+
:auth_names => auth_names,
|
|
150
|
+
:return_type => return_type
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
154
|
+
if @api_client.config.debugging
|
|
155
|
+
@api_client.config.logger.debug "API called: TransactionsApi#create_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
156
|
+
end
|
|
157
|
+
return data, status_code, headers
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Retrieve a single transaction
|
|
161
|
+
# @param transaction_id [String]
|
|
162
|
+
# @param [Hash] opts the optional parameters
|
|
163
|
+
# @return [TransactionEnvelope]
|
|
164
|
+
def get_transaction(transaction_id, opts = {})
|
|
165
|
+
data, _status_code, _headers = get_transaction_with_http_info(transaction_id, opts)
|
|
166
|
+
data
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Retrieve a single transaction
|
|
170
|
+
# @param transaction_id [String]
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @return [Array<(TransactionEnvelope, Integer, Hash)>] TransactionEnvelope data, response status code and response headers
|
|
173
|
+
def get_transaction_with_http_info(transaction_id, opts = {})
|
|
174
|
+
if @api_client.config.debugging
|
|
175
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.get_transaction ...'
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'transaction_id' is set
|
|
178
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
179
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.get_transaction"
|
|
180
|
+
end
|
|
181
|
+
# resource path
|
|
182
|
+
local_var_path = '/transactions/{transaction_id}'.sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s))
|
|
183
|
+
|
|
184
|
+
# query parameters
|
|
185
|
+
query_params = opts[:query_params] || {}
|
|
186
|
+
|
|
187
|
+
# header parameters
|
|
188
|
+
header_params = opts[:header_params] || {}
|
|
189
|
+
# HTTP header 'Accept' (if needed)
|
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
191
|
+
|
|
192
|
+
# form parameters
|
|
193
|
+
form_params = opts[:form_params] || {}
|
|
194
|
+
|
|
195
|
+
# http body (model)
|
|
196
|
+
post_body = opts[:debug_body]
|
|
197
|
+
|
|
198
|
+
# return_type
|
|
199
|
+
return_type = opts[:debug_return_type] || 'TransactionEnvelope'
|
|
200
|
+
|
|
201
|
+
# auth_names
|
|
202
|
+
auth_names = opts[:debug_auth_names] || ['SecretKey']
|
|
203
|
+
|
|
204
|
+
new_options = opts.merge(
|
|
205
|
+
:operation => :"TransactionsApi.get_transaction",
|
|
206
|
+
:header_params => header_params,
|
|
207
|
+
:query_params => query_params,
|
|
208
|
+
:form_params => form_params,
|
|
209
|
+
:body => post_body,
|
|
210
|
+
:auth_names => auth_names,
|
|
211
|
+
:return_type => return_type
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
215
|
+
if @api_client.config.debugging
|
|
216
|
+
@api_client.config.logger.debug "API called: TransactionsApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
217
|
+
end
|
|
218
|
+
return data, status_code, headers
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# List the merchant's transactions (newest first)
|
|
222
|
+
# @param [Hash] opts the optional parameters
|
|
223
|
+
# @option opts [Integer] :limit (default to 20)
|
|
224
|
+
# @option opts [Integer] :offset (default to 0)
|
|
225
|
+
# @option opts [TransactionStatus] :status
|
|
226
|
+
# @option opts [CryptoSymbol] :crypto
|
|
227
|
+
# @return [ListTransactions200Response]
|
|
228
|
+
def list_transactions(opts = {})
|
|
229
|
+
data, _status_code, _headers = list_transactions_with_http_info(opts)
|
|
230
|
+
data
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# List the merchant's transactions (newest first)
|
|
234
|
+
# @param [Hash] opts the optional parameters
|
|
235
|
+
# @option opts [Integer] :limit (default to 20)
|
|
236
|
+
# @option opts [Integer] :offset (default to 0)
|
|
237
|
+
# @option opts [TransactionStatus] :status
|
|
238
|
+
# @option opts [CryptoSymbol] :crypto
|
|
239
|
+
# @return [Array<(ListTransactions200Response, Integer, Hash)>] ListTransactions200Response data, response status code and response headers
|
|
240
|
+
def list_transactions_with_http_info(opts = {})
|
|
241
|
+
if @api_client.config.debugging
|
|
242
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.list_transactions ...'
|
|
243
|
+
end
|
|
244
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
245
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionsApi.list_transactions, must be smaller than or equal to 100.'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
249
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionsApi.list_transactions, must be greater than or equal to 1.'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
253
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TransactionsApi.list_transactions, must be greater than or equal to 0.'
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# resource path
|
|
257
|
+
local_var_path = '/transactions/list'
|
|
258
|
+
|
|
259
|
+
# query parameters
|
|
260
|
+
query_params = opts[:query_params] || {}
|
|
261
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
262
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
263
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
264
|
+
query_params[:'crypto'] = opts[:'crypto'] if !opts[:'crypto'].nil?
|
|
265
|
+
|
|
266
|
+
# header parameters
|
|
267
|
+
header_params = opts[:header_params] || {}
|
|
268
|
+
# HTTP header 'Accept' (if needed)
|
|
269
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
270
|
+
|
|
271
|
+
# form parameters
|
|
272
|
+
form_params = opts[:form_params] || {}
|
|
273
|
+
|
|
274
|
+
# http body (model)
|
|
275
|
+
post_body = opts[:debug_body]
|
|
276
|
+
|
|
277
|
+
# return_type
|
|
278
|
+
return_type = opts[:debug_return_type] || 'ListTransactions200Response'
|
|
279
|
+
|
|
280
|
+
# auth_names
|
|
281
|
+
auth_names = opts[:debug_auth_names] || ['SecretKey']
|
|
282
|
+
|
|
283
|
+
new_options = opts.merge(
|
|
284
|
+
:operation => :"TransactionsApi.list_transactions",
|
|
285
|
+
:header_params => header_params,
|
|
286
|
+
:query_params => query_params,
|
|
287
|
+
:form_params => form_params,
|
|
288
|
+
:body => post_body,
|
|
289
|
+
:auth_names => auth_names,
|
|
290
|
+
:return_type => return_type
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug "API called: TransactionsApi#list_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
296
|
+
end
|
|
297
|
+
return data, status_code, headers
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|