moneta-api 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/lib/moneta/api/data_mapper.rb +9 -3
  4. data/lib/moneta/api/key_value_serializer.rb +16 -0
  5. data/lib/moneta/api/requests/create_bank_account_request.rb +28 -0
  6. data/lib/moneta/api/requests/create_profile_request.rb +29 -0
  7. data/lib/moneta/api/requests/edit_bank_account_request.rb +20 -0
  8. data/lib/moneta/api/requests/edit_profile_request.rb +25 -0
  9. data/lib/moneta/api/requests/profile/create_client_profile_request.rb +26 -0
  10. data/lib/moneta/api/requests/profile/create_organization_profile_request.rb +26 -0
  11. data/lib/moneta/api/requests/profile/edit_client_profile_request.rb +16 -0
  12. data/lib/moneta/api/requests/profile/edit_organization_profile_request.rb +16 -0
  13. data/lib/moneta/api/requests/refund_request.rb +1 -1
  14. data/lib/moneta/api/requests/verify_transaction_request.rb +1 -1
  15. data/lib/moneta/api/responses/authorise_transaction_batch_response.rb +1 -1
  16. data/lib/moneta/api/responses/cancel_transaction_batch_response.rb +1 -1
  17. data/lib/moneta/api/responses/confirm_transaction_batch_response.rb +1 -1
  18. data/lib/moneta/api/responses/create_bank_account_response.rb +13 -0
  19. data/lib/moneta/api/responses/create_profile_response.rb +18 -0
  20. data/lib/moneta/api/responses/edit_bank_account_response.rb +18 -0
  21. data/lib/moneta/api/responses/edit_profile_response.rb +18 -0
  22. data/lib/moneta/api/responses/find_account_by_alias_response.rb +1 -1
  23. data/lib/moneta/api/responses/find_account_by_id_response.rb +1 -1
  24. data/lib/moneta/api/responses/find_accounts_list_response.rb +1 -1
  25. data/lib/moneta/api/responses/get_operation_details_by_id_response.rb +1 -1
  26. data/lib/moneta/api/responses/invoice_batch_response.rb +1 -1
  27. data/lib/moneta/api/service_methods.rb +25 -0
  28. data/lib/moneta/api/types/account_info.rb +1 -1
  29. data/lib/moneta/api/types/bank_account_type.rb +62 -0
  30. data/lib/moneta/api/types/cancel_transaction_batch_response_type.rb +1 -1
  31. data/lib/moneta/api/types/hash_entity.rb +14 -0
  32. data/lib/moneta/api/types/key_value_entity.rb +13 -0
  33. data/lib/moneta/api/types/operation_info.rb +1 -1
  34. data/lib/moneta/api/types/operation_info_batch_response_type.rb +1 -1
  35. data/lib/moneta/api/types/operation_info_list.rb +1 -1
  36. data/lib/moneta/api/types/payment_request_type.rb +1 -1
  37. data/lib/moneta/api/types/profile/client.rb +69 -0
  38. data/lib/moneta/api/types/profile/organization.rb +252 -0
  39. data/lib/moneta/api/types/transaction_batch_response_type.rb +1 -1
  40. data/lib/moneta/api/types/transaction_request_type.rb +1 -1
  41. data/lib/moneta/api/types/verify_transfer_response_type.rb +1 -1
  42. data/lib/moneta/api/version.rb +1 -1
  43. data/lib/moneta/api.rb +18 -1
  44. data/moneta-api.gemspec +2 -2
  45. data/spec/lib/moneta/api/requests/create_bank_account_request_spec.rb +20 -0
  46. data/spec/lib/moneta/api/requests/edit_bank_account_request_spec.rb +23 -0
  47. data/spec/lib/moneta/api/requests/profile/create_client_profile_request_spec.rb +29 -0
  48. data/spec/lib/moneta/api/requests/profile/create_organization_profile_request_spec.rb +29 -0
  49. data/spec/lib/moneta/api/requests/profile/edit_client_profile_request_spec.rb +22 -0
  50. data/spec/lib/moneta/api/requests/profile/edit_organization_profile_request_spec.rb +22 -0
  51. data/spec/lib/moneta/api/types/profile/client_spec.rb +19 -0
  52. data/spec/spec_helper.rb +10 -0
  53. data/spec/support/matchers.rb +7 -1
  54. data/spec/vcr/moneta_api_requests_createbankaccountrequest/id_.yml +13707 -0
  55. data/spec/vcr/moneta_api_requests_editbankaccountrequest/success_.yml +13708 -0
  56. data/spec/vcr/moneta_api_requests_profile_createclientprofilerequest/response_.yml +13711 -0
  57. data/spec/vcr/moneta_api_requests_profile_createclientprofilerequest/response_profile_id_.yml +13707 -0
  58. data/spec/vcr/moneta_api_requests_profile_createorganizationprofilerequest/response_profile_id_.yml +13709 -0
  59. data/spec/vcr/moneta_api_requests_profile_editclientprofilerequest/_with_real_connection_true_.yml +13725 -0
  60. data/spec/vcr/moneta_api_requests_profile_editclientprofilerequest/success_.yml +13707 -0
  61. data/spec/vcr/moneta_api_requests_profile_editorganizationprofilerequest/success_.yml +13709 -0
  62. metadata +52 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1eba803ac44b2c7a38578bc70ca778f106f65a23
4
- data.tar.gz: ebd0399cc781f82bd4963b006f8b907f55610aba
3
+ metadata.gz: 6af4476441703fca93af4bf5f1e5d36459150144
4
+ data.tar.gz: e94ffe9d99272fcf29ae6df357af4999bad1c2f8
5
5
  SHA512:
6
- metadata.gz: 7a0094ba974d4a1fb42e27ff6761e0f9148be6afdf076597627e7be28baa8d27c81348b18c15dcc1443d337a249e8d33af96d2c3c92ebeb5789b07fb046a6e98
7
- data.tar.gz: 707b356c70f3f3995895f8f2d602681e0c89cadf73ff1915a9ccd0e702cf7fef5138706b82fb6c310191f3d050dd6358dc94f2f324e0a068b7f3742415c4a06b
6
+ metadata.gz: 537387b573b5f96846b2d1c1439de4620c8efc7a6866eadbaa715eaf666b585037803214001ed57f2b57135d15829ff78ad13d73d9c814d44ea5b31c5706a2f6
7
+ data.tar.gz: 700216e219143634cc3a67d078731c08bef9af092725cf4a803971d351e244d1291dffda5e7ce9e07da4ddd094009ed4f9ed9ae89b49cc383db80a7b3c96369c
data/.gitignore CHANGED
@@ -14,3 +14,5 @@
14
14
  mkmf.log
15
15
  .idea
16
16
  spec/support/moneta.yml
17
+ .ruby-version
18
+ .ruby-gemset
@@ -47,13 +47,14 @@ module Moneta
47
47
  end
48
48
 
49
49
  module ClassMethods
50
- def property(name, base_type=nil)
51
- attr_accessor(name)
50
+
51
+ def property(name, type: nil, read_only: false)
52
+ generate_accessors(name, read_only)
52
53
 
53
54
  # Сохраняем свойста и перезаписываем instance метод
54
55
  current_properties = instance_variable_get('@properties') || {}
55
56
  properties = instance_variable_set('@properties',
56
- current_properties.merge(name => base_type).merge(parents_properties)
57
+ current_properties.merge(parents_properties).merge(name => type)
57
58
  )
58
59
 
59
60
  send(:define_method, :properties) { properties }
@@ -74,6 +75,11 @@ module Moneta
74
75
  end
75
76
  )
76
77
  end
78
+
79
+ def generate_accessors(name, read_only)
80
+ attr_reader(name)
81
+ attr_writer(name) unless read_only
82
+ end
77
83
  end
78
84
  end
79
85
  end
@@ -0,0 +1,16 @@
1
+ module Moneta
2
+ module Api
3
+ class KeyValueSerializer
4
+ def self.serialize(entity)
5
+ attributes = entity.properties
6
+
7
+ attributes.collect do |property, _|
8
+ value = entity.public_send(property)
9
+ key = property.to_s.swapcase
10
+
11
+ { 'key' => key, 'value' => value } unless value.nil?
12
+ end.compact
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,28 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+
5
+ # Запрос на создание банковских реквизитов.
6
+ # Request for adding information about your bank account to your MONETA.RU profile.
7
+ class CreateBankAccountRequest
8
+ include Moneta::Api::DataMapper
9
+
10
+ # @return [Integer] ID банковских реквизитов.
11
+ # / Bank account ID.
12
+ property :id
13
+
14
+ # @return [Integer] Пользователь, которому будут принадлежать банковские реквизиты.
15
+ # / Если это поле не задано, то банковские реквизиты создаются для текущего пользователя.
16
+ # / The unique identifier of the user who will own the bank account.
17
+ # / If you omit this element, MONETA.RU uses the ID of the user who sends the request.
18
+ property :unit_id
19
+
20
+ property :profile_id
21
+
22
+ # @return [Moneta::Api::Types::BankAccountType] Расширенные атрибуты.
23
+ # / Specifies extended attributes.
24
+ property :attribute, type: Moneta::Api::Types::BankAccountType
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,29 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+ # Запрос на создание пользователя в системе МОНЕТА.РУ.
5
+ # Request for creating a MONETA.RU account.
6
+ class CreateProfileRequest
7
+ include Moneta::Api::DataMapper
8
+
9
+ # @return [Integer] ID родительского пользователя в системе МОНЕТА.РУ, к которому будет принадлежать создаваемый пользователь.
10
+ # / Если поле не задано, то пользователь будет принадлежать тому пользователю, от имени которого работает web service.
11
+ # / Unique identifier of the parent MONETA.RU account that will own the new account.
12
+ # / If you ommit this element, the new account will belong to the the user who sends this request.
13
+ property :unit_id
14
+
15
+ property :profile_id
16
+
17
+ # @return [String] Тип пользователя. Возможные значения: [client, organization]
18
+ # / Profile type. Valid values are: [client, organization]
19
+ property :profile_type
20
+
21
+ # @return [HashEntity] Данные создаваемого пользователя. Данные представлены в виде "ключ-значение".
22
+ # / Ключи данных зависят от типа пользователя (ProfileType).
23
+ # / User profile information in the list of key-value pairs.
24
+ # / The list of supported keys depends on ProfileType.
25
+ property :profile
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,20 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+
5
+ # Запрос на изменение банковских реквизитов.
6
+ # Request for editing information about your bank account in your MONETA.RU profile.
7
+ class EditBankAccountRequest
8
+ include Moneta::Api::DataMapper
9
+
10
+ # @return [Integer] ID банковских реквизитов.
11
+ # / Bank account ID.
12
+ property :id
13
+
14
+ # @return [Moneta::Api::Types::BankAccountType] Расширенные атрибуты.
15
+ # / Specifies extended attributes.
16
+ property :attribute, type: Moneta::Api::Types::BankAccountType
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,25 @@
1
+ class EditProfileRequest
2
+ end
3
+
4
+ module Moneta
5
+ module Api
6
+ module Requests
7
+ # Запрос на редактирование пользователя в системе МОНЕТА.РУ.
8
+ # Request for editing a MONETA.RU user profile.
9
+ class EditProfileRequest
10
+ include Moneta::Api::DataMapper
11
+
12
+ # @return [Integer] ID пользователя в системе МОНЕТА.РУ, данные которого надо отредактировать.
13
+ # The unique identifier of the MONETA.RU user that you want to edit.
14
+ property :unit_id
15
+
16
+ property :profile_id
17
+
18
+ # @return [HashEntity] Данные редактируемого пользователя. Данные представлены в виде "ключ-значение".
19
+ # / Ключи данных зависят от типа редактируемого пользователя (client или organization).
20
+ # / User profile information in the list of key-value pairs. The list of supported keys depends on ProfileType.
21
+ property :profile
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,26 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+ module Profile
5
+ # Запрос на создание пользователя с типом "клиент" в системе МОНЕТА.РУ.
6
+ # Request for creating a MONETA.RU client account.
7
+ class CreateClientProfileRequest < CreateProfileRequest
8
+
9
+ # @return [String] Тип пользователя. Возможные значения: [client, organization]
10
+ # / Profile type. Valid values are: [client, organization]
11
+ property :profile_type, read_only: true
12
+
13
+ # @return [Moneta::Api::Types::Profile::Client] Данные создаваемого пользователя. Данные представлены в виде "ключ-значение".
14
+ # / Ключи данных зависят от типа пользователя (ProfileType).
15
+ # / User profile information in the list of key-value pairs.
16
+ # / The list of supported keys depends on ProfileType.
17
+ property :profile, type: Moneta::Api::Types::Profile::Client
18
+
19
+ def initialize
20
+ @profile_type = 'client'
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+ module Profile
5
+ # Запрос на создание пользователя с типом "организация" в системе МОНЕТА.РУ.
6
+ # Request for creating a MONETA.RU organization account.
7
+ class CreateOrganizationProfileRequest < CreateProfileRequest
8
+
9
+ # @return [String] Тип пользователя. Возможные значения: [client, organization]
10
+ # / Profile type. Valid values are: [client, organization]
11
+ property :profile_type, read_only: true
12
+
13
+ # @return [Moneta::Api::Types::Profile::Organization] Данные создаваемого пользователя. Данные представлены в виде "ключ-значение".
14
+ # / Ключи данных зависят от типа пользователя (ProfileType).
15
+ # / User profile information in the list of key-value pairs.
16
+ # / The list of supported keys depends on ProfileType.
17
+ property :profile, type: Moneta::Api::Types::Profile::Organization
18
+
19
+ def initialize
20
+ @profile_type = 'organization'
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+ module Profile
5
+ # Запрос на редактирование пользователя с типом "клиент" в системе МОНЕТА.РУ.
6
+ # Request for editing a MONETA.RU client account.
7
+ class EditClientProfileRequest < EditProfileRequest
8
+
9
+ # @return [Moneta::Api::Types::Profile::Client] Данные редактируемого пользователя. Данные представлены в виде "ключ-значение".
10
+ # / User profile information in the list of key-value pairs.
11
+ property :profile, type: Moneta::Api::Types::Profile::Client
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Moneta
2
+ module Api
3
+ module Requests
4
+ module Profile
5
+ # Запрос на редактирование пользователя с типом "организация" в системе МОНЕТА.РУ.
6
+ # Request for editing a MONETA.RU organization account.
7
+ class EditOrganizationProfileRequest < EditProfileRequest
8
+
9
+ # @return [Moneta::Api::Types::Profile::Organization] Данные редактируемого пользователя. Данные представлены в виде "ключ-значение".
10
+ # / User profile information in the list of key-value pairs.
11
+ property :profile, type: Moneta::Api::Types::Profile::Organization
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -31,7 +31,7 @@ module Moneta
31
31
 
32
32
  # @return [Moneta::Api::Types::OperationInfo] Набор полей, которые необходимо сохранить в качестве атрибутов операции. Значения дат в формате dd.MM.yyyy HH:mm:ss
33
33
  # / Key-value pairs that will be saved as a transaction attributes. Use format dd.MM.yyyy HH:mm:ss for date values
34
- property :operation_info, Types::OperationInfo
34
+ property :operation_info, type: Types::OperationInfo
35
35
 
36
36
  # @return [String] Запрос для платежного пароля
37
37
  # / Payment password challenge
@@ -32,7 +32,7 @@ module Moneta
32
32
 
33
33
  # @return [Moneta::Api::Types::OperationInfo] Набор полей, которые необходимо использовать в качестве атрибутов операции. Значения дат в формате dd.MM.yyyy HH:mm:ss
34
34
  # / Key-value pairs that will be used as a transaction attributes. Use format dd.MM.yyyy HH:mm:ss for date values
35
- property :operation_info, Moneta::Api::Types::OperationInfo
35
+ property :operation_info, type: Moneta::Api::Types::OperationInfo
36
36
 
37
37
  # @return [String] Платежный пароль счета плательщика
38
38
  # / Payment password for payer account
@@ -10,7 +10,7 @@ module Moneta
10
10
  # @return [Array[Moneta::Api::Types::OperationInfoBatchResponseType]] Детали проведенных операций, либо описание ошибок, если операция не проведена.
11
11
  # Порядок соответствует набору операций, переданных в AuthoriseTransactionBatchRequest.
12
12
  # / Either transaction details or error description in order of appearance in corresponding request.
13
- property :transaction, Moneta::Api::Types::OperationInfoBatchResponseType
13
+ property :transaction, type: Moneta::Api::Types::OperationInfoBatchResponseType
14
14
  end
15
15
  end
16
16
  end
@@ -10,7 +10,7 @@ module Moneta
10
10
  # @return [Array[Moneta::Api::Types::CancelTransactionBatchResponseType]] Детали проведенных операций, либо описание ошибок, если операция не проведена.
11
11
  # Порядок соответствует набору операций, переданных в CancelTransactionBatchRequest.
12
12
  # / Either transaction details or error description in order of appearance in corresponding request.
13
- property :transaction, Types::CancelTransactionBatchResponseType
13
+ property :transaction, type: Types::CancelTransactionBatchResponseType
14
14
  end
15
15
  end
16
16
  end
@@ -10,7 +10,7 @@ module Moneta
10
10
  # @return [Moneta::Api::Types::OperationInfoBatchResponseType] Детали проведенных операций, либо описание ошибок, если операция не проведена.
11
11
  # Порядок соответствует набору операций, переданных в ConfirmTransactionBatchRequest.
12
12
  # / Either transaction details or error description in order of appearance in corresponding request.
13
- property :transaction, Types::OperationInfoBatchResponseType
13
+ property :transaction, type: Types::OperationInfoBatchResponseType
14
14
  end
15
15
  end
16
16
  end
@@ -0,0 +1,13 @@
1
+ module Moneta
2
+ module Api
3
+ module Responses
4
+ class CreateBankAccountResponse
5
+ include Moneta::Api::DataMapper
6
+
7
+ # @return [String] Идентификатор банковских реквизитов в системе МОНЕТА.РУ
8
+ # / Bank account id.
9
+ property :id
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ module Moneta
2
+ module Api
3
+ module Responses
4
+ class CreateProfileResponse
5
+ include Moneta::Api::DataMapper
6
+
7
+ # @return [String] Идентификатор профайла в системе МОНЕТА.РУ
8
+ # Profile id
9
+ property :profile_id
10
+
11
+ def fill(response)
12
+ @profile_id = response
13
+ self
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Moneta
2
+ module Api
3
+ module Responses
4
+ class EditBankAccountResponse
5
+ include Moneta::Api::DataMapper
6
+
7
+ # @return [Boolean] Статус операции, всегда true
8
+ # / Operation status. Always is true.
9
+ property :success, read_only: true
10
+
11
+ def fill(_)
12
+ @success = true
13
+ self
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Moneta
2
+ module Api
3
+ module Responses
4
+ class EditProfileResponse
5
+ include Moneta::Api::DataMapper
6
+
7
+ # @return [Boolean] Статус операции, всегда true
8
+ # / Operation status. Always is true.
9
+ property :success, read_only: true
10
+
11
+ def fill(_)
12
+ @success = true
13
+ self
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -9,7 +9,7 @@ module Moneta
9
9
  include Moneta::Api::DataMapper
10
10
 
11
11
  # @return [Moneta::Api::Types::AccountInfo]
12
- property :account, Moneta::Api::Types::AccountInfo
12
+ property :account, type: Moneta::Api::Types::AccountInfo
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Moneta
9
9
  include Moneta::Api::DataMapper
10
10
 
11
11
  # @return [Moneta::Api::Types::AccountInfo]
12
- property :account, Moneta::Api::Types::AccountInfo
12
+ property :account, type: Moneta::Api::Types::AccountInfo
13
13
  end
14
14
  end
15
15
  end
@@ -8,7 +8,7 @@ module Moneta
8
8
  include Moneta::Api::DataMapper
9
9
 
10
10
  # @return[Array[Moneta::Api::Types::AccountInfo]]
11
- property :account, Moneta::Api::Types::AccountInfo
11
+ property :account, type: Moneta::Api::Types::AccountInfo
12
12
  end
13
13
  end
14
14
  end
@@ -8,7 +8,7 @@ module Moneta
8
8
  include Moneta::Api::DataMapper
9
9
 
10
10
  # @return [Moneta::Api::Types::OperationInfo]
11
- property :operation, Types::OperationInfo
11
+ property :operation, type: Types::OperationInfo
12
12
  end
13
13
  end
14
14
  end
@@ -10,7 +10,7 @@ module Moneta
10
10
  # @return [Moneta::Api::Types::TransactionBatchResponseType] Детали проведенных операций, либо описание ошибок, если операция не проведена.
11
11
  # Порядок соответствует набору операций, переданных в InvoiceBatchRequest.
12
12
  # / Either transaction details or error description in order of appearance in corresponding request.
13
- property :transaction, Types::TransactionBatchResponseType
13
+ property :transaction, type: Types::TransactionBatchResponseType
14
14
  end
15
15
  end
16
16
  end
@@ -139,6 +139,30 @@ module Moneta
139
139
  call(__method__, request)
140
140
  end
141
141
 
142
+ # @param [Moneta::Api::Requests::CreateProfileRequest]
143
+ # @return [Moneta::Api::Responses::CreateProfileResponse]
144
+ def create_profile(request)
145
+ call(__method__, request)
146
+ end
147
+
148
+ # @param [Moneta::Api::Requests::EditProfileRequest]
149
+ # @return [Moneta::Api::Responses::EditProfileResponse]
150
+ def edit_profile(request)
151
+ call(__method__, request)
152
+ end
153
+
154
+ # @param [Moneta::Api::Requests::CreateBankAccountRequest]
155
+ # @return [Moneta::Api::Responses::CreateBankAccountResponse]
156
+ def create_bank_account(request)
157
+ call(__method__, request)
158
+ end
159
+
160
+ # @param [Moneta::Api::Requests::EditBankAccountRequest]
161
+ # @return [Moneta::Api::Responses::EditBankAccountResponse]
162
+ def edit_bank_account(request)
163
+ call(__method__, request)
164
+ end
165
+
142
166
  private
143
167
 
144
168
  def call(method, request)
@@ -147,6 +171,7 @@ module Moneta
147
171
  response = client.call(method, {
148
172
  message: request.respond_to?(:to_hash) ? request.to_hash : request
149
173
  })
174
+
150
175
  ResponseFactory.build(response)
151
176
  end
152
177
 
@@ -53,7 +53,7 @@ module Moneta
53
53
 
54
54
  # @return [AccountAccessInfo] Информация о доступе к счету. Информация отдается, если счет является делегированным. Необязательное поле.
55
55
  # / Account access information. Available if the account is delegated, otherwise omitted. Optional.
56
- property :account_access, Moneta::Api::Types::AccountAccessInfo
56
+ property :account_access, type: Moneta::Api::Types::AccountAccessInfo
57
57
 
58
58
  # @return [Integer] Счет-прототип с которого берутся свойства "по умолчанию". Необязательное поле.
59
59
  # / Prototype account for default properties values. Optional.
@@ -0,0 +1,62 @@
1
+ module Moneta
2
+ module Api
3
+ module Types
4
+
5
+ # Банковские реквизиты.
6
+ # Bank account.
7
+ class BankAccountType < KeyValueEntity
8
+ # @return [String] Банк.
9
+ # / Bank.
10
+ property :bank
11
+
12
+ # @return [String] БИК.
13
+ # / BIC.
14
+ property :bik
15
+
16
+ # @return [String] Расчетный счет.
17
+ # / Checking account.
18
+ property :account
19
+
20
+ # @return [String] Корреспондентский банк.
21
+ # / Corresponding bank.
22
+ property :corr_bank
23
+
24
+ # @return [String] Корреспондентский счет.
25
+ # / Corresponding account.
26
+ property :corr_account
27
+
28
+ # @return [String] Страна.
29
+ # / Country.
30
+ property :country
31
+
32
+ # @return [String] Регион/республика.
33
+ # / State or region.
34
+ property :state
35
+
36
+ # @return [String] Город.
37
+ # / City.
38
+ property :city
39
+
40
+ # @return [String] КБК.
41
+ # / Budgetary classification code.
42
+ property :kbk
43
+
44
+ # @return [String] Общероссийский классификатор территорий муниципальных образований.
45
+ # / Russian Classification of Territories of Municipal Formations.
46
+ property :oktmo
47
+
48
+ # @return [String] КПП.
49
+ # / Industrial Enterprises Classifier.
50
+ property :kpp
51
+
52
+ # @return [String] Наименование получателя
53
+ # / Beneficiary Customer-Name.
54
+ property :username
55
+
56
+ # @return [Boolean] Международные банковские реквизиты
57
+ # / International bank details.
58
+ property :is_international
59
+ end
60
+ end
61
+ end
62
+ end
@@ -16,7 +16,7 @@ module Moneta
16
16
  property :error
17
17
 
18
18
  # @return [Moneta::Api::Types::CancelTransactionResponseType]
19
- property :transaction, Moneta::Api::Types::CancelTransactionResponseType
19
+ property :transaction, type: Moneta::Api::Types::CancelTransactionResponseType
20
20
 
21
21
  # @return [String] Поле содержит код ошибки. Поле заполнено только тогда, когда есть описание ошибки в поле error.
22
22
  # Для получения этого поля в запросе необходимо выставлять атрибут version равный или больше VERSION_2.
@@ -0,0 +1,14 @@
1
+ module Moneta
2
+ module Api
3
+ module Types
4
+ class HashEntity
5
+ include Moneta::Api::DataMapper
6
+
7
+ def to_hash
8
+ attributes = Moneta::Api::KeyValueSerializer.serialize(self)
9
+ { 'attribute' => attributes } if attributes.any?
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module Moneta
2
+ module Api
3
+ module Types
4
+ class KeyValueEntity
5
+ include Moneta::Api::DataMapper
6
+
7
+ def to_hash
8
+ Moneta::Api::KeyValueSerializer.serialize(self)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -71,7 +71,7 @@ module Moneta
71
71
  # The transaction may contain several attributes with different keys.
72
72
  # The full attribute's key consists of prefix ("customfield:") and tag (32 characters).
73
73
  # For example, "customfield:name".
74
- property :attribute, Moneta::Api::Types::KeyValueAttribute
74
+ property :attribute, type: Moneta::Api::Types::KeyValueAttribute
75
75
 
76
76
  # @param [Moneta::Api::Types::KeyValueAttribute]
77
77
  # @return item
@@ -14,7 +14,7 @@ module Moneta
14
14
  property :error
15
15
 
16
16
  # @return [Moneta::Api::Types::OperationInfo]
17
- property :transaction, Moneta::Api::Types::OperationInfo
17
+ property :transaction, type: Moneta::Api::Types::OperationInfo
18
18
 
19
19
  # @return [String] Поле содержит код ошибки. Поле заполнено только тогда, когда есть описание ошибки в поле error.
20
20
  # Для получения этого поля в запросе необходимо выставлять атрибут version равный или больше VERSION_2.
@@ -34,7 +34,7 @@ module Moneta
34
34
 
35
35
  # @return [Array[MonetaOperationInfo]] Список операций
36
36
  # / Transaction list
37
- property :operation, Moneta::Api::Types::OperationInfo
37
+ property :operation, type: Moneta::Api::Types::OperationInfo
38
38
  end
39
39
  end
40
40
  end
@@ -47,7 +47,7 @@ module Moneta
47
47
 
48
48
  # @return [OperationInfo] Набор полей, которые необходимо сохранить в качестве атрибутов операции. Значения дат в формате dd.MM.yyyy HH:mm:ss
49
49
  # / Key-value pairs that will be saved as a transaction attributes. Use format dd.MM.yyyy HH:mm:ss for date values
50
- property :operation_info, Moneta::Api::Types::OperationInfo
50
+ property :operation_info, type: Moneta::Api::Types::OperationInfo
51
51
 
52
52
  # @return [String] Запрос для платежного пароля
53
53
  # / Payment password challenge