transferzero-sdk 1.3.0 → 1.8.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 +15 -18
- 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/CurrencyOpposite.md +1 -1
- data/docs/Document.md +5 -1
- data/docs/DocumentsApi.md +74 -2
- data/docs/FieldSelectValidation.md +1 -1
- data/docs/FieldValidation.md +1 -1
- data/docs/PayinMethod.md +4 -4
- data/docs/PayinMethodDetails.md +5 -3
- 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 +5 -3
- data/docs/PayoutMethodDetailsNGNBank.md +1 -1
- data/docs/PayoutMethodDetailsXOFBank.md +25 -0
- data/docs/PoliticallyExposedPerson.md +31 -0
- data/docs/Recipient.md +3 -3
- data/docs/RecipientsApi.md +2 -2
- data/docs/Sender.md +2 -0
- 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 +2 -7
- data/lib/transferzero-sdk/api/account_validation_api.rb +4 -4
- data/lib/transferzero-sdk/api/documents_api.rb +63 -0
- data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
- data/lib/transferzero-sdk/api/transactions_api.rb +59 -0
- data/lib/transferzero-sdk/api_client.rb +1 -1
- data/lib/transferzero-sdk/models/account_validation_request.rb +15 -15
- data/lib/transferzero-sdk/models/currency_exchange.rb +1 -2
- data/lib/transferzero-sdk/models/currency_opposite.rb +1 -2
- data/lib/transferzero-sdk/models/document.rb +20 -1
- data/lib/transferzero-sdk/models/document_webhook.rb +0 -1
- data/lib/transferzero-sdk/models/payin_method.rb +4 -4
- data/lib/transferzero-sdk/models/payin_method_details.rb +12 -7
- data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +11 -6
- data/lib/transferzero-sdk/models/payout_method.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_details.rb +25 -15
- data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +0 -5
- data/lib/transferzero-sdk/models/{currency_opposite_all_of.rb → payout_method_details_xof_bank.rb} +69 -18
- data/lib/transferzero-sdk/models/payout_method_webhook.rb +0 -1
- data/lib/transferzero-sdk/models/{payout_method_webhook_all_of.rb → politically_exposed_person.rb} +81 -10
- data/lib/transferzero-sdk/models/recipient_webhook.rb +0 -1
- data/lib/transferzero-sdk/models/sender.rb +14 -2
- data/lib/transferzero-sdk/models/sender_state.rb +1 -0
- data/lib/transferzero-sdk/models/sender_webhook.rb +0 -1
- data/lib/transferzero-sdk/models/transaction.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_state.rb +1 -0
- data/lib/transferzero-sdk/models/transaction_traits.rb +3 -3
- data/lib/transferzero-sdk/models/transaction_webhook.rb +0 -1
- data/lib/transferzero-sdk/models/webhook.rb +1 -1
- 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_ngn_bank_spec.rb +6 -0
- data/spec/models/payin_method_details_spec.rb +6 -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 +17 -46
- data/Gemfile.lock +0 -93
- data/docs/CurrencyExchangeAllOf.md +0 -17
- data/docs/CurrencyOppositeAllOf.md +0 -19
- data/docs/DocumentWebhookAllOf.md +0 -17
- data/docs/PayoutMethodWebhookAllOf.md +0 -17
- data/docs/RecipientWebhookAllOf.md +0 -17
- data/docs/SenderWebhookAllOf.md +0 -17
- data/docs/TransactionWebhookAllOf.md +0 -17
- data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +0 -204
- data/lib/transferzero-sdk/models/document_webhook_all_of.rb +0 -201
- data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +0 -201
- data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +0 -201
- data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +0 -201
- data/spec/api_client_spec.rb +0 -189
- data/spec/models/currency_exchange_all_of_spec.rb +0 -41
- data/spec/models/currency_opposite_all_of_spec.rb +0 -41
- data/spec/models/document_webhook_all_of_spec.rb +0 -41
- data/spec/models/payout_method_webhook_all_of_spec.rb +0 -41
- data/spec/models/recipient_webhook_all_of_spec.rb +0 -41
- data/spec/models/sender_webhook_all_of_spec.rb +0 -41
- data/spec/models/transaction_webhook_all_of_spec.rb +0 -41
data/lib/transferzero-sdk.rb
CHANGED
|
@@ -30,11 +30,9 @@ require 'transferzero-sdk/models/api_log_list_response'
|
|
|
30
30
|
require 'transferzero-sdk/models/api_log_response'
|
|
31
31
|
require 'transferzero-sdk/models/currency'
|
|
32
32
|
require 'transferzero-sdk/models/currency_exchange'
|
|
33
|
-
require 'transferzero-sdk/models/currency_exchange_all_of'
|
|
34
33
|
require 'transferzero-sdk/models/currency_exchange_list_response'
|
|
35
34
|
require 'transferzero-sdk/models/currency_list_response'
|
|
36
35
|
require 'transferzero-sdk/models/currency_opposite'
|
|
37
|
-
require 'transferzero-sdk/models/currency_opposite_all_of'
|
|
38
36
|
require 'transferzero-sdk/models/debit'
|
|
39
37
|
require 'transferzero-sdk/models/debit_list_request'
|
|
40
38
|
require 'transferzero-sdk/models/debit_list_response'
|
|
@@ -46,7 +44,6 @@ require 'transferzero-sdk/models/document_list_response'
|
|
|
46
44
|
require 'transferzero-sdk/models/document_request'
|
|
47
45
|
require 'transferzero-sdk/models/document_response'
|
|
48
46
|
require 'transferzero-sdk/models/document_webhook'
|
|
49
|
-
require 'transferzero-sdk/models/document_webhook_all_of'
|
|
50
47
|
require 'transferzero-sdk/models/error_status'
|
|
51
48
|
require 'transferzero-sdk/models/field_description'
|
|
52
49
|
require 'transferzero-sdk/models/field_select_validation'
|
|
@@ -70,6 +67,7 @@ require 'transferzero-sdk/models/payout_method_details_iban'
|
|
|
70
67
|
require 'transferzero-sdk/models/payout_method_details_mad_cash'
|
|
71
68
|
require 'transferzero-sdk/models/payout_method_details_mobile'
|
|
72
69
|
require 'transferzero-sdk/models/payout_method_details_ngn_bank'
|
|
70
|
+
require 'transferzero-sdk/models/payout_method_details_xof_bank'
|
|
73
71
|
require 'transferzero-sdk/models/payout_method_details_xof_mobile'
|
|
74
72
|
require 'transferzero-sdk/models/payout_method_gender_enum'
|
|
75
73
|
require 'transferzero-sdk/models/payout_method_identity_card_type_enum'
|
|
@@ -78,14 +76,13 @@ require 'transferzero-sdk/models/payout_method_mobile_provider_enum'
|
|
|
78
76
|
require 'transferzero-sdk/models/payout_method_request'
|
|
79
77
|
require 'transferzero-sdk/models/payout_method_response'
|
|
80
78
|
require 'transferzero-sdk/models/payout_method_webhook'
|
|
81
|
-
require 'transferzero-sdk/models/
|
|
79
|
+
require 'transferzero-sdk/models/politically_exposed_person'
|
|
82
80
|
require 'transferzero-sdk/models/recipient'
|
|
83
81
|
require 'transferzero-sdk/models/recipient_list_response'
|
|
84
82
|
require 'transferzero-sdk/models/recipient_request'
|
|
85
83
|
require 'transferzero-sdk/models/recipient_response'
|
|
86
84
|
require 'transferzero-sdk/models/recipient_state'
|
|
87
85
|
require 'transferzero-sdk/models/recipient_webhook'
|
|
88
|
-
require 'transferzero-sdk/models/recipient_webhook_all_of'
|
|
89
86
|
require 'transferzero-sdk/models/sender'
|
|
90
87
|
require 'transferzero-sdk/models/sender_list_response'
|
|
91
88
|
require 'transferzero-sdk/models/sender_request'
|
|
@@ -94,7 +91,6 @@ require 'transferzero-sdk/models/sender_response_existing'
|
|
|
94
91
|
require 'transferzero-sdk/models/sender_response_meta'
|
|
95
92
|
require 'transferzero-sdk/models/sender_state'
|
|
96
93
|
require 'transferzero-sdk/models/sender_webhook'
|
|
97
|
-
require 'transferzero-sdk/models/sender_webhook_all_of'
|
|
98
94
|
require 'transferzero-sdk/models/transaction'
|
|
99
95
|
require 'transferzero-sdk/models/transaction_list_response'
|
|
100
96
|
require 'transferzero-sdk/models/transaction_request'
|
|
@@ -104,7 +100,6 @@ require 'transferzero-sdk/models/transaction_response_meta'
|
|
|
104
100
|
require 'transferzero-sdk/models/transaction_state'
|
|
105
101
|
require 'transferzero-sdk/models/transaction_traits'
|
|
106
102
|
require 'transferzero-sdk/models/transaction_webhook'
|
|
107
|
-
require 'transferzero-sdk/models/transaction_webhook_all_of'
|
|
108
103
|
require 'transferzero-sdk/models/validation_error_description'
|
|
109
104
|
require 'transferzero-sdk/models/webhook'
|
|
110
105
|
require 'transferzero-sdk/models/webhook_definition'
|
|
@@ -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
|
|
@@ -21,10 +21,68 @@ module TransferZero
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
# Deleting a document
|
|
25
|
+
# Deletes a single document by the Document ID
|
|
26
|
+
# @param document_id ID of the document to delete. Example: `/v1/document/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
|
27
|
+
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
29
|
+
# @return [DocumentResponse]
|
|
30
|
+
def delete_document(document_id, opts = {})
|
|
31
|
+
data, _status_code, _headers = delete_document_with_http_info(document_id, opts)
|
|
32
|
+
data
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Deleting a document
|
|
36
|
+
# Deletes a single document by the Document ID
|
|
37
|
+
# @param document_id ID of the document to delete. Example: `/v1/document/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
40
|
+
# @return [Array<(DocumentResponse, Fixnum, Hash)>] DocumentResponse data, response status code and response headers
|
|
41
|
+
def delete_document_with_http_info(document_id, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: DocumentsApi.delete_document ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'document_id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && document_id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.delete_document"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/documents/{Document ID}'.sub('{' + 'Document ID' + '}', document_id.to_s)
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = {}
|
|
54
|
+
query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
|
|
55
|
+
|
|
56
|
+
# header parameters
|
|
57
|
+
header_params = {}
|
|
58
|
+
# HTTP header 'Accept' (if needed)
|
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = nil
|
|
66
|
+
auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
|
|
67
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => 'DocumentResponse')
|
|
74
|
+
if @api_client.config.debugging
|
|
75
|
+
@api_client.config.logger.debug "API called: DocumentsApi#delete_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
76
|
+
end
|
|
77
|
+
return data, status_code, headers
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
|
|
24
81
|
# Fetching a document
|
|
25
82
|
# Returns a single document by the Documents ID
|
|
26
83
|
# @param document_id ID of the document to get. Example: `/v1/documents/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
|
27
84
|
# @param [Hash] opts the optional parameters
|
|
85
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
28
86
|
# @return [DocumentResponse]
|
|
29
87
|
def get_document(document_id, opts = {})
|
|
30
88
|
data, _status_code, _headers = get_document_with_http_info(document_id, opts)
|
|
@@ -35,6 +93,7 @@ module TransferZero
|
|
|
35
93
|
# Returns a single document by the Documents ID
|
|
36
94
|
# @param document_id ID of the document to get. Example: `/v1/documents/bf9ff782-e182-45ac-abea-5bce83ad6670`
|
|
37
95
|
# @param [Hash] opts the optional parameters
|
|
96
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
38
97
|
# @return [Array<(DocumentResponse, Fixnum, Hash)>] DocumentResponse data, response status code and response headers
|
|
39
98
|
def get_document_with_http_info(document_id, opts = {})
|
|
40
99
|
if @api_client.config.debugging
|
|
@@ -49,6 +108,7 @@ module TransferZero
|
|
|
49
108
|
|
|
50
109
|
# query parameters
|
|
51
110
|
query_params = {}
|
|
111
|
+
query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
|
|
52
112
|
|
|
53
113
|
# header parameters
|
|
54
114
|
header_params = {}
|
|
@@ -90,6 +150,7 @@ module TransferZero
|
|
|
90
150
|
# @param [Hash] opts the optional parameters
|
|
91
151
|
# @option opts [Integer] :page The page number to request (defaults to 1)
|
|
92
152
|
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
|
153
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
93
154
|
# @return [DocumentListResponse]
|
|
94
155
|
def get_documents(opts = {})
|
|
95
156
|
data, _status_code, _headers = get_documents_with_http_info(opts)
|
|
@@ -101,6 +162,7 @@ module TransferZero
|
|
|
101
162
|
# @param [Hash] opts the optional parameters
|
|
102
163
|
# @option opts [Integer] :page The page number to request (defaults to 1)
|
|
103
164
|
# @option opts [Integer] :per The number of results to load per page (defaults to 10)
|
|
165
|
+
# @option opts [String] :sender_id Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
|
|
104
166
|
# @return [Array<(DocumentListResponse, Fixnum, Hash)>] DocumentListResponse data, response status code and response headers
|
|
105
167
|
def get_documents_with_http_info(opts = {})
|
|
106
168
|
if @api_client.config.debugging
|
|
@@ -113,6 +175,7 @@ module TransferZero
|
|
|
113
175
|
query_params = {}
|
|
114
176
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
115
177
|
query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil?
|
|
178
|
+
query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
|
|
116
179
|
|
|
117
180
|
# header parameters
|
|
118
181
|
header_params = {}
|
|
@@ -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.8.0"
|
|
39
39
|
@default_headers = {
|
|
40
40
|
'Content-Type' => 'application/json',
|
|
41
41
|
'User-Agent' => @user_agent
|
|
@@ -20,13 +20,16 @@ module TransferZero
|
|
|
20
20
|
# Bank Code to query - same codes are used as for creating the transactions
|
|
21
21
|
attr_accessor :bank_code
|
|
22
22
|
|
|
23
|
-
#
|
|
23
|
+
# Phone number to query
|
|
24
|
+
attr_accessor :phone_number
|
|
25
|
+
|
|
26
|
+
# Country of account in 2-character alpha ISO 3166-2 country format
|
|
24
27
|
attr_accessor :country
|
|
25
28
|
|
|
26
29
|
# The currency the bank account is in
|
|
27
30
|
attr_accessor :currency
|
|
28
31
|
|
|
29
|
-
# The method of the payment. Currently
|
|
32
|
+
# The method of the payment. Currently bank and mobile are supported
|
|
30
33
|
attr_accessor :method
|
|
31
34
|
|
|
32
35
|
class EnumAttributeValidator
|
|
@@ -56,6 +59,7 @@ module TransferZero
|
|
|
56
59
|
{
|
|
57
60
|
:'bank_account' => :'bank_account',
|
|
58
61
|
:'bank_code' => :'bank_code',
|
|
62
|
+
:'phone_number' => :'phone_number',
|
|
59
63
|
:'country' => :'country',
|
|
60
64
|
:'currency' => :'currency',
|
|
61
65
|
:'method' => :'method'
|
|
@@ -67,6 +71,7 @@ module TransferZero
|
|
|
67
71
|
{
|
|
68
72
|
:'bank_account' => :'String',
|
|
69
73
|
:'bank_code' => :'String',
|
|
74
|
+
:'phone_number' => :'String',
|
|
70
75
|
:'country' => :'String',
|
|
71
76
|
:'currency' => :'String',
|
|
72
77
|
:'method' => :'String'
|
|
@@ -96,6 +101,10 @@ module TransferZero
|
|
|
96
101
|
self.bank_code = attributes[:'bank_code']
|
|
97
102
|
end
|
|
98
103
|
|
|
104
|
+
if attributes.key?(:'phone_number')
|
|
105
|
+
self.phone_number = attributes[:'phone_number']
|
|
106
|
+
end
|
|
107
|
+
|
|
99
108
|
if attributes.key?(:'country')
|
|
100
109
|
self.country = attributes[:'country']
|
|
101
110
|
end
|
|
@@ -113,14 +122,6 @@ module TransferZero
|
|
|
113
122
|
# @return Array for valid properties with the reasons
|
|
114
123
|
def list_invalid_properties
|
|
115
124
|
invalid_properties = Array.new
|
|
116
|
-
if @bank_account.nil?
|
|
117
|
-
invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
if @bank_code.nil?
|
|
121
|
-
invalid_properties.push('invalid value for "bank_code", bank_code cannot be nil.')
|
|
122
|
-
end
|
|
123
|
-
|
|
124
125
|
if @country.nil?
|
|
125
126
|
invalid_properties.push('invalid value for "country", country cannot be nil.')
|
|
126
127
|
end
|
|
@@ -139,8 +140,6 @@ module TransferZero
|
|
|
139
140
|
# Check to see if the all the properties in the model are valid
|
|
140
141
|
# @return true if the model is valid
|
|
141
142
|
def valid?
|
|
142
|
-
return false if @bank_account.nil?
|
|
143
|
-
return false if @bank_code.nil?
|
|
144
143
|
return false if @country.nil?
|
|
145
144
|
country_validator = EnumAttributeValidator.new('String', ["NG", "GH"])
|
|
146
145
|
return false unless country_validator.valid?(@country)
|
|
@@ -148,7 +147,7 @@ module TransferZero
|
|
|
148
147
|
currency_validator = EnumAttributeValidator.new('String', ["NGN", "GHS"])
|
|
149
148
|
return false unless currency_validator.valid?(@currency)
|
|
150
149
|
return false if @method.nil?
|
|
151
|
-
method_validator = EnumAttributeValidator.new('String', ["bank"])
|
|
150
|
+
method_validator = EnumAttributeValidator.new('String', ["bank", "mobile"])
|
|
152
151
|
return false unless method_validator.valid?(@method)
|
|
153
152
|
true
|
|
154
153
|
end
|
|
@@ -176,7 +175,7 @@ module TransferZero
|
|
|
176
175
|
# Custom attribute writer method checking allowed values (enum).
|
|
177
176
|
# @param [Object] method Object to be assigned
|
|
178
177
|
def method=(method)
|
|
179
|
-
validator = EnumAttributeValidator.new('String', ["bank"])
|
|
178
|
+
validator = EnumAttributeValidator.new('String', ["bank", "mobile"])
|
|
180
179
|
unless validator.valid?(method)
|
|
181
180
|
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
|
182
181
|
end
|
|
@@ -190,6 +189,7 @@ module TransferZero
|
|
|
190
189
|
self.class == o.class &&
|
|
191
190
|
bank_account == o.bank_account &&
|
|
192
191
|
bank_code == o.bank_code &&
|
|
192
|
+
phone_number == o.phone_number &&
|
|
193
193
|
country == o.country &&
|
|
194
194
|
currency == o.currency &&
|
|
195
195
|
method == o.method
|
|
@@ -204,7 +204,7 @@ module TransferZero
|
|
|
204
204
|
# Calculates hash code according to all attributes.
|
|
205
205
|
# @return [Integer] Hash code
|
|
206
206
|
def hash
|
|
207
|
-
[bank_account, bank_code, country, currency, method].hash
|
|
207
|
+
[bank_account, bank_code, phone_number, country, currency, method].hash
|
|
208
208
|
end
|
|
209
209
|
|
|
210
210
|
require 'active_support/core_ext/hash'
|
|
@@ -14,6 +14,8 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module TransferZero
|
|
16
16
|
class Document
|
|
17
|
+
attr_accessor :sender_id
|
|
18
|
+
|
|
17
19
|
# Base64 encoded data uri of an image/pdf file or a fully qualified url
|
|
18
20
|
attr_accessor :upload
|
|
19
21
|
|
|
@@ -33,6 +35,9 @@ module TransferZero
|
|
|
33
35
|
# The side of the KYC ID. One of 'front' or 'back'
|
|
34
36
|
attr_accessor :side
|
|
35
37
|
|
|
38
|
+
# This is a brief description of the document type
|
|
39
|
+
attr_accessor :document_type
|
|
40
|
+
|
|
36
41
|
# Issuing country of ID in 2-character alpha ISO 3166-2 country format
|
|
37
42
|
attr_accessor :issuing_country
|
|
38
43
|
|
|
@@ -66,6 +71,7 @@ module TransferZero
|
|
|
66
71
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
67
72
|
def self.attribute_map
|
|
68
73
|
{
|
|
74
|
+
:'sender_id' => :'sender_id',
|
|
69
75
|
:'upload' => :'upload',
|
|
70
76
|
:'upload_file_name' => :'upload_file_name',
|
|
71
77
|
:'metadata' => :'metadata',
|
|
@@ -73,6 +79,7 @@ module TransferZero
|
|
|
73
79
|
:'upload_file_size' => :'upload_file_size',
|
|
74
80
|
:'category' => :'category',
|
|
75
81
|
:'side' => :'side',
|
|
82
|
+
:'document_type' => :'document_type',
|
|
76
83
|
:'issuing_country' => :'issuing_country',
|
|
77
84
|
:'id' => :'id',
|
|
78
85
|
:'errors' => :'errors'
|
|
@@ -82,6 +89,7 @@ module TransferZero
|
|
|
82
89
|
# Attribute type mapping.
|
|
83
90
|
def self.openapi_types
|
|
84
91
|
{
|
|
92
|
+
:'sender_id' => :'String',
|
|
85
93
|
:'upload' => :'String',
|
|
86
94
|
:'upload_file_name' => :'String',
|
|
87
95
|
:'metadata' => :'Object',
|
|
@@ -89,6 +97,7 @@ module TransferZero
|
|
|
89
97
|
:'upload_file_size' => :'Integer',
|
|
90
98
|
:'category' => :'String',
|
|
91
99
|
:'side' => :'String',
|
|
100
|
+
:'document_type' => :'String',
|
|
92
101
|
:'issuing_country' => :'String',
|
|
93
102
|
:'id' => :'String',
|
|
94
103
|
:'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
|
|
@@ -110,6 +119,10 @@ module TransferZero
|
|
|
110
119
|
h[k.to_sym] = v
|
|
111
120
|
}
|
|
112
121
|
|
|
122
|
+
if attributes.key?(:'sender_id')
|
|
123
|
+
self.sender_id = attributes[:'sender_id']
|
|
124
|
+
end
|
|
125
|
+
|
|
113
126
|
if attributes.key?(:'upload')
|
|
114
127
|
self.upload = attributes[:'upload']
|
|
115
128
|
end
|
|
@@ -138,6 +151,10 @@ module TransferZero
|
|
|
138
151
|
self.side = attributes[:'side']
|
|
139
152
|
end
|
|
140
153
|
|
|
154
|
+
if attributes.key?(:'document_type')
|
|
155
|
+
self.document_type = attributes[:'document_type']
|
|
156
|
+
end
|
|
157
|
+
|
|
141
158
|
if attributes.key?(:'issuing_country')
|
|
142
159
|
self.issuing_country = attributes[:'issuing_country']
|
|
143
160
|
end
|
|
@@ -193,6 +210,7 @@ module TransferZero
|
|
|
193
210
|
def ==(o)
|
|
194
211
|
return true if self.equal?(o)
|
|
195
212
|
self.class == o.class &&
|
|
213
|
+
sender_id == o.sender_id &&
|
|
196
214
|
upload == o.upload &&
|
|
197
215
|
upload_file_name == o.upload_file_name &&
|
|
198
216
|
metadata == o.metadata &&
|
|
@@ -200,6 +218,7 @@ module TransferZero
|
|
|
200
218
|
upload_file_size == o.upload_file_size &&
|
|
201
219
|
category == o.category &&
|
|
202
220
|
side == o.side &&
|
|
221
|
+
document_type == o.document_type &&
|
|
203
222
|
issuing_country == o.issuing_country &&
|
|
204
223
|
id == o.id &&
|
|
205
224
|
errors == o.errors
|
|
@@ -214,7 +233,7 @@ module TransferZero
|
|
|
214
233
|
# Calculates hash code according to all attributes.
|
|
215
234
|
# @return [Integer] Hash code
|
|
216
235
|
def hash
|
|
217
|
-
[upload, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, issuing_country, id, errors].hash
|
|
236
|
+
[sender_id, upload, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, document_type, issuing_country, id, errors].hash
|
|
218
237
|
end
|
|
219
238
|
|
|
220
239
|
require 'active_support/core_ext/hash'
|