transferzero-sdk 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec7ad9295e642f964d1fd79f4dc572929b15e8a09611c5b3b427ca018c45cd38
4
- data.tar.gz: ce7e8272987b6b48cf9374784cfec071df90f71b2db7daccb1526d90179f46c2
3
+ metadata.gz: ce4d174d504a7f40b7ea78d1df4987c995bd7ea6de24575b869d83e80d86e472
4
+ data.tar.gz: 7cd4f75a922371b0f9482adacb232ca99e7f1bbbbd58fc04c98396ba89b40fff
5
5
  SHA512:
6
- metadata.gz: 20e6b03b1ed61397bed75c3a7de9a887fb3dc9a40a594c8ba22bad1a9c6728ac68abfb0e12eccb6b09089047a44e859b212a4dbf8e477d4ab33180cc4e7578a6
7
- data.tar.gz: 27a877b021b92d6e45eec0bb90ac34ed37a7bbae0a08d19d984108bd60163a6fc39ed1cff9daf524cb096af6789334e52717f4f6b0d743ebaba2633a943105cd
6
+ metadata.gz: b110e12f269a31bdc8e415281ba33bcda5305fed54b953d205837ad3394bd705638c62a59b2e46d1bf1953f2d5a9872e8d2d34a3fbb18d1a44d7e48d87d35f2e
7
+ data.tar.gz: 122534c37ebeb9816a95978c8ef8c5dd76ee11511ee608dd1d4aca72797bec91aefda7f08051b42245eb10132828a2f9428506f5fff5188378c8b6cadb1d28d6
data/README.md CHANGED
@@ -7,7 +7,7 @@ Reference documentation for the TransferZero API V1
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 1.0
10
- - Package version: 1.3.0
10
+ - Package version: 1.4.0
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
 
13
13
  For more information, please visit:
@@ -31,21 +31,21 @@ gem build transferzero-sdk.gemspec
31
31
  Then either install the gem locally:
32
32
 
33
33
  ```shell
34
- gem install ./transferzero-sdk-1.3.0.gem
34
+ gem install ./transferzero-sdk-1.4.0.gem
35
35
  ```
36
- (for development, run `gem install --dev ./transferzero-sdk-1.3.0.gem` to install the development dependencies)
36
+ (for development, run `gem install --dev ./transferzero-sdk-1.4.0.gem` to install the development dependencies)
37
37
 
38
38
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
39
39
 
40
40
  Finally add this to the Gemfile:
41
41
 
42
- gem 'transferzero-sdk', '~> 1.3.0'
42
+ gem 'transferzero-sdk', '~> 1.4.0'
43
43
 
44
44
  ### Install from Git
45
45
 
46
- If the Ruby gem is hosted at a git repository: https://github.com/transferzero/transferzero-ruby-sdk, then add the following in the Gemfile:
46
+ If the Ruby gem is hosted at a git repository: https://github.com/transferzero/transferzero-sdk-ruby, then add the following in the Gemfile:
47
47
 
48
- gem 'transferzero-sdk', :git => 'https://github.com/transferzero/transferzero-ruby-sdk.git'
48
+ gem 'transferzero-sdk', :git => 'https://github.com/transferzero/transferzero-sdk-ruby.git'
49
49
 
50
50
  ### Include the Ruby code directly
51
51
 
@@ -109,7 +109,7 @@ Class | Method | HTTP request | Description
109
109
  *TransferZero::AccountDebitsApi* | [**get_accounts_debit**](docs/AccountDebitsApi.md#get_accounts_debit) | **GET** /accounts/debits/{Account Debit ID} | Fetching an account debit
110
110
  *TransferZero::AccountDebitsApi* | [**get_accounts_debits**](docs/AccountDebitsApi.md#get_accounts_debits) | **GET** /accounts/debits | Listing Accounts debits
111
111
  *TransferZero::AccountDebitsApi* | [**post_accounts_debits**](docs/AccountDebitsApi.md#post_accounts_debits) | **POST** /accounts/debits | Creating an account debit
112
- *TransferZero::AccountValidationApi* | [**post_account_validations**](docs/AccountValidationApi.md#post_account_validations) | **POST** /account_validations | Validates the existence of a bank account
112
+ *TransferZero::AccountValidationApi* | [**post_account_validations**](docs/AccountValidationApi.md#post_account_validations) | **POST** /account_validations | Validates the existence of a bank account or a mobile phone number
113
113
  *TransferZero::AccountsApi* | [**get_account**](docs/AccountsApi.md#get_account) | **GET** /accounts/{Currency} | Fetches account balance for specified currrency
114
114
  *TransferZero::AccountsApi* | [**get_accounts**](docs/AccountsApi.md#get_accounts) | **GET** /accounts | Fetches account balances for all currencies
115
115
  *TransferZero::CurrencyInfoApi* | [**info_currencies**](docs/CurrencyInfoApi.md#info_currencies) | **GET** /info/currencies | Getting a list of possible requested currencies
@@ -136,6 +136,7 @@ Class | Method | HTTP request | Description
136
136
  *TransferZero::SendersApi* | [**patch_sender**](docs/SendersApi.md#patch_sender) | **PATCH** /senders/{Sender ID} | Updating a sender
137
137
  *TransferZero::SendersApi* | [**post_senders**](docs/SendersApi.md#post_senders) | **POST** /senders | Creating a sender
138
138
  *TransferZero::TransactionsApi* | [**calculate_transactions**](docs/TransactionsApi.md#calculate_transactions) | **POST** /transactions/calculate | Calculates transaction amounts for a transaction payload
139
+ *TransferZero::TransactionsApi* | [**create_and_fund_transaction**](docs/TransactionsApi.md#create_and_fund_transaction) | **POST** /transactions/create_and_fund | Creates a new transaction and funds it from account balance
139
140
  *TransferZero::TransactionsApi* | [**get_transaction**](docs/TransactionsApi.md#get_transaction) | **GET** /transactions/{Transaction ID} | Fetch a single transaction
140
141
  *TransferZero::TransactionsApi* | [**get_transactions**](docs/TransactionsApi.md#get_transactions) | **GET** /transactions | Get a list of transactions
141
142
  *TransferZero::TransactionsApi* | [**payin_transaction**](docs/TransactionsApi.md#payin_transaction) | **POST** /transactions/{Transaction ID}/payin | Creates a fake payin for transaction
@@ -204,6 +205,7 @@ Class | Method | HTTP request | Description
204
205
  - [TransferZero::PayoutMethodDetailsMADCash](docs/PayoutMethodDetailsMADCash.md)
205
206
  - [TransferZero::PayoutMethodDetailsMobile](docs/PayoutMethodDetailsMobile.md)
206
207
  - [TransferZero::PayoutMethodDetailsNGNBank](docs/PayoutMethodDetailsNGNBank.md)
208
+ - [TransferZero::PayoutMethodDetailsXOFBank](docs/PayoutMethodDetailsXOFBank.md)
207
209
  - [TransferZero::PayoutMethodDetailsXOFMobile](docs/PayoutMethodDetailsXOFMobile.md)
208
210
  - [TransferZero::PayoutMethodGenderEnum](docs/PayoutMethodGenderEnum.md)
209
211
  - [TransferZero::PayoutMethodIdentityCardTypeEnum](docs/PayoutMethodIdentityCardTypeEnum.md)
@@ -4,15 +4,15 @@ All URIs are relative to *https://api-sandbox.transferzero.com/v1*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
- [**post_account_validations**](AccountValidationApi.md#post_account_validations) | **POST** /account_validations | Validates the existence of a bank account
7
+ [**post_account_validations**](AccountValidationApi.md#post_account_validations) | **POST** /account_validations | Validates the existence of a bank account or a mobile phone number
8
8
 
9
9
 
10
10
  # **post_account_validations**
11
11
  > AccountValidationResponse post_account_validations(account_validation_request)
12
12
 
13
- Validates the existence of a bank account
13
+ Validates the existence of a bank account or a mobile phone number
14
14
 
15
- Validates the existence of a bank account and returns the associated customer name
15
+ Validates the existence of a bank account or mobile phone number and returns the associated customer name
16
16
 
17
17
  ### Example
18
18
  ```ruby
@@ -23,7 +23,7 @@ api_instance = TransferZero::AccountValidationApi.new
23
23
 
24
24
 
25
25
  begin
26
- #Validates the existence of a bank account
26
+ #Validates the existence of a bank account or a mobile phone number
27
27
  result = api_instance.post_account_validations(account_validation_request)
28
28
  p result
29
29
  rescue TransferZero::ApiError => e
@@ -4,11 +4,12 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **bank_account** | **String** | Account Number to query |
8
- **bank_code** | **String** | Bank Code to query - same codes are used as for creating the transactions |
9
- **country** | **String** | Country of account in 2-character alpha ISO 3166-2 country format (only NG is currently supported) |
7
+ **bank_account** | **String** | Account Number to query | [optional]
8
+ **bank_code** | **String** | Bank Code to query - same codes are used as for creating the transactions | [optional]
9
+ **phone_number** | **String** | Phone number to query | [optional]
10
+ **country** | **String** | Country of account in 2-character alpha ISO 3166-2 country format |
10
11
  **currency** | **String** | The currency the bank account is in |
11
- **method** | **String** | The method of the payment. Currently only bank is supported |
12
+ **method** | **String** | The method of the payment. Currently bank and mobile are supported |
12
13
 
13
14
  ## Code Sample
14
15
 
@@ -17,6 +18,7 @@ require 'TransferZero'
17
18
 
18
19
  instance = TransferZero::AccountValidationRequest.new(bank_account: null,
19
20
  bank_code: null,
21
+ phone_number: +233000000000,
20
22
  country: null,
21
23
  currency: null,
22
24
  method: null)
@@ -4,7 +4,7 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **type** | **String** | Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for Senegalese mobile money payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank transfers in GBP. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://github.com/transferzero/api-documentation/blob/master/additional-features.md#collections-from-senders) for more info on how to collect money into internal balance | [optional]
7
+ **type** | **String** | Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for Senegalese mobile money payments. - `XOF::Bank` - for Senegalese bank account payments. *** Currently in Beta phase *** - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank transfers in GBP. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://github.com/transferzero/api-documentation/blob/master/additional-features.md#collections-from-senders) for more info on how to collect money into internal balance | [optional]
8
8
  **details** | [**PayoutMethodDetails**](PayoutMethodDetails.md) | | [optional]
9
9
  **metadata** | [**Object**](.md) | Metadata of payout method. You can store any kind of information in this field. | [optional]
10
10
  **id** | **String** | | [optional]
@@ -8,11 +8,12 @@ Name | Type | Description | Notes
8
8
  **last_name** | **String** | |
9
9
  **bank_code** | **String** | |
10
10
  **bank_account** | **String** | |
11
- **bank_account_type** | [**PayoutMethodBankAccountTypeEnum**](PayoutMethodBankAccountTypeEnum.md) | |
11
+ **bank_account_type** | [**PayoutMethodBankAccountTypeEnum**](PayoutMethodBankAccountTypeEnum.md) | | [optional]
12
12
  **phone_number** | **String** | |
13
13
  **mobile_provider** | [**PayoutMethodMobileProviderEnum**](PayoutMethodMobileProviderEnum.md) | |
14
- **bank_name** | **String** | |
15
14
  **iban** | **String** | |
15
+ **bank_name** | **String** | |
16
+ **bank_country** | **String** | |
16
17
  **bic** | **String** | | [optional]
17
18
  **sender_identity_card_type** | [**PayoutMethodIdentityCardTypeEnum**](PayoutMethodIdentityCardTypeEnum.md) | |
18
19
  **sender_identity_card_id** | **String** | |
@@ -36,8 +37,9 @@ instance = TransferZero::PayoutMethodDetails.new(first_name: null,
36
37
  bank_account_type: null,
37
38
  phone_number: null,
38
39
  mobile_provider: null,
39
- bank_name: null,
40
40
  iban: null,
41
+ bank_name: null,
42
+ bank_country: null,
41
43
  bic: null,
42
44
  sender_identity_card_type: null,
43
45
  sender_identity_card_id: null,
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
8
8
  **last_name** | **String** | |
9
9
  **bank_code** | **String** | |
10
10
  **bank_account** | **String** | |
11
- **bank_account_type** | [**PayoutMethodBankAccountTypeEnum**](PayoutMethodBankAccountTypeEnum.md) | |
11
+ **bank_account_type** | [**PayoutMethodBankAccountTypeEnum**](PayoutMethodBankAccountTypeEnum.md) | | [optional]
12
12
 
13
13
  ## Code Sample
14
14
 
@@ -0,0 +1,25 @@
1
+ # TransferZero::PayoutMethodDetailsXOFBank
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **first_name** | **String** | |
8
+ **last_name** | **String** | |
9
+ **iban** | **String** | |
10
+ **bank_name** | **String** | |
11
+ **bank_country** | **String** | |
12
+
13
+ ## Code Sample
14
+
15
+ ```ruby
16
+ require 'TransferZero'
17
+
18
+ instance = TransferZero::PayoutMethodDetailsXOFBank.new(first_name: null,
19
+ last_name: null,
20
+ iban: null,
21
+ bank_name: null,
22
+ bank_country: null)
23
+ ```
24
+
25
+
@@ -17,7 +17,7 @@ Name | Type | Description | Notes
17
17
  **due_amount** | **Float** | The amount needed to be paid in for the transaction to get funded | [optional]
18
18
  **created_at** | **DateTime** | The time the transaction was created | [optional]
19
19
  **expires_at** | **DateTime** | The latest time when the transaction has to be funded, otherwise it will be cancelled | [optional]
20
- **external_id** | **String** | Optional ID that is supplied by partner linking it to the partner's own Sender ID. Note: if present we will validate whether the sent ID is a duplicate in our system or not. | [optional]
20
+ **external_id** | **String** | Optional ID that is supplied by partner linking it to the partner's own Transaction ID. Note: if present we will validate whether the sent ID is a duplicate in our system or not. | [optional]
21
21
  **id** | **String** | | [optional]
22
22
  **errors** | **Hash<String, Array<ValidationErrorDescription>>** | The fields that have some problems and don't pass validation | [optional]
23
23
 
@@ -5,6 +5,7 @@ All URIs are relative to *https://api-sandbox.transferzero.com/v1*
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
7
  [**calculate_transactions**](TransactionsApi.md#calculate_transactions) | **POST** /transactions/calculate | Calculates transaction amounts for a transaction payload
8
+ [**create_and_fund_transaction**](TransactionsApi.md#create_and_fund_transaction) | **POST** /transactions/create_and_fund | Creates a new transaction and funds it from account balance
8
9
  [**get_transaction**](TransactionsApi.md#get_transaction) | **GET** /transactions/{Transaction ID} | Fetch a single transaction
9
10
  [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /transactions | Get a list of transactions
10
11
  [**payin_transaction**](TransactionsApi.md#payin_transaction) | **POST** /transactions/{Transaction ID}/payin | Creates a fake payin for transaction
@@ -74,6 +75,67 @@ end
74
75
 
75
76
 
76
77
 
78
+ # **create_and_fund_transaction**
79
+ > TransactionResponse create_and_fund_transaction(transaction_request)
80
+
81
+ Creates a new transaction and funds it from account balance
82
+
83
+ 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.
84
+
85
+ ### Example
86
+ ```ruby
87
+ # load the gem
88
+ require 'transferzero-sdk'
89
+
90
+ api_instance = TransferZero::TransactionsApi.new
91
+
92
+
93
+ begin
94
+ #Creates a new transaction and funds it from account balance
95
+ result = api_instance.create_and_fund_transaction(transaction_request)
96
+ p result
97
+ rescue TransferZero::ApiError => e
98
+ if e.validation_error
99
+ puts "WARN: Validation error occured when calling the endpoint"
100
+ result = e.response_object("TransactionResponse")
101
+ p result
102
+ else
103
+ puts "Exception when calling TransactionsApi->create_and_fund_transaction: #{e}"
104
+ end
105
+ end
106
+ ```
107
+
108
+ ### Parameters
109
+
110
+ Name | Type | Description | Notes
111
+ ------------- | ------------- | ------------- | -------------
112
+ **transaction_request** | [**TransactionRequest**](TransactionRequest.md)| |
113
+
114
+ ### Return type
115
+
116
+ [**TransactionResponse**](TransactionResponse.md)
117
+
118
+ ### Authorization
119
+
120
+ You can set the API Key and Secret on the TransferZero object when setting it up:
121
+
122
+ ```ruby
123
+
124
+ TransferZero.configure do |config|
125
+ config.api_key = '<key'
126
+ config.api_secret = '<secret>'
127
+ config.host = 'https://api-sandbox.transferzero.com/v1'
128
+ end
129
+
130
+ ```
131
+
132
+ ### HTTP request headers
133
+
134
+ - **Content-Type**: application/json
135
+ - **Accept**: application/json
136
+
137
+
138
+
77
139
  # **get_transaction**
78
140
  > TransactionResponse get_transaction(transaction_id)
79
141
 
@@ -153,6 +215,7 @@ opts = {
153
215
  page: 1 # Integer | The page number to request (defaults to 1)
154
216
  per: 10 # Integer | The number of results to load per page (defaults to 10)
155
217
  external_id: 'external_id_example' # String | Allows filtering results by `external_id`. Example: `/v1/senders?external_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`
218
+ sender_id: 'sender_id_example' # String | Allows filtering results by `sender_id`. Example: `/v1/transactions?sender_id=b41d3cb7-6c54-4245-85fc-8e30690eb0f7`
156
219
  }
157
220
 
158
221
  begin
@@ -177,6 +240,7 @@ Name | Type | Description | Notes
177
240
  **page** | **Integer**| The page number to request (defaults to 1) | [optional]
178
241
  **per** | **Integer**| The number of results to load per page (defaults to 10) | [optional]
179
242
  **external_id** | **String**| Allows filtering results by &#x60;external_id&#x60;. Example: &#x60;/v1/senders?external_id&#x3D;26ec8517-2f0d-48c0-b74f-0bccb9ab3a87&#x60; | [optional]
243
+ **sender_id** | **String**| Allows filtering results by &#x60;sender_id&#x60;. Example: &#x60;/v1/transactions?sender_id&#x3D;b41d3cb7-6c54-4245-85fc-8e30690eb0f7&#x60; | [optional]
180
244
 
181
245
  ### Return type
182
246
 
@@ -16,7 +16,7 @@ if [ "$git_user_id" = "" ]; then
16
16
  fi
17
17
 
18
18
  if [ "$git_repo_id" = "" ]; then
19
- git_repo_id="transferzero-ruby-sdk"
19
+ git_repo_id="transferzero-sdk-ruby"
20
20
  echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
21
  fi
22
22
 
@@ -70,6 +70,7 @@ require 'transferzero-sdk/models/payout_method_details_iban'
70
70
  require 'transferzero-sdk/models/payout_method_details_mad_cash'
71
71
  require 'transferzero-sdk/models/payout_method_details_mobile'
72
72
  require 'transferzero-sdk/models/payout_method_details_ngn_bank'
73
+ require 'transferzero-sdk/models/payout_method_details_xof_bank'
73
74
  require 'transferzero-sdk/models/payout_method_details_xof_mobile'
74
75
  require 'transferzero-sdk/models/payout_method_gender_enum'
75
76
  require 'transferzero-sdk/models/payout_method_identity_card_type_enum'
@@ -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
@@ -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 &lt;pre&gt;external_id&lt;/pre&gt; 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: &#x60;/v1/transactions/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
@@ -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 &#x60;external_id&#x60;. Example: &#x60;/v1/senders?external_id&#x3D;26ec8517-2f0d-48c0-b74f-0bccb9ab3a87&#x60;
206
+ # @option opts [String] :sender_id Allows filtering results by &#x60;sender_id&#x60;. Example: &#x60;/v1/transactions?sender_id&#x3D;b41d3cb7-6c54-4245-85fc-8e30690eb0f7&#x60;
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 &#x60;external_id&#x60;. Example: &#x60;/v1/senders?external_id&#x3D;26ec8517-2f0d-48c0-b74f-0bccb9ab3a87&#x60;
219
+ # @option opts [String] :sender_id Allows filtering results by &#x60;sender_id&#x60;. Example: &#x60;/v1/transactions?sender_id&#x3D;b41d3cb7-6c54-4245-85fc-8e30690eb0f7&#x60;
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.3.0"
38
+ @user_agent = "TransferZero-SDK/Ruby/1.4.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
- # Country of account in 2-character alpha ISO 3166-2 country format (only NG is currently supported)
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 only bank is supported
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'
@@ -15,7 +15,7 @@ require 'date'
15
15
  module TransferZero
16
16
  # This describes the specific details on how the payment has to be routed to the recipient.
17
17
  class PayoutMethod
18
- # Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for Senegalese mobile money payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank transfers in GBP. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://github.com/transferzero/api-documentation/blob/master/additional-features.md#collections-from-senders) for more info on how to collect money into internal balance
18
+ # Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for Senegalese mobile money payments. - `XOF::Bank` - for Senegalese bank account payments. *** Currently in Beta phase *** - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank transfers in GBP. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://github.com/transferzero/api-documentation/blob/master/additional-features.md#collections-from-senders) for more info on how to collect money into internal balance
19
19
  attr_accessor :type
20
20
 
21
21
  attr_accessor :details
@@ -28,9 +28,11 @@ module TransferZero
28
28
 
29
29
  attr_accessor :mobile_provider
30
30
 
31
+ attr_accessor :iban
32
+
31
33
  attr_accessor :bank_name
32
34
 
33
- attr_accessor :iban
35
+ attr_accessor :bank_country
34
36
 
35
37
  attr_accessor :bic
36
38
 
@@ -62,8 +64,9 @@ module TransferZero
62
64
  :'bank_account_type' => :'bank_account_type',
63
65
  :'phone_number' => :'phone_number',
64
66
  :'mobile_provider' => :'mobile_provider',
65
- :'bank_name' => :'bank_name',
66
67
  :'iban' => :'iban',
68
+ :'bank_name' => :'bank_name',
69
+ :'bank_country' => :'bank_country',
67
70
  :'bic' => :'bic',
68
71
  :'sender_identity_card_type' => :'sender_identity_card_type',
69
72
  :'sender_identity_card_id' => :'sender_identity_card_id',
@@ -87,8 +90,9 @@ module TransferZero
87
90
  :'bank_account_type' => :'PayoutMethodBankAccountTypeEnum',
88
91
  :'phone_number' => :'String',
89
92
  :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
90
- :'bank_name' => :'String',
91
93
  :'iban' => :'String',
94
+ :'bank_name' => :'String',
95
+ :'bank_country' => :'String',
92
96
  :'bic' => :'String',
93
97
  :'sender_identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
94
98
  :'sender_identity_card_id' => :'String',
@@ -111,6 +115,7 @@ module TransferZero
111
115
  :'PayoutMethodDetailsMADCash',
112
116
  :'PayoutMethodDetailsMobile',
113
117
  :'PayoutMethodDetailsNGNBank',
118
+ :'PayoutMethodDetailsXOFBank',
114
119
  :'PayoutMethodDetailsXOFMobile'
115
120
  ]
116
121
  end
@@ -158,12 +163,16 @@ module TransferZero
158
163
  self.mobile_provider = attributes[:'mobile_provider']
159
164
  end
160
165
 
166
+ if attributes.key?(:'iban')
167
+ self.iban = attributes[:'iban']
168
+ end
169
+
161
170
  if attributes.key?(:'bank_name')
162
171
  self.bank_name = attributes[:'bank_name']
163
172
  end
164
173
 
165
- if attributes.key?(:'iban')
166
- self.iban = attributes[:'iban']
174
+ if attributes.key?(:'bank_country')
175
+ self.bank_country = attributes[:'bank_country']
167
176
  end
168
177
 
169
178
  if attributes.key?(:'bic')
@@ -227,10 +236,6 @@ module TransferZero
227
236
  invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
228
237
  end
229
238
 
230
- if @bank_account_type.nil?
231
- invalid_properties.push('invalid value for "bank_account_type", bank_account_type cannot be nil.')
232
- end
233
-
234
239
  if @phone_number.nil?
235
240
  invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
236
241
  end
@@ -239,12 +244,16 @@ module TransferZero
239
244
  invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
240
245
  end
241
246
 
247
+ if @iban.nil?
248
+ invalid_properties.push('invalid value for "iban", iban cannot be nil.')
249
+ end
250
+
242
251
  if @bank_name.nil?
243
252
  invalid_properties.push('invalid value for "bank_name", bank_name cannot be nil.')
244
253
  end
245
254
 
246
- if @iban.nil?
247
- invalid_properties.push('invalid value for "iban", iban cannot be nil.')
255
+ if @bank_country.nil?
256
+ invalid_properties.push('invalid value for "bank_country", bank_country cannot be nil.')
248
257
  end
249
258
 
250
259
  if @sender_identity_card_type.nil?
@@ -277,11 +286,11 @@ module TransferZero
277
286
  return false if @last_name.nil?
278
287
  return false if @bank_code.nil?
279
288
  return false if @bank_account.nil?
280
- return false if @bank_account_type.nil?
281
289
  return false if @phone_number.nil?
282
290
  return false if @mobile_provider.nil?
283
- return false if @bank_name.nil?
284
291
  return false if @iban.nil?
292
+ return false if @bank_name.nil?
293
+ return false if @bank_country.nil?
285
294
  return false if @sender_identity_card_type.nil?
286
295
  return false if @sender_identity_card_id.nil?
287
296
  return false if @sender_city_of_birth.nil?
@@ -318,8 +327,9 @@ module TransferZero
318
327
  bank_account_type == o.bank_account_type &&
319
328
  phone_number == o.phone_number &&
320
329
  mobile_provider == o.mobile_provider &&
321
- bank_name == o.bank_name &&
322
330
  iban == o.iban &&
331
+ bank_name == o.bank_name &&
332
+ bank_country == o.bank_country &&
323
333
  bic == o.bic &&
324
334
  sender_identity_card_type == o.sender_identity_card_type &&
325
335
  sender_identity_card_id == o.sender_identity_card_id &&
@@ -341,7 +351,7 @@ module TransferZero
341
351
  # Calculates hash code according to all attributes.
342
352
  # @return [Integer] Hash code
343
353
  def hash
344
- [first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, bank_name, iban, bic, sender_identity_card_type, sender_identity_card_id, sender_city_of_birth, sender_country_of_birth, sender_gender, reason, identity_card_type, identity_card_id, reference].hash
354
+ [first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, iban, bank_name, bank_country, bic, sender_identity_card_type, sender_identity_card_id, sender_city_of_birth, sender_country_of_birth, sender_gender, reason, identity_card_type, identity_card_id, reference].hash
345
355
  end
346
356
 
347
357
  require 'active_support/core_ext/hash'
@@ -103,10 +103,6 @@ module TransferZero
103
103
  invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
104
104
  end
105
105
 
106
- if @bank_account_type.nil?
107
- invalid_properties.push('invalid value for "bank_account_type", bank_account_type cannot be nil.')
108
- end
109
-
110
106
  invalid_properties
111
107
  end
112
108
 
@@ -117,7 +113,6 @@ module TransferZero
117
113
  return false if @last_name.nil?
118
114
  return false if @bank_code.nil?
119
115
  return false if @bank_account.nil?
120
- return false if @bank_account_type.nil?
121
116
  true
122
117
  end
123
118
 
@@ -0,0 +1,263 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ # ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"iban\": \"SN08SN0000000000000000000000\", \"bank_name\": \"BRM\", \"bank_country\": \"SN\" # ISO country code for Senegal } ``` *** Currently in Beta phase ***
17
+ class PayoutMethodDetailsXOFBank
18
+ attr_accessor :first_name
19
+
20
+ attr_accessor :last_name
21
+
22
+ attr_accessor :iban
23
+
24
+ attr_accessor :bank_name
25
+
26
+ attr_accessor :bank_country
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'first_name' => :'first_name',
32
+ :'last_name' => :'last_name',
33
+ :'iban' => :'iban',
34
+ :'bank_name' => :'bank_name',
35
+ :'bank_country' => :'bank_country'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'first_name' => :'String',
43
+ :'last_name' => :'String',
44
+ :'iban' => :'String',
45
+ :'bank_name' => :'String',
46
+ :'bank_country' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsXOFBank` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsXOFBank`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'first_name')
66
+ self.first_name = attributes[:'first_name']
67
+ end
68
+
69
+ if attributes.key?(:'last_name')
70
+ self.last_name = attributes[:'last_name']
71
+ end
72
+
73
+ if attributes.key?(:'iban')
74
+ self.iban = attributes[:'iban']
75
+ end
76
+
77
+ if attributes.key?(:'bank_name')
78
+ self.bank_name = attributes[:'bank_name']
79
+ end
80
+
81
+ if attributes.key?(:'bank_country')
82
+ self.bank_country = attributes[:'bank_country']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @first_name.nil?
91
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
92
+ end
93
+
94
+ if @last_name.nil?
95
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
96
+ end
97
+
98
+ if @iban.nil?
99
+ invalid_properties.push('invalid value for "iban", iban cannot be nil.')
100
+ end
101
+
102
+ if @bank_name.nil?
103
+ invalid_properties.push('invalid value for "bank_name", bank_name cannot be nil.')
104
+ end
105
+
106
+ if @bank_country.nil?
107
+ invalid_properties.push('invalid value for "bank_country", bank_country cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @first_name.nil?
117
+ return false if @last_name.nil?
118
+ return false if @iban.nil?
119
+ return false if @bank_name.nil?
120
+ return false if @bank_country.nil?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ first_name == o.first_name &&
130
+ last_name == o.last_name &&
131
+ iban == o.iban &&
132
+ bank_name == o.bank_name &&
133
+ bank_country == o.bank_country
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [first_name, last_name, iban, bank_name, bank_country].hash
146
+ end
147
+
148
+ require 'active_support/core_ext/hash'
149
+ require 'active_support/hash_with_indifferent_access.rb'
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ self.class.openapi_types.each_pair do |key, type|
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
161
+ end
162
+ elsif !attributes[self.class.attribute_map[key]].nil?
163
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+
167
+ self
168
+ end
169
+
170
+ # Deserializes the data based on type
171
+ # @param string type Data type
172
+ # @param string value Value to be deserialized
173
+ # @return [Object] Deserialized data
174
+ def _deserialize(type, value)
175
+ case type.to_sym
176
+ when :DateTime
177
+ DateTime.parse(value)
178
+ when :Date
179
+ Date.parse(value)
180
+ when :String
181
+ value.to_s
182
+ when :Integer
183
+ value.to_i
184
+ when :Float
185
+ value.to_f
186
+ when :Boolean
187
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ true
189
+ else
190
+ false
191
+ end
192
+ when :Object
193
+ # generic object (usually a Hash), return directly
194
+ value
195
+ when /\AArray<(?<inner_type>.+)>\z/
196
+ inner_type = Regexp.last_match[:inner_type]
197
+ value.map { |v| _deserialize(inner_type, v) }
198
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ k_type = Regexp.last_match[:k_type]
200
+ v_type = Regexp.last_match[:v_type]
201
+ {}.tap do |hash|
202
+ value.each do |k, v|
203
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
+ end
205
+ end
206
+ else # model
207
+ temp_model = TransferZero.const_get(type).new
208
+ temp_model.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ next if value.nil?
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
234
+ end
235
+
236
+ def [](key)
237
+ to_hash[key]
238
+ end
239
+
240
+ def dig(*args)
241
+ to_hash.dig(*args)
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+ end
@@ -51,7 +51,7 @@ module TransferZero
51
51
  # The latest time when the transaction has to be funded, otherwise it will be cancelled
52
52
  attr_accessor :expires_at
53
53
 
54
- # Optional ID that is supplied by partner linking it to the partner's own Sender ID. Note: if present we will validate whether the sent ID is a duplicate in our system or not.
54
+ # Optional ID that is supplied by partner linking it to the partner's own Transaction ID. Note: if present we will validate whether the sent ID is a duplicate in our system or not.
55
55
  attr_accessor :external_id
56
56
 
57
57
  attr_accessor :id
@@ -23,6 +23,7 @@ module TransferZero
23
23
  PAID = "paid".freeze
24
24
  CANCELED = "canceled".freeze
25
25
  REFUNDED = "refunded".freeze
26
+ PROCESSING = "processing".freeze
26
27
  EXCEPTION = "exception".freeze
27
28
 
28
29
  # Builds the enum from string
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.0.0-beta3
11
11
  =end
12
12
 
13
13
  module TransferZero
14
- VERSION = '1.3.0'
14
+ VERSION = '1.4.0'
15
15
  end
@@ -0,0 +1,65 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for TransferZero::PayoutMethodDetailsXOFBank
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'PayoutMethodDetailsXOFBank' do
21
+ before do
22
+ # run before each test
23
+ @instance = TransferZero::PayoutMethodDetailsXOFBank.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of PayoutMethodDetailsXOFBank' do
31
+ it 'should create an instance of PayoutMethodDetailsXOFBank' do
32
+ expect(@instance).to be_instance_of(TransferZero::PayoutMethodDetailsXOFBank)
33
+ end
34
+ end
35
+ describe 'test attribute "first_name"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "last_name"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "bank_account"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "bank_name"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "bank_country"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ end
@@ -28,8 +28,8 @@ Gem::Specification.new do |s|
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
30
30
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
- s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
- s.add_runtime_dependency 'activesupport', '~> 5'
31
+ s.add_runtime_dependency 'json', '>= 1.4'
32
+ s.add_runtime_dependency 'activesupport', '>= 4'
33
33
 
34
34
  s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
35
35
  s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transferzero-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TransferZero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -36,34 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 2.1.0
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: '2.1'
39
+ version: '1.4'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
44
  - - ">="
48
45
  - !ruby/object:Gem::Version
49
- version: 2.1.0
50
- - - "~>"
51
- - !ruby/object:Gem::Version
52
- version: '2.1'
46
+ version: '1.4'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: activesupport
55
49
  requirement: !ruby/object:Gem::Requirement
56
50
  requirements:
57
- - - "~>"
51
+ - - ">="
58
52
  - !ruby/object:Gem::Version
59
- version: '5'
53
+ version: '4'
60
54
  type: :runtime
61
55
  prerelease: false
62
56
  version_requirements: !ruby/object:Gem::Requirement
63
57
  requirements:
64
- - - "~>"
58
+ - - ">="
65
59
  - !ruby/object:Gem::Version
66
- version: '5'
60
+ version: '4'
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: rspec
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -212,7 +206,6 @@ extensions: []
212
206
  extra_rdoc_files: []
213
207
  files:
214
208
  - Gemfile
215
- - Gemfile.lock
216
209
  - LICENSE
217
210
  - README.md
218
211
  - Rakefile
@@ -277,6 +270,7 @@ files:
277
270
  - docs/PayoutMethodDetailsMADCash.md
278
271
  - docs/PayoutMethodDetailsMobile.md
279
272
  - docs/PayoutMethodDetailsNGNBank.md
273
+ - docs/PayoutMethodDetailsXOFBank.md
280
274
  - docs/PayoutMethodDetailsXOFMobile.md
281
275
  - docs/PayoutMethodGenderEnum.md
282
276
  - docs/PayoutMethodIdentityCardTypeEnum.md
@@ -402,6 +396,7 @@ files:
402
396
  - lib/transferzero-sdk/models/payout_method_details_mad_cash.rb
403
397
  - lib/transferzero-sdk/models/payout_method_details_mobile.rb
404
398
  - lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb
399
+ - lib/transferzero-sdk/models/payout_method_details_xof_bank.rb
405
400
  - lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb
406
401
  - lib/transferzero-sdk/models/payout_method_gender_enum.rb
407
402
  - lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb
@@ -518,6 +513,7 @@ files:
518
513
  - spec/models/payout_method_details_mobile_spec.rb
519
514
  - spec/models/payout_method_details_ngn_bank_spec.rb
520
515
  - spec/models/payout_method_details_spec.rb
516
+ - spec/models/payout_method_details_xof_bank_spec.rb
521
517
  - spec/models/payout_method_details_xof_mobile_spec.rb
522
518
  - spec/models/payout_method_gender_enum_spec.rb
523
519
  - spec/models/payout_method_identity_card_type_enum_spec.rb
@@ -588,7 +584,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
588
584
  - !ruby/object:Gem::Version
589
585
  version: '0'
590
586
  requirements: []
591
- rubygems_version: 3.0.4
587
+ rubygems_version: 3.0.3
592
588
  signing_key:
593
589
  specification_version: 4
594
590
  summary: TransferZero API Ruby Gem
@@ -654,6 +650,7 @@ test_files:
654
650
  - spec/models/validation_error_description_spec.rb
655
651
  - spec/models/payin_method_request_spec.rb
656
652
  - spec/models/transaction_webhook_spec.rb
653
+ - spec/models/payout_method_details_xof_bank_spec.rb
657
654
  - spec/models/webhook_log_metadata_spec.rb
658
655
  - spec/models/sender_webhook_all_of_spec.rb
659
656
  - spec/models/account_list_response_spec.rb
@@ -1,93 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- transferzero-sdk (1.2.0)
5
- activesupport (~> 5)
6
- json (~> 2.1, >= 2.1.0)
7
- typhoeus (~> 1.0, >= 1.0.1)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- ZenTest (4.11.2)
13
- activesupport (5.2.3)
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
15
- i18n (>= 0.7, < 2)
16
- minitest (~> 5.1)
17
- tzinfo (~> 1.1)
18
- addressable (2.6.0)
19
- public_suffix (>= 2.0.2, < 4.0)
20
- autotest (4.4.6)
21
- ZenTest (>= 4.4.1)
22
- autotest-fsevent (0.2.14)
23
- sys-uname
24
- autotest-growl (0.2.16)
25
- autotest-rails-pure (4.1.2)
26
- byebug (11.0.1)
27
- coderay (1.1.2)
28
- concurrent-ruby (1.1.5)
29
- crack (0.4.3)
30
- safe_yaml (~> 1.0.0)
31
- diff-lcs (1.3)
32
- ethon (0.12.0)
33
- ffi (>= 1.3.0)
34
- ffi (1.11.1)
35
- hashdiff (1.0.0)
36
- i18n (1.6.0)
37
- concurrent-ruby (~> 1.0)
38
- json (2.2.0)
39
- method_source (0.9.2)
40
- minitest (5.11.3)
41
- pry (0.12.2)
42
- coderay (~> 1.1.0)
43
- method_source (~> 0.9.0)
44
- pry-byebug (3.7.0)
45
- byebug (~> 11.0)
46
- pry (~> 0.10)
47
- public_suffix (3.1.1)
48
- rake (12.0.0)
49
- rspec (3.8.0)
50
- rspec-core (~> 3.8.0)
51
- rspec-expectations (~> 3.8.0)
52
- rspec-mocks (~> 3.8.0)
53
- rspec-core (3.8.2)
54
- rspec-support (~> 3.8.0)
55
- rspec-expectations (3.8.4)
56
- diff-lcs (>= 1.2.0, < 2.0)
57
- rspec-support (~> 3.8.0)
58
- rspec-mocks (3.8.1)
59
- diff-lcs (>= 1.2.0, < 2.0)
60
- rspec-support (~> 3.8.0)
61
- rspec-support (3.8.2)
62
- safe_yaml (1.0.5)
63
- sys-uname (1.0.4)
64
- ffi (>= 1.0.0)
65
- thread_safe (0.3.6)
66
- typhoeus (1.3.1)
67
- ethon (>= 0.9.0)
68
- tzinfo (1.2.5)
69
- thread_safe (~> 0.1)
70
- vcr (3.0.3)
71
- webmock (1.24.6)
72
- addressable (>= 2.3.6)
73
- crack (>= 0.3.2)
74
- hashdiff
75
-
76
- PLATFORMS
77
- ruby
78
-
79
- DEPENDENCIES
80
- ZenTest (~> 4.11, >= 4.11.2)
81
- autotest (~> 4.4, >= 4.4.6)
82
- autotest-fsevent (~> 0.2, >= 0.2.12)
83
- autotest-growl (~> 0.2, >= 0.2.16)
84
- autotest-rails-pure (~> 4.1, >= 4.1.2)
85
- pry-byebug
86
- rake (~> 12.0.0)
87
- rspec (~> 3.6, >= 3.6.0)
88
- transferzero-sdk!
89
- vcr (~> 3.0, >= 3.0.1)
90
- webmock (~> 1.24, >= 1.24.3)
91
-
92
- BUNDLED WITH
93
- 1.17.3