khipu-api-client 2.4.0 → 2.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccf2c78c3baddc3cd108baf441f76dea492627f3
4
- data.tar.gz: 1c17edfb7603c979850bedac212d5ada34c4bd99
3
+ metadata.gz: 7b92d4d7104566afc3175abf32b270702efc615c
4
+ data.tar.gz: 0ab3c8430b158ef9c99ce834755eef5b127b68c5
5
5
  SHA512:
6
- metadata.gz: 2928c9badcfd4ea1588c77ed9309a32da04d6fd4b52b347ec5f3834dcfe83ed45addffd7ca4848be47878b84cfbf1981b60bcf48f9b3fecaefabae0c3dc88587
7
- data.tar.gz: 6bafc4192db459db2b9d848f36a8b9fc11c8a6aa067cf736a5827c5049fb850ac6114f1c1f7f75f15fd371e5f2e04ef2d0a141fa6ab800df9cf34e38305f18ff
6
+ metadata.gz: 4ef301ef755234822ea341856d62967fbb3db2d39092082224a4b668c3865986ca9c44599b40a52063c03a008bc51ea568215796aa917c02a9522340b9090a70
7
+ data.tar.gz: b818dac96d15c21f2aaf5f083f77bc15597e80e165be7c238d3fcea819bb0bcfee7c99e5ef3893eff3a281b308695110bac0a459d01b62f9d1f08f480e92ab50
Binary file
@@ -6,8 +6,9 @@ require 'khipu-api-client/configuration'
6
6
 
7
7
  # Models
8
8
  require 'khipu-api-client/models/base_object'
9
- require 'khipu-api-client/models/payment_response'
10
- require 'khipu-api-client/models/create_response'
9
+ require 'khipu-api-client/models/payments_response'
10
+ require 'khipu-api-client/models/payments_create_response'
11
+ require 'khipu-api-client/models/receivers_create_response'
11
12
  require 'khipu-api-client/models/banks_response'
12
13
  require 'khipu-api-client/models/bank_item'
13
14
  require 'khipu-api-client/models/success_response'
@@ -19,6 +20,7 @@ require 'khipu-api-client/models/error_item'
19
20
  # APIs
20
21
  require 'khipu-api-client/api/banks_api'
21
22
  require 'khipu-api-client/api/payments_api'
23
+ require 'khipu-api-client/api/receivers_api'
22
24
 
23
25
  module Khipu
24
26
  class << self
@@ -12,7 +12,7 @@ module Khipu
12
12
  # Información completa del pago. Datos con los que fue creado y el estado actual del pago. Se obtiene del notification_token que envia khipu cuando el pago es conciliado.
13
13
  # @param notification_token Token de notifiación recibido usando la API de notificaiones 1.3 o superior.
14
14
  # @param [Hash] opts the optional parameters
15
- # @return [PaymentResponse]
15
+ # @return [PaymentsResponse]
16
16
  def payments_get(notification_token, opts = {})
17
17
  if Configuration.debugging
18
18
  Configuration.logger.debug "Calling API: PaymentsApi#payments_get ..."
@@ -53,7 +53,7 @@ module Khipu
53
53
  :form_params => form_params,
54
54
  :body => post_body,
55
55
  :auth_names => auth_names,
56
- :return_type => 'PaymentResponse')
56
+ :return_type => 'PaymentsResponse')
57
57
  if Configuration.debugging
58
58
  Configuration.logger.debug "API called: PaymentsApi#payments_get. Result: #{result.inspect}"
59
59
  end
@@ -83,7 +83,7 @@ module Khipu
83
83
  # @option opts [String] :responsible_user_email Correo electrónico del responsable de este cobro, debe corresponder a un usuario khipu con permisos para cobrar usando esta cuenta de cobro
84
84
  # @option opts [String] :fixed_payer_personal_identifier Identificador personal. Si se especifica, solo podrá ser pagado usando ese identificador
85
85
  # @option opts [Float] :integrator_fee Comisión para el integrador. Sólo es válido si la cuenta de cobro tiene una cuenta de integrador asociada
86
- # @return [CreateResponse]
86
+ # @return [PaymentsCreateResponse]
87
87
  def payments_post(subject, currency, amount, opts = {})
88
88
  if Configuration.debugging
89
89
  Configuration.logger.debug "Calling API: PaymentsApi#payments_post ..."
@@ -149,7 +149,7 @@ module Khipu
149
149
  :form_params => form_params,
150
150
  :body => post_body,
151
151
  :auth_names => auth_names,
152
- :return_type => 'CreateResponse')
152
+ :return_type => 'PaymentsCreateResponse')
153
153
  if Configuration.debugging
154
154
  Configuration.logger.debug "API called: PaymentsApi#payments_post. Result: #{result.inspect}"
155
155
  end
@@ -160,7 +160,7 @@ module Khipu
160
160
  # Información completa del pago. Datos con los que fue creado y el estado actual del pago.
161
161
  # @param id Identificador del pago
162
162
  # @param [Hash] opts the optional parameters
163
- # @return [PaymentResponse]
163
+ # @return [PaymentsResponse]
164
164
  def payments_id_get(id, opts = {})
165
165
  if Configuration.debugging
166
166
  Configuration.logger.debug "Calling API: PaymentsApi#payments_id_get ..."
@@ -200,7 +200,7 @@ module Khipu
200
200
  :form_params => form_params,
201
201
  :body => post_body,
202
202
  :auth_names => auth_names,
203
- :return_type => 'PaymentResponse')
203
+ :return_type => 'PaymentsResponse')
204
204
  if Configuration.debugging
205
205
  Configuration.logger.debug "API called: PaymentsApi#payments_id_get. Result: #{result.inspect}"
206
206
  end
@@ -0,0 +1,137 @@
1
+ require "uri"
2
+
3
+ module Khipu
4
+ class ReceiversApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = nil)
8
+ @api_client = api_client || Configuration.api_client
9
+ end
10
+
11
+ # Crear una nueva cuenta de cobro
12
+ # Crear una nueva cuenta de cobro asociada a un integrador. Necesita datos de la cuenta de usuario asociada, datos de facturación y datos de contacto.
13
+ # @param admin_first_name Nombre de pila del administrador de la cuenta de cobro a crear.
14
+ # @param admin_last_name Apellido del administrador de la cuenta de cobro a crear.
15
+ # @param admin_email Correo electrónico del administrador de la cuenta de cobro a crear.
16
+ # @param country_code Código alfanumérico de dos caractéres ISO 3166-1 del país de la cuenta de cobro a crear.
17
+ # @param business_identifier Identificador tributario del cobrador asociado a la cuenta de cobro a crear.
18
+ # @param business_category Categoría tributaria o rubro tributario del cobrador asociado a la cuenta de cobro a crear.
19
+ # @param business_name Nombre tributario del cobrador asociado a la cuenta de cobro a crear.
20
+ # @param business_phone Teléfono del cobrador asociado a la cuenta de cobro a crear.
21
+ # @param business_address_line_1 Dirección del cobrador de la cuenta de cobro a crear.
22
+ # @param business_address_line_2 Segunda línea de la dirección del cobrador de la cuenta de cobro a crear.
23
+ # @param business_address_line_3 Tercera línea de la dirección del cobrador de la cuenta de cobro a crear.
24
+ # @param contact_full_name Nombre del contacto del cobrador.
25
+ # @param contact_job_title Cargo del contacto del cobrador.
26
+ # @param contact_email Correo electrónico del contacto del cobrador.
27
+ # @param contact_phone Teléfono del contacto del cobrador.
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [ReceiversCreateResponse]
30
+ def receivers_post(admin_first_name, admin_last_name, admin_email, country_code, business_identifier, business_category, business_name, business_phone, business_address_line_1, business_address_line_2, business_address_line_3, contact_full_name, contact_job_title, contact_email, contact_phone, opts = {})
31
+ if Configuration.debugging
32
+ Configuration.logger.debug "Calling API: ReceiversApi#receivers_post ..."
33
+ end
34
+
35
+ # verify the required parameter 'admin_first_name' is set
36
+ fail "Missing the required parameter 'admin_first_name' when calling receivers_post" if admin_first_name.nil?
37
+
38
+ # verify the required parameter 'admin_last_name' is set
39
+ fail "Missing the required parameter 'admin_last_name' when calling receivers_post" if admin_last_name.nil?
40
+
41
+ # verify the required parameter 'admin_email' is set
42
+ fail "Missing the required parameter 'admin_email' when calling receivers_post" if admin_email.nil?
43
+
44
+ # verify the required parameter 'country_code' is set
45
+ fail "Missing the required parameter 'country_code' when calling receivers_post" if country_code.nil?
46
+
47
+ # verify the required parameter 'business_identifier' is set
48
+ fail "Missing the required parameter 'business_identifier' when calling receivers_post" if business_identifier.nil?
49
+
50
+ # verify the required parameter 'business_category' is set
51
+ fail "Missing the required parameter 'business_category' when calling receivers_post" if business_category.nil?
52
+
53
+ # verify the required parameter 'business_name' is set
54
+ fail "Missing the required parameter 'business_name' when calling receivers_post" if business_name.nil?
55
+
56
+ # verify the required parameter 'business_phone' is set
57
+ fail "Missing the required parameter 'business_phone' when calling receivers_post" if business_phone.nil?
58
+
59
+ # verify the required parameter 'business_address_line_1' is set
60
+ fail "Missing the required parameter 'business_address_line_1' when calling receivers_post" if business_address_line_1.nil?
61
+
62
+ # verify the required parameter 'business_address_line_2' is set
63
+ fail "Missing the required parameter 'business_address_line_2' when calling receivers_post" if business_address_line_2.nil?
64
+
65
+ # verify the required parameter 'business_address_line_3' is set
66
+ fail "Missing the required parameter 'business_address_line_3' when calling receivers_post" if business_address_line_3.nil?
67
+
68
+ # verify the required parameter 'contact_full_name' is set
69
+ fail "Missing the required parameter 'contact_full_name' when calling receivers_post" if contact_full_name.nil?
70
+
71
+ # verify the required parameter 'contact_job_title' is set
72
+ fail "Missing the required parameter 'contact_job_title' when calling receivers_post" if contact_job_title.nil?
73
+
74
+ # verify the required parameter 'contact_email' is set
75
+ fail "Missing the required parameter 'contact_email' when calling receivers_post" if contact_email.nil?
76
+
77
+ # verify the required parameter 'contact_phone' is set
78
+ fail "Missing the required parameter 'contact_phone' when calling receivers_post" if contact_phone.nil?
79
+
80
+ # resource path
81
+ path = "/receivers".sub('{format}','json')
82
+
83
+ # query parameters
84
+ query_params = {}
85
+
86
+ # header parameters
87
+ header_params = {}
88
+
89
+ # HTTP header 'Accept' (if needed)
90
+ _header_accept = ['application/json']
91
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
92
+
93
+ # HTTP header 'Content-Type'
94
+ _header_content_type = ['application/x-www-form-urlencoded']
95
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
96
+
97
+ # form parameters
98
+ form_params = {}
99
+ form_params["admin_first_name"] = admin_first_name
100
+ form_params["admin_last_name"] = admin_last_name
101
+ form_params["admin_email"] = admin_email
102
+ form_params["country_code"] = country_code
103
+ form_params["business_identifier"] = business_identifier
104
+ form_params["business_category"] = business_category
105
+ form_params["business_name"] = business_name
106
+ form_params["business_phone"] = business_phone
107
+ form_params["business_address_line_1"] = business_address_line_1
108
+ form_params["business_address_line_2"] = business_address_line_2
109
+ form_params["business_address_line_3"] = business_address_line_3
110
+ form_params["contact_full_name"] = contact_full_name
111
+ form_params["contact_job_title"] = contact_job_title
112
+ form_params["contact_email"] = contact_email
113
+ form_params["contact_phone"] = contact_phone
114
+
115
+ # http body (model)
116
+ post_body = nil
117
+
118
+
119
+ auth_names = ['khipu']
120
+ result = @api_client.call_api(:POST, path,
121
+ :header_params => header_params,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body,
125
+ :auth_names => auth_names,
126
+ :return_type => 'ReceiversCreateResponse')
127
+ if Configuration.debugging
128
+ Configuration.logger.debug "API called: ReceiversApi#receivers_post. Result: #{result.inspect}"
129
+ end
130
+ return result
131
+ end
132
+ end
133
+ end
134
+
135
+
136
+
137
+
@@ -1,6 +1,6 @@
1
1
  module Khipu
2
2
  #
3
- class CreateResponse < BaseObject
3
+ class PaymentsCreateResponse < BaseObject
4
4
  attr_accessor :payment_id, :payment_url, :simplified_transfer_url, :transfer_url, :app_url, :ready_for_terminal
5
5
  # attribute mapping from ruby-style variable name to JSON key
6
6
  def self.attribute_map
@@ -1,6 +1,6 @@
1
1
  module Khipu
2
2
  #
3
- class PaymentResponse < BaseObject
3
+ class PaymentsResponse < BaseObject
4
4
  attr_accessor :payment_id, :payment_url, :simplified_transfer_url, :transfer_url, :app_url, :ready_for_terminal, :notification_token, :receiver_id, :conciliation_date, :subject, :amount, :currency, :status, :status_detail, :body, :picture_url, :receipt_url, :return_url, :cancel_url, :notify_url, :notify_api_version, :expires_date, :attachment_urls, :bank, :bank_id, :payer_name, :payer_email, :personal_identifier, :bank_account_number, :out_of_date_conciliation, :transaction_id, :custom, :responsible_user_email, :send_reminders, :send_email
5
5
  # attribute mapping from ruby-style variable name to JSON key
6
6
  def self.attribute_map
@@ -0,0 +1,45 @@
1
+ module Khipu
2
+ #
3
+ class ReceiversCreateResponse < BaseObject
4
+ attr_accessor :receiver_id, :secret
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'receiver_id' => :'receiver_id',
11
+
12
+ #
13
+ :'secret' => :'secret'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'receiver_id' => :'String',
22
+ :'secret' => :'String'
23
+
24
+ }
25
+ end
26
+
27
+ def initialize(attributes = {})
28
+ return if !attributes.is_a?(Hash) || attributes.empty?
29
+
30
+ # convert string to symbol for hash key
31
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
32
+
33
+
34
+ if attributes[:'receiver_id']
35
+ self.receiver_id = attributes[:'receiver_id']
36
+ end
37
+
38
+ if attributes[:'secret']
39
+ self.secret = attributes[:'secret']
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Khipu
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: khipu-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - khipu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -199,12 +199,12 @@ extra_rdoc_files: []
199
199
  files:
200
200
  - LICENSE
201
201
  - README.md
202
- - khipu-api-client-2.2.0.gem
203
- - khipu-api-client-2.3.0.gem
202
+ - khipu-api-client-2.5.0.gem
204
203
  - khipu-api-client.gemspec
205
204
  - lib/khipu-api-client.rb
206
205
  - lib/khipu-api-client/api/banks_api.rb
207
206
  - lib/khipu-api-client/api/payments_api.rb
207
+ - lib/khipu-api-client/api/receivers_api.rb
208
208
  - lib/khipu-api-client/api_client.rb
209
209
  - lib/khipu-api-client/api_error.rb
210
210
  - lib/khipu-api-client/configuration.rb
@@ -212,9 +212,10 @@ files:
212
212
  - lib/khipu-api-client/models/bank_item.rb
213
213
  - lib/khipu-api-client/models/banks_response.rb
214
214
  - lib/khipu-api-client/models/base_object.rb
215
- - lib/khipu-api-client/models/create_response.rb
216
215
  - lib/khipu-api-client/models/error_item.rb
217
- - lib/khipu-api-client/models/payment_response.rb
216
+ - lib/khipu-api-client/models/payments_create_response.rb
217
+ - lib/khipu-api-client/models/payments_response.rb
218
+ - lib/khipu-api-client/models/receivers_create_response.rb
218
219
  - lib/khipu-api-client/models/service_error.rb
219
220
  - lib/khipu-api-client/models/success_response.rb
220
221
  - lib/khipu-api-client/models/validation_error.rb
Binary file
Binary file