transferzero-sdk 1.0.0 → 1.7.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 +4 -4
- data/README.md +17 -11
- data/docs/AccountMeta.md +1 -1
- data/docs/AccountValidationApi.md +4 -4
- data/docs/AccountValidationRequest.md +6 -4
- data/docs/Currency.md +1 -1
- data/docs/CurrencyExchange.md +1 -1
- data/docs/CurrencyInfoApi.md +20 -6
- data/docs/CurrencyOpposite.md +4 -2
- data/docs/Debit.md +2 -2
- data/docs/Document.md +4 -0
- data/docs/FieldSelectValidation.md +1 -1
- data/docs/FieldValidation.md +1 -1
- data/docs/PayinMethod.md +4 -4
- data/docs/PayinMethodDetails.md +7 -3
- data/docs/PayinMethodDetailsBTC.md +17 -0
- data/docs/PayinMethodDetailsMobile.md +1 -1
- data/docs/PayinMethodDetailsNGNBank.md +4 -2
- data/docs/PaymentMethod.md +2 -2
- data/docs/PaymentMethodOpposite.md +2 -2
- data/docs/PayoutMethod.md +1 -1
- data/docs/PayoutMethodDetails.md +12 -4
- data/docs/PayoutMethodDetailsBTC.md +23 -0
- data/docs/PayoutMethodDetailsGBPBank.md +29 -0
- data/docs/PayoutMethodDetailsIBAN.md +1 -1
- data/docs/PayoutMethodDetailsNGNBank.md +1 -1
- data/docs/PayoutMethodDetailsXOFBank.md +25 -0
- data/docs/PoliticallyExposedPerson.md +31 -0
- data/docs/Recipient.md +5 -3
- data/docs/RecipientsApi.md +3 -3
- data/docs/Sender.md +63 -27
- data/docs/Transaction.md +5 -5
- data/docs/TransactionTraits.md +2 -2
- data/docs/TransactionsApi.md +64 -0
- data/example/client.rb +14 -14
- data/git_push.sh +1 -1
- data/lib/transferzero-sdk.rb +5 -0
- data/lib/transferzero-sdk/api/account_validation_api.rb +4 -4
- data/lib/transferzero-sdk/api/currency_info_api.rb +6 -0
- data/lib/transferzero-sdk/api/recipients_api.rb +4 -4
- data/lib/transferzero-sdk/api/transactions_api.rb +59 -0
- data/lib/transferzero-sdk/api_client.rb +5 -5
- data/lib/transferzero-sdk/models/account.rb +70 -69
- data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/account_meta.rb +61 -60
- data/lib/transferzero-sdk/models/account_response.rb +66 -65
- data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
- data/lib/transferzero-sdk/models/account_validation_request.rb +164 -163
- data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
- data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
- data/lib/transferzero-sdk/models/api_log.rb +136 -135
- data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
- data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
- data/lib/transferzero-sdk/models/currency.rb +142 -141
- data/lib/transferzero-sdk/models/currency_exchange.rb +158 -157
- data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
- data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
- data/lib/transferzero-sdk/models/currency_opposite.rb +166 -155
- data/lib/transferzero-sdk/models/debit.rb +151 -155
- data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
- data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/debit_request.rb +60 -59
- data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
- data/lib/transferzero-sdk/models/debit_response.rb +60 -59
- data/lib/transferzero-sdk/models/document.rb +181 -160
- data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/document_request.rb +60 -59
- data/lib/transferzero-sdk/models/document_response.rb +60 -59
- data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/error_status.rb +66 -65
- data/lib/transferzero-sdk/models/field_description.rb +95 -94
- data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
- data/lib/transferzero-sdk/models/field_validation.rb +78 -77
- data/lib/transferzero-sdk/models/pagination.rb +97 -96
- data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
- data/lib/transferzero-sdk/models/payin_method.rb +97 -96
- data/lib/transferzero-sdk/models/payin_method_details.rb +122 -105
- data/lib/transferzero-sdk/models/payin_method_details_btc.rb +204 -0
- data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
- data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -65
- data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
- data/lib/transferzero-sdk/models/payment_method.rb +109 -108
- data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
- data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
- data/lib/transferzero-sdk/models/payout_method.rb +107 -106
- data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
- data/lib/transferzero-sdk/models/payout_method_details.rb +338 -288
- data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
- data/lib/transferzero-sdk/models/payout_method_details_btc.rb +250 -0
- data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
- data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
- data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
- data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
- data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +86 -85
- data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -108
- data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +264 -0
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
- data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
- data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
- data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +14 -19
- data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
- data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
- data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/politically_exposed_person.rb +272 -0
- data/lib/transferzero-sdk/models/recipient.rb +230 -219
- data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
- data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
- data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
- data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/sender.rb +529 -322
- data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/sender_request.rb +60 -59
- data/lib/transferzero-sdk/models/sender_response.rb +66 -65
- data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
- data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
- data/lib/transferzero-sdk/models/sender_state.rb +19 -23
- data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/transaction.rb +192 -191
- data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
- data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
- data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
- data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
- data/lib/transferzero-sdk/models/transaction_state.rb +23 -27
- data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
- data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
- data/lib/transferzero-sdk/models/webhook.rb +92 -91
- data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
- data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
- data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
- data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
- data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
- data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
- data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
- data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
- data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
- data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
- data/lib/transferzero-sdk/version.rb +1 -1
- data/spec/api/account_validation_api_spec.rb +2 -2
- data/spec/api/currency_info_api_spec.rb +2 -0
- data/spec/api/documents_api_spec.rb +15 -0
- data/spec/api/recipients_api_spec.rb +1 -1
- data/spec/api/transactions_api_spec.rb +13 -0
- data/spec/models/account_validation_request_spec.rb +7 -1
- data/spec/models/currency_opposite_spec.rb +6 -0
- data/spec/models/document_spec.rb +12 -0
- data/spec/models/payin_method_details_btc_spec.rb +41 -0
- data/spec/models/payin_method_details_ngn_bank_spec.rb +6 -0
- data/spec/models/payin_method_details_spec.rb +6 -0
- data/spec/models/payout_method_details_btc_spec.rb +59 -0
- data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
- data/spec/models/payout_method_details_spec.rb +7 -1
- data/spec/models/payout_method_details_xof_bank_spec.rb +65 -0
- data/spec/models/politically_exposed_person_spec.rb +83 -0
- data/spec/models/recipient_spec.rb +6 -0
- data/spec/models/sender_spec.rb +16 -0
- data/transferzero-sdk.gemspec +2 -2
- metadata +35 -24
- data/spec/api_client_spec.rb +0 -189
data/example/client.rb
CHANGED
|
@@ -15,7 +15,7 @@ credentials = {
|
|
|
15
15
|
host: "https://api-sandbox.transferzero.com/v1"
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
# Please see our documentation at https://
|
|
18
|
+
# Please see our documentation at https://docs.transferzero.com
|
|
19
19
|
# and the API specification at http://api.transferzero.com/documentation/
|
|
20
20
|
# for more information.
|
|
21
21
|
|
|
@@ -39,7 +39,7 @@ class Client
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def account_validation_example
|
|
42
|
-
# See https://
|
|
42
|
+
# See https://docs.transferzero.com/docs/additional-features/#bank-account-name-enquiry
|
|
43
43
|
# for more information on how this feature can be used
|
|
44
44
|
begin
|
|
45
45
|
request = TransferZero::AccountValidationRequest.new
|
|
@@ -63,7 +63,7 @@ class Client
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def create_sender_example
|
|
66
|
-
# For more details on senders please check https://
|
|
66
|
+
# For more details on senders please check https://docs.transferzero.com/docs/transaction-flow/#sender
|
|
67
67
|
begin
|
|
68
68
|
api = TransferZero::SendersApi.new
|
|
69
69
|
sender = TransferZero::Sender.new
|
|
@@ -98,7 +98,7 @@ class Client
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
def get_sender_by_external_id_example
|
|
101
|
-
# Find more details on external IDs at https://
|
|
101
|
+
# Find more details on external IDs at https://docs.transferzero.com/docs/transaction-flow/#external-id
|
|
102
102
|
begin
|
|
103
103
|
opts = { external_id: 'SENDER-2b59def0' }
|
|
104
104
|
sender = TransferZero::SendersApi.new
|
|
@@ -113,7 +113,7 @@ class Client
|
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
def update_sender_example
|
|
116
|
-
# For more details on senders please check https://
|
|
116
|
+
# For more details on senders please check https://docs.transferzero.com/docs/transaction-flow/#sender
|
|
117
117
|
begin
|
|
118
118
|
api = TransferZero::SendersApi.new
|
|
119
119
|
sender = TransferZero::Sender.new
|
|
@@ -135,15 +135,15 @@ class Client
|
|
|
135
135
|
begin
|
|
136
136
|
api = TransferZero::TransactionsApi.new
|
|
137
137
|
transaction = TransferZero::Transaction.new
|
|
138
|
-
# Please check our documentation at https://
|
|
138
|
+
# Please check our documentation at https://docs.transferzero.com/docs/transaction-flow/
|
|
139
139
|
# for details on how transactions work.
|
|
140
140
|
|
|
141
141
|
sender = TransferZero::Sender.new
|
|
142
142
|
# When adding a sender to transaction, please use either an id or external_id. Providing both will result in a validation error.
|
|
143
|
-
# Please see our documentation at https://
|
|
143
|
+
# Please see our documentation at https://docs.transferzero.com/docs/transaction-flow/#sender
|
|
144
144
|
sender.id = 'ec33484c-4456-4625-a823-9704a3a54e68'
|
|
145
145
|
|
|
146
|
-
# You can find the various payout options at https://
|
|
146
|
+
# You can find the various payout options at https://docs.transferzero.com/docs/transaction-flow/#payout-details
|
|
147
147
|
ngn_bank_details = TransferZero::PayoutMethodDetails.new
|
|
148
148
|
ngn_bank_details.bank_account = '123456789'
|
|
149
149
|
ngn_bank_details.bank_account_type = TransferZero::PayoutMethodBankAccountTypeEnum::N20
|
|
@@ -155,17 +155,17 @@ class Client
|
|
|
155
155
|
payout_method.type = 'NGN::Bank'
|
|
156
156
|
payout_method.details = ngn_bank_details
|
|
157
157
|
|
|
158
|
-
# Please see https://
|
|
158
|
+
# Please see https://docs.transferzero.com/docs/transaction-flow/#requested-amount-and-currency
|
|
159
159
|
# on what the request amount and currencies do
|
|
160
160
|
recipient = TransferZero::Recipient.new
|
|
161
161
|
recipient.requested_amount = 10000
|
|
162
162
|
recipient.requested_currency = 'NGN'
|
|
163
163
|
recipient.payout_method = payout_method
|
|
164
164
|
|
|
165
|
-
# Similarly you can check https://
|
|
165
|
+
# Similarly you can check https://docs.transferzero.com/docs/transaction-flow/#requested-amount-and-currency
|
|
166
166
|
# on details about the input currency parameter
|
|
167
167
|
|
|
168
|
-
# Find more details on external IDs at https://
|
|
168
|
+
# Find more details on external IDs at https://docs.transferzero.com/docs/transaction-flow/#external-id
|
|
169
169
|
transaction.external_id = 'TRANSACTION-1f834add' # Optional field for customer's ID
|
|
170
170
|
transaction.input_currency = 'GBP'
|
|
171
171
|
transaction.sender = sender
|
|
@@ -188,7 +188,7 @@ class Client
|
|
|
188
188
|
end
|
|
189
189
|
|
|
190
190
|
def get_transaction_by_external_id_example
|
|
191
|
-
# Please see https://
|
|
191
|
+
# Please see https://docs.transferzero.com/docs/transaction-flow/#external-id
|
|
192
192
|
# for more details on external IDs
|
|
193
193
|
begin
|
|
194
194
|
opts = { external_id: 'TRANSACTION-1f834add' }
|
|
@@ -208,7 +208,7 @@ class Client
|
|
|
208
208
|
if transaction_id.nil?
|
|
209
209
|
puts "Transaction with ID #{transaction_id} does not exist"
|
|
210
210
|
else
|
|
211
|
-
# Please see https://
|
|
211
|
+
# Please see https://docs.transferzero.com/docs/transaction-flow/#funding-transactions
|
|
212
212
|
# on details about funding transactions
|
|
213
213
|
debit = TransferZero::Debit.new
|
|
214
214
|
debit.currency = 'GBP'
|
|
@@ -235,7 +235,7 @@ class Client
|
|
|
235
235
|
end
|
|
236
236
|
|
|
237
237
|
def webhook_parse_example
|
|
238
|
-
# Please see https://
|
|
238
|
+
# Please see https://docs.transferzero.com#webhooks
|
|
239
239
|
# for more details about how webhooks / callbacks work from our system
|
|
240
240
|
headers = {
|
|
241
241
|
"Authorization-Nonce": "<authorization-nonce>",
|
data/git_push.sh
CHANGED
data/lib/transferzero-sdk.rb
CHANGED
|
@@ -52,6 +52,7 @@ require 'transferzero-sdk/models/pagination'
|
|
|
52
52
|
require 'transferzero-sdk/models/pagination_meta'
|
|
53
53
|
require 'transferzero-sdk/models/payin_method'
|
|
54
54
|
require 'transferzero-sdk/models/payin_method_details'
|
|
55
|
+
require 'transferzero-sdk/models/payin_method_details_btc'
|
|
55
56
|
require 'transferzero-sdk/models/payin_method_details_mobile'
|
|
56
57
|
require 'transferzero-sdk/models/payin_method_details_ngn_bank'
|
|
57
58
|
require 'transferzero-sdk/models/payin_method_request'
|
|
@@ -61,12 +62,15 @@ require 'transferzero-sdk/models/payment_method_opposite'
|
|
|
61
62
|
require 'transferzero-sdk/models/payout_method'
|
|
62
63
|
require 'transferzero-sdk/models/payout_method_bank_account_type_enum'
|
|
63
64
|
require 'transferzero-sdk/models/payout_method_details'
|
|
65
|
+
require 'transferzero-sdk/models/payout_method_details_btc'
|
|
64
66
|
require 'transferzero-sdk/models/payout_method_details_balance'
|
|
67
|
+
require 'transferzero-sdk/models/payout_method_details_gbp_bank'
|
|
65
68
|
require 'transferzero-sdk/models/payout_method_details_ghs_bank'
|
|
66
69
|
require 'transferzero-sdk/models/payout_method_details_iban'
|
|
67
70
|
require 'transferzero-sdk/models/payout_method_details_mad_cash'
|
|
68
71
|
require 'transferzero-sdk/models/payout_method_details_mobile'
|
|
69
72
|
require 'transferzero-sdk/models/payout_method_details_ngn_bank'
|
|
73
|
+
require 'transferzero-sdk/models/payout_method_details_xof_bank'
|
|
70
74
|
require 'transferzero-sdk/models/payout_method_details_xof_mobile'
|
|
71
75
|
require 'transferzero-sdk/models/payout_method_gender_enum'
|
|
72
76
|
require 'transferzero-sdk/models/payout_method_identity_card_type_enum'
|
|
@@ -75,6 +79,7 @@ require 'transferzero-sdk/models/payout_method_mobile_provider_enum'
|
|
|
75
79
|
require 'transferzero-sdk/models/payout_method_request'
|
|
76
80
|
require 'transferzero-sdk/models/payout_method_response'
|
|
77
81
|
require 'transferzero-sdk/models/payout_method_webhook'
|
|
82
|
+
require 'transferzero-sdk/models/politically_exposed_person'
|
|
78
83
|
require 'transferzero-sdk/models/recipient'
|
|
79
84
|
require 'transferzero-sdk/models/recipient_list_response'
|
|
80
85
|
require 'transferzero-sdk/models/recipient_request'
|
|
@@ -21,8 +21,8 @@ module TransferZero
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
# Validates the existence of a bank account
|
|
25
|
-
# Validates the existence of a bank account and returns the associated customer name
|
|
24
|
+
# Validates the existence of a bank account or a mobile phone number
|
|
25
|
+
# Validates the existence of a bank account or mobile phone number and returns the associated customer name
|
|
26
26
|
# @param account_validation_request
|
|
27
27
|
# @param [Hash] opts the optional parameters
|
|
28
28
|
# @return [AccountValidationResponse]
|
|
@@ -31,8 +31,8 @@ module TransferZero
|
|
|
31
31
|
data
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
# Validates the existence of a bank account
|
|
35
|
-
# Validates the existence of a bank account and returns the associated customer name
|
|
34
|
+
# Validates the existence of a bank account or a mobile phone number
|
|
35
|
+
# Validates the existence of a bank account or mobile phone number and returns the associated customer name
|
|
36
36
|
# @param account_validation_request
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
38
|
# @return [Array<(AccountValidationResponse, Fixnum, Hash)>] AccountValidationResponse data, response status code and response headers
|
|
@@ -72,6 +72,7 @@ module TransferZero
|
|
|
72
72
|
# Getting a list of possible input currencies
|
|
73
73
|
# Fetches a list of currencies available to use as the input currency in other API requests. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier. Use this endpoint to determine the current exchange rate from a specific input currency to any output currency that's available.
|
|
74
74
|
# @param [Hash] opts the optional parameters
|
|
75
|
+
# @option opts [String] :sender_id Allows the scoping of the results by `sender_id` (optional). Example: `/v1/info/currencies/in?sender_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
|
75
76
|
# @return [CurrencyExchangeListResponse]
|
|
76
77
|
def info_currencies_in(opts = {})
|
|
77
78
|
data, _status_code, _headers = info_currencies_in_with_http_info(opts)
|
|
@@ -81,6 +82,7 @@ module TransferZero
|
|
|
81
82
|
# Getting a list of possible input currencies
|
|
82
83
|
# Fetches a list of currencies available to use as the input currency in other API requests. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier. Use this endpoint to determine the current exchange rate from a specific input currency to any output currency that's available.
|
|
83
84
|
# @param [Hash] opts the optional parameters
|
|
85
|
+
# @option opts [String] :sender_id Allows the scoping of the results by `sender_id` (optional). Example: `/v1/info/currencies/in?sender_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
|
84
86
|
# @return [Array<(CurrencyExchangeListResponse, Fixnum, Hash)>] CurrencyExchangeListResponse data, response status code and response headers
|
|
85
87
|
def info_currencies_in_with_http_info(opts = {})
|
|
86
88
|
if @api_client.config.debugging
|
|
@@ -91,6 +93,7 @@ module TransferZero
|
|
|
91
93
|
|
|
92
94
|
# query parameters
|
|
93
95
|
query_params = {}
|
|
96
|
+
query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
|
|
94
97
|
|
|
95
98
|
# header parameters
|
|
96
99
|
header_params = {}
|
|
@@ -120,6 +123,7 @@ module TransferZero
|
|
|
120
123
|
# Getting a list of possible output currencies
|
|
121
124
|
# Fetches a list of currencies available to use as the output currency and their exchange rates against the available input currencies. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier.
|
|
122
125
|
# @param [Hash] opts the optional parameters
|
|
126
|
+
# @option opts [String] :sender_id Allows the scoping of the results by `sender_id` (optional). Example: `/v1/info/currencies/out?sender_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
|
123
127
|
# @return [CurrencyExchangeListResponse]
|
|
124
128
|
def info_currencies_out(opts = {})
|
|
125
129
|
data, _status_code, _headers = info_currencies_out_with_http_info(opts)
|
|
@@ -129,6 +133,7 @@ module TransferZero
|
|
|
129
133
|
# Getting a list of possible output currencies
|
|
130
134
|
# Fetches a list of currencies available to use as the output currency and their exchange rates against the available input currencies. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier.
|
|
131
135
|
# @param [Hash] opts the optional parameters
|
|
136
|
+
# @option opts [String] :sender_id Allows the scoping of the results by `sender_id` (optional). Example: `/v1/info/currencies/out?sender_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
|
132
137
|
# @return [Array<(CurrencyExchangeListResponse, Fixnum, Hash)>] CurrencyExchangeListResponse data, response status code and response headers
|
|
133
138
|
def info_currencies_out_with_http_info(opts = {})
|
|
134
139
|
if @api_client.config.debugging
|
|
@@ -139,6 +144,7 @@ module TransferZero
|
|
|
139
144
|
|
|
140
145
|
# query parameters
|
|
141
146
|
query_params = {}
|
|
147
|
+
query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
|
|
142
148
|
|
|
143
149
|
# header parameters
|
|
144
150
|
header_params = {}
|
|
@@ -22,7 +22,7 @@ module TransferZero
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
# Cancelling a recipient
|
|
25
|
-
# Cancels the payment to the recipient specified in the URL path. Please note
|
|
25
|
+
# Cancels the payment to the recipient specified in the URL path. Please note recipients where the `may_cancel` attribute is true will be cancelled immediately. If the `may_cancel` attribute is false you can still try to cancel the recipient, however it will only gets cancelled if we will receive a confirmation from our partner that the payment has failed
|
|
26
26
|
# @param recipient_id ID of recipient to cancel. Example: `/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33`
|
|
27
27
|
# @param [Hash] opts the optional parameters
|
|
28
28
|
# @return [RecipientResponse]
|
|
@@ -32,7 +32,7 @@ module TransferZero
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Cancelling a recipient
|
|
35
|
-
# Cancels the payment to the recipient specified in the URL path. Please note
|
|
35
|
+
# Cancels the payment to the recipient specified in the URL path. Please note recipients where the `may_cancel` attribute is true will be cancelled immediately. If the `may_cancel` attribute is false you can still try to cancel the recipient, however it will only gets cancelled if we will receive a confirmation from our partner that the payment has failed
|
|
36
36
|
# @param recipient_id ID of recipient to cancel. Example: `/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33`
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
38
|
# @return [Array<(RecipientResponse, Fixnum, Hash)>] RecipientResponse data, response status code and response headers
|
|
@@ -94,7 +94,7 @@ module TransferZero
|
|
|
94
94
|
# @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
|
95
95
|
# @option opts [String] :amount_from Minimum amount to filter recipients by amount range. Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=NGN&amount_from=83.76672339&amount_to=83.76672339`
|
|
96
96
|
# @option opts [String] :amount_to Max amount to filter recipients by amount range. Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=NGN&amount_from=83.76672339&amount_to=83.76672339`
|
|
97
|
-
# @option opts [Array<String>] :state Allows filtering results by `state` of recipient. See [API Documentation - Recipient state](https://
|
|
97
|
+
# @option opts [Array<String>] :state Allows filtering results by `state` of recipient. See [API Documentation - Recipient state](https://docs.transferzero.com/docs/transaction-flow/#state) for possible states. Example: `/v1/recipients?state[]=error&state[]=initial`
|
|
98
98
|
# @option opts [Array<String>] :currency Allows filtering results by `input_currency`. Additionally required when filtering by an amount range Example: `/v1/recipients?currency[]=KES&currency[]=NGN`
|
|
99
99
|
# @return [RecipientListResponse]
|
|
100
100
|
def get_recipients(opts = {})
|
|
@@ -111,7 +111,7 @@ module TransferZero
|
|
|
111
111
|
# @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08`
|
|
112
112
|
# @option opts [String] :amount_from Minimum amount to filter recipients by amount range. Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=NGN&amount_from=83.76672339&amount_to=83.76672339`
|
|
113
113
|
# @option opts [String] :amount_to Max amount to filter recipients by amount range. Allows filtering results by the specified `amount` range. When using this filter, the `currency` should also be specified. Example: `/v1/recipients?currency=NGN&amount_from=83.76672339&amount_to=83.76672339`
|
|
114
|
-
# @option opts [Array<String>] :state Allows filtering results by `state` of recipient. See [API Documentation - Recipient state](https://
|
|
114
|
+
# @option opts [Array<String>] :state Allows filtering results by `state` of recipient. See [API Documentation - Recipient state](https://docs.transferzero.com/docs/transaction-flow/#state) for possible states. Example: `/v1/recipients?state[]=error&state[]=initial`
|
|
115
115
|
# @option opts [Array<String>] :currency Allows filtering results by `input_currency`. Additionally required when filtering by an amount range Example: `/v1/recipients?currency[]=KES&currency[]=NGN`
|
|
116
116
|
# @return [Array<(RecipientListResponse, Fixnum, Hash)>] RecipientListResponse data, response status code and response headers
|
|
117
117
|
def get_recipients_with_http_info(opts = {})
|
|
@@ -77,6 +77,62 @@ module TransferZero
|
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
|
|
80
|
+
# Creates a new transaction and funds it from account balance
|
|
81
|
+
# This endpoint creates a transaction and funds it from an account balance. You must ensure that you have established an account with us in the pay-in currency of the transactions you wish to create, and that this account is sufficently funded, before calling this endpoint. Note that the <pre>external_id</pre> field is required for requests to this endpoint.
|
|
82
|
+
# @param transaction_request
|
|
83
|
+
# @param [Hash] opts the optional parameters
|
|
84
|
+
# @return [TransactionResponse]
|
|
85
|
+
def create_and_fund_transaction(transaction_request, opts = {})
|
|
86
|
+
data, _status_code, _headers = create_and_fund_transaction_with_http_info(transaction_request, opts)
|
|
87
|
+
data
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Creates a new transaction and funds it from account balance
|
|
91
|
+
# This endpoint creates a transaction and funds it from an account balance. You must ensure that you have established an account with us in the pay-in currency of the transactions you wish to create, and that this account is sufficently funded, before calling this endpoint. Note that the <pre>external_id</pre> field is required for requests to this endpoint.
|
|
92
|
+
# @param transaction_request
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
|
|
95
|
+
def create_and_fund_transaction_with_http_info(transaction_request, opts = {})
|
|
96
|
+
if @api_client.config.debugging
|
|
97
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.create_and_fund_transaction ...'
|
|
98
|
+
end
|
|
99
|
+
# verify the required parameter 'transaction_request' is set
|
|
100
|
+
if @api_client.config.client_side_validation && transaction_request.nil?
|
|
101
|
+
fail ArgumentError, "Missing the required parameter 'transaction_request' when calling TransactionsApi.create_and_fund_transaction"
|
|
102
|
+
end
|
|
103
|
+
# resource path
|
|
104
|
+
local_var_path = '/transactions/create_and_fund'
|
|
105
|
+
|
|
106
|
+
# query parameters
|
|
107
|
+
query_params = {}
|
|
108
|
+
|
|
109
|
+
# header parameters
|
|
110
|
+
header_params = {}
|
|
111
|
+
# HTTP header 'Accept' (if needed)
|
|
112
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
113
|
+
# HTTP header 'Content-Type'
|
|
114
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
115
|
+
|
|
116
|
+
# form parameters
|
|
117
|
+
form_params = {}
|
|
118
|
+
|
|
119
|
+
# http body (model)
|
|
120
|
+
post_body = @api_client.object_to_http_body(transaction_request)
|
|
121
|
+
auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
|
|
122
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
123
|
+
:header_params => header_params,
|
|
124
|
+
:query_params => query_params,
|
|
125
|
+
:form_params => form_params,
|
|
126
|
+
:body => post_body,
|
|
127
|
+
:auth_names => auth_names,
|
|
128
|
+
:return_type => 'TransactionResponse')
|
|
129
|
+
if @api_client.config.debugging
|
|
130
|
+
@api_client.config.logger.debug "API called: TransactionsApi#create_and_fund_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
131
|
+
end
|
|
132
|
+
return data, status_code, headers
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
|
|
80
136
|
# Fetch a single transaction
|
|
81
137
|
# Finds and returns a Transaction created by the requesting API key, using the provided Transaction ID.
|
|
82
138
|
# @param transaction_id ID of the transaction. Example: `/v1/transactions/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
|
@@ -147,6 +203,7 @@ module TransferZero
|
|
|
147
203
|
# @option opts [Integer] :page The page number to request (defaults to 1)
|
|
148
204
|
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
|
149
205
|
# @option opts [String] :external_id Allows filtering results by `external_id`. Example: `/v1/senders?external_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
|
206
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
150
207
|
# @return [TransactionListResponse]
|
|
151
208
|
def get_transactions(opts = {})
|
|
152
209
|
data, _status_code, _headers = get_transactions_with_http_info(opts)
|
|
@@ -159,6 +216,7 @@ module TransferZero
|
|
|
159
216
|
# @option opts [Integer] :page The page number to request (defaults to 1)
|
|
160
217
|
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
|
161
218
|
# @option opts [String] :external_id Allows filtering results by `external_id`. Example: `/v1/senders?external_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
|
|
219
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
162
220
|
# @return [Array<(TransactionListResponse, Fixnum, Hash)>] TransactionListResponse data, response status code and response headers
|
|
163
221
|
def get_transactions_with_http_info(opts = {})
|
|
164
222
|
if @api_client.config.debugging
|
|
@@ -172,6 +230,7 @@ module TransferZero
|
|
|
172
230
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
173
231
|
query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil?
|
|
174
232
|
query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
|
|
233
|
+
query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
|
|
175
234
|
|
|
176
235
|
# header parameters
|
|
177
236
|
header_params = {}
|
|
@@ -35,7 +35,7 @@ module TransferZero
|
|
|
35
35
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
36
36
|
def initialize(config = Configuration.default)
|
|
37
37
|
@config = config
|
|
38
|
-
@user_agent = "TransferZero-SDK/Ruby/1.
|
|
38
|
+
@user_agent = "TransferZero-SDK/Ruby/1.7.0"
|
|
39
39
|
@default_headers = {
|
|
40
40
|
'Content-Type' => 'application/json',
|
|
41
41
|
'User-Agent' => @user_agent
|
|
@@ -106,12 +106,14 @@ module TransferZero
|
|
|
106
106
|
url_with_params = add_query(url, query_params)
|
|
107
107
|
form_params = opts[:form_params] || {}
|
|
108
108
|
|
|
109
|
+
request_body = opts[:body].to_s.gsub(/[[:space:]]+/, ' ').strip
|
|
110
|
+
|
|
109
111
|
request_nonce = SecureRandom.uuid
|
|
110
112
|
request_signature = sign_request([
|
|
111
113
|
request_nonce,
|
|
112
114
|
http_method.to_s.upcase,
|
|
113
115
|
url_with_params,
|
|
114
|
-
DIGEST.hexdigest(
|
|
116
|
+
DIGEST.hexdigest(request_body)
|
|
115
117
|
])
|
|
116
118
|
|
|
117
119
|
header_params['Authorization-Nonce'] = request_nonce
|
|
@@ -138,7 +140,7 @@ module TransferZero
|
|
|
138
140
|
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
|
139
141
|
|
|
140
142
|
if [:post, :patch, :put, :delete].include?(http_method)
|
|
141
|
-
req_body = build_request_body(header_params, form_params,
|
|
143
|
+
req_body = build_request_body(header_params, form_params, request_body)
|
|
142
144
|
req_opts.update :body => req_body
|
|
143
145
|
if @config.debugging
|
|
144
146
|
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
|
@@ -186,8 +188,6 @@ module TransferZero
|
|
|
186
188
|
# @param headers The request header
|
|
187
189
|
#
|
|
188
190
|
# @return boolean
|
|
189
|
-
#
|
|
190
|
-
|
|
191
191
|
def validate_webhook_request(url, body, headers)
|
|
192
192
|
nonce = headers[:'Authorization-Nonce'] || headers['Authorization-Nonce']
|
|
193
193
|
signature = headers[:'Authorization-Signature'] || headers['Authorization-Signature']
|
|
@@ -13,86 +13,86 @@ OpenAPI Generator version: 4.0.0-beta3
|
|
|
13
13
|
require 'date'
|
|
14
14
|
|
|
15
15
|
module TransferZero
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# Attribute type mapping.
|
|
32
|
-
def self.openapi_types
|
|
33
|
-
{
|
|
34
|
-
:'amount' => :'Float',
|
|
35
|
-
:'currency' => :'String'
|
|
36
|
-
}
|
|
37
|
-
end
|
|
16
|
+
class Account
|
|
17
|
+
# The account balance for the given currency
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
# The currency of this balance
|
|
21
|
+
attr_accessor :currency
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'amount' => :'amount',
|
|
27
|
+
:'currency' => :'currency'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
# Attribute type mapping.
|
|
32
|
+
def self.openapi_types
|
|
33
|
+
{
|
|
34
|
+
:'amount' => :'Float',
|
|
35
|
+
:'currency' => :'String'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
39
|
+
# Initializes the object
|
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
41
|
+
def initialize(attributes = {})
|
|
42
|
+
if (!attributes.is_a?(Hash))
|
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Account` initialize method"
|
|
44
|
+
end
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
56
50
|
end
|
|
51
|
+
h[k.to_sym] = v
|
|
52
|
+
}
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
end
|
|
54
|
+
if attributes.key?(:'amount')
|
|
55
|
+
self.amount = attributes[:'amount']
|
|
61
56
|
end
|
|
62
57
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def list_invalid_properties
|
|
66
|
-
invalid_properties = Array.new
|
|
67
|
-
invalid_properties
|
|
58
|
+
if attributes.key?(:'currency')
|
|
59
|
+
self.currency = attributes[:'currency']
|
|
68
60
|
end
|
|
61
|
+
end
|
|
69
62
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
64
|
+
# @return Array for valid properties with the reasons
|
|
65
|
+
def list_invalid_properties
|
|
66
|
+
invalid_properties = Array.new
|
|
67
|
+
invalid_properties
|
|
68
|
+
end
|
|
75
69
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
amount == o.amount &&
|
|
82
|
-
currency == o.currency
|
|
83
|
-
end
|
|
70
|
+
# Check to see if the all the properties in the model are valid
|
|
71
|
+
# @return true if the model is valid
|
|
72
|
+
def valid?
|
|
73
|
+
true
|
|
74
|
+
end
|
|
84
75
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
# Checks equality by comparing each attribute.
|
|
77
|
+
# @param [Object] Object to be compared
|
|
78
|
+
def ==(o)
|
|
79
|
+
return true if self.equal?(o)
|
|
80
|
+
self.class == o.class &&
|
|
81
|
+
amount == o.amount &&
|
|
82
|
+
currency == o.currency
|
|
83
|
+
end
|
|
90
84
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
# @see the `==` method
|
|
86
|
+
# @param [Object] Object to be compared
|
|
87
|
+
def eql?(o)
|
|
88
|
+
self == o
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Calculates hash code according to all attributes.
|
|
92
|
+
# @return [Integer] Hash code
|
|
93
|
+
def hash
|
|
94
|
+
[amount, currency].hash
|
|
95
|
+
end
|
|
96
96
|
|
|
97
97
|
require 'active_support/core_ext/hash'
|
|
98
98
|
require 'active_support/hash_with_indifferent_access.rb'
|
|
@@ -208,5 +208,6 @@ def _to_hash(value)
|
|
|
208
208
|
end
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
end
|
|
212
|
+
|
|
212
213
|
end
|