Class: MfkOpenapiRubyClient::TransactionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mfk_openapi_ruby_client/api/transaction_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TransactionApi



19
20
21
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_transaction(transaction_id, opts = {}) ⇒ Transaction

取引の状態によってはキャンセルができない場合もあります。<a target="_blank" href="support.mfkessai.co.jp/hc/ja/articles/900002235166-%E5%8F%96%E5%BC%95%E3%81%AE%E3%82%AD%E3%83%A3%E3%83%B3%E3%82%BB%E3%83%AB">キャンセルについて</a>を参照してください。取引キャンセル



27
28
29
30
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 27

def cancel_transaction(transaction_id, opts = {})
  data, _status_code, _headers = cancel_transaction_with_http_info(transaction_id, opts)
  data
end

#cancel_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(Transaction, Integer, Hash)>

取引の状態によってはキャンセルができない場合もあります。&lt;a target&#x3D;&quot;_blank&quot; href&#x3D;&quot;support.mfkessai.co.jp/hc/ja/articles/900002235166-%E5%8F%96%E5%BC%95%E3%81%AE%E3%82%AD%E3%83%A3%E3%83%B3%E3%82%BB%E3%83%AB&quot;&gt;キャンセルについて&lt;/a&gt;を参照してください。取引キャンセル



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 37

def cancel_transaction_with_http_info(transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionApi.cancel_transaction ...'
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionApi.cancel_transaction"
  end
  # resource path
  local_var_path = '/transactions/{transaction_id}'.sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Transaction'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"TransactionApi.cancel_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionApi#cancel_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_transaction(payload, opts = {}) ⇒ Transaction

請求先を指定して取引を登録できます。最長で申請後2営業日以内に審査いたします。
Sandbox環境では動作テストのため、任意の審査結果を指定することができます。(#environment_magic_number)を参照してください。取引登録



90
91
92
93
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 90

def create_transaction(payload, opts = {})
  data, _status_code, _headers = create_transaction_with_http_info(payload, opts)
  data
end

#create_transaction_with_http_info(payload, opts = {}) ⇒ Array<(Transaction, Integer, Hash)>

請求先を指定して取引を登録できます。最長で申請後2営業日以内に審査いたします。&lt;br&gt; Sandbox環境では動作テストのため、任意の審査結果を指定することができます。(#environment_magic_number)を参照してください。取引登録



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 100

def create_transaction_with_http_info(payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionApi.create_transaction ...'
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling TransactionApi.create_transaction"
  end
  # resource path
  local_var_path = '/transactions'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(payload)

  # return_type
  return_type = opts[:debug_return_type] || 'Transaction'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"TransactionApi.create_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionApi#create_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transaction(transaction_id, opts = {}) ⇒ Transaction

取引取得



154
155
156
157
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 154

def get_transaction(transaction_id, opts = {})
  data, _status_code, _headers = get_transaction_with_http_info(transaction_id, opts)
  data
end

#get_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(Transaction, Integer, Hash)>

取引取得



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 163

def get_transaction_with_http_info(transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionApi.get_transaction ...'
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionApi.get_transaction"
  end
  # resource path
  local_var_path = '/transactions/{transaction_id}'.sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Transaction'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"TransactionApi.get_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions_list(opts = {}) ⇒ TransactionsList

取引一覧取得

Options Hash (opts):

  • :number (String)

    任意の取引の &#x60;number&#x60;を指定します。該当する取引がある場合、その一件のみが返却されます。

  • :customer_id (String)

    任意の顧客IDを指定します。指定した顧客に対する取引が返却されます。

  • :customer_number (String)

    顧客番号を指定します。指定された顧客の取引を取得します。

  • :billing_id (String)

    任意の請求IDを指定します。指定した請求に含まれる取引が返却されます。

  • :status (String)

    取引のステータスを指定します。未審査(&#x60;unexamined&#x60;)、審査通過(&#x60;passed&#x60;)、審査否決(&#x60;rejected&#x60;)、キャンセル済み(&#x60;canceled&#x60;)のいずれかを指定してください。

  • :billing (Boolean)

    請求対象であるかどうかを指定します。請求対象(&#x60;true&#x60;)、請求対象外(&#x60;false&#x60;)のいずれかを指定してください。 詳しくは(support.mfkessai.co.jp/hc/ja/articles/900002241626)を参照してください。

  • :date_from (Date)

    取引日が指定された日付以降の取引を取得します。指定された日付が取引日のものも含まれます。 RFC3339の&#x60;full-time&#x60;(2019-04-01)で指定してください。

  • :date_to (Date)

    取引日が指定された日付以前の取引を取得します。指定された日付が取引日のものも含まれます。 RFC3339の&#x60;full-time&#x60;(2019-04-01&#x60;)で指定してください。

  • :created_at_from (Time)

    指定された日時以降に作成された取引を取得します。指定された日時に作成されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :created_at_to (Time)

    指定された日時以前に作成された取引を取得します。指定された日時に作成されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :canceled_at_from (Time)

    指定された日時以降にキャンセルされた取引を取得します。指定された日時にキャンセルされたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :canceled_at_to (Time)

    指定された日時以前にキャンセルされた取引を取得します。指定された日時にキャンセルされたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :accepted_at_from (Time)

    指定された日時以降に債権譲受された取引を取得します。指定された日時に債権譲受されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :accepted_at_to (Time)

    指定された日時以前に債権譲受された取引を取得します。指定された日時に債権譲受されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :billing_accepted_at_from (Time)

    指定された日時以降に請求依頼を受領した取引を取得します。指定された日時に請求依頼を受領したものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :billing_accepted_at_to (Time)

    指定された日時以前に請求依頼を受領した取引を取得します。指定された日時に請求依頼を受領したものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :after (String)

    任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時&#x60;after&#x60;で指定したIDのリソースは結果に含まれません。

  • :before (String)

    任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時&#x60;before&#x60;で指定したIDのリソースは結果に含まれません。

  • :limit (Integer)

    取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。



233
234
235
236
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 233

def get_transactions_list(opts = {})
  data, _status_code, _headers = get_transactions_list_with_http_info(opts)
  data
end

#get_transactions_list_with_http_info(opts = {}) ⇒ Array<(TransactionsList, Integer, Hash)>

取引一覧取得

Options Hash (opts):

  • :number (String)

    任意の取引の &#x60;number&#x60;を指定します。該当する取引がある場合、その一件のみが返却されます。

  • :customer_id (String)

    任意の顧客IDを指定します。指定した顧客に対する取引が返却されます。

  • :customer_number (String)

    顧客番号を指定します。指定された顧客の取引を取得します。

  • :billing_id (String)

    任意の請求IDを指定します。指定した請求に含まれる取引が返却されます。

  • :status (String)

    取引のステータスを指定します。未審査(&#x60;unexamined&#x60;)、審査通過(&#x60;passed&#x60;)、審査否決(&#x60;rejected&#x60;)、キャンセル済み(&#x60;canceled&#x60;)のいずれかを指定してください。

  • :billing (Boolean)

    請求対象であるかどうかを指定します。請求対象(&#x60;true&#x60;)、請求対象外(&#x60;false&#x60;)のいずれかを指定してください。 詳しくは(support.mfkessai.co.jp/hc/ja/articles/900002241626)を参照してください。

  • :date_from (Date)

    取引日が指定された日付以降の取引を取得します。指定された日付が取引日のものも含まれます。 RFC3339の&#x60;full-time&#x60;(2019-04-01)で指定してください。

  • :date_to (Date)

    取引日が指定された日付以前の取引を取得します。指定された日付が取引日のものも含まれます。 RFC3339の&#x60;full-time&#x60;(2019-04-01&#x60;)で指定してください。

  • :created_at_from (Time)

    指定された日時以降に作成された取引を取得します。指定された日時に作成されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :created_at_to (Time)

    指定された日時以前に作成された取引を取得します。指定された日時に作成されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :canceled_at_from (Time)

    指定された日時以降にキャンセルされた取引を取得します。指定された日時にキャンセルされたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :canceled_at_to (Time)

    指定された日時以前にキャンセルされた取引を取得します。指定された日時にキャンセルされたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :accepted_at_from (Time)

    指定された日時以降に債権譲受された取引を取得します。指定された日時に債権譲受されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :accepted_at_to (Time)

    指定された日時以前に債権譲受された取引を取得します。指定された日時に債権譲受されたものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :billing_accepted_at_from (Time)

    指定された日時以降に請求依頼を受領した取引を取得します。指定された日時に請求依頼を受領したものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :billing_accepted_at_to (Time)

    指定された日時以前に請求依頼を受領した取引を取得します。指定された日時に請求依頼を受領したものも含まれます。 RFC3339の&#x60;date-time&#x60;(2019-04-01T10:36:43%2B09:00)で指定してください。

  • :after (String)

    任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時&#x60;after&#x60;で指定したIDのリソースは結果に含まれません。

  • :before (String)

    任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時&#x60;before&#x60;で指定したIDのリソースは結果に含まれません。

  • :limit (Integer)

    取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/mfk_openapi_ruby_client/api/transaction_api.rb', line 260

def get_transactions_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionApi.get_transactions_list ...'
  end
  if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'].to_s.length > 100
    fail ArgumentError, 'invalid value for "opts[:"number"]" when calling TransactionApi.get_transactions_list, the character length must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'customer_number'].nil? && opts[:'customer_number'].to_s.length > 100
    fail ArgumentError, 'invalid value for "opts[:"customer_number"]" when calling TransactionApi.get_transactions_list, the character length must be smaller than or equal to 100.'
  end

  allowable_values = ["unexamined", "passed", "rejected", "canceled"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionApi.get_transactions_list, must be smaller than or equal to 200.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionApi.get_transactions_list, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/transactions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?
  query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?
  query_params[:'customer_number'] = opts[:'customer_number'] if !opts[:'customer_number'].nil?
  query_params[:'billing_id'] = opts[:'billing_id'] if !opts[:'billing_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'billing'] = opts[:'billing'] if !opts[:'billing'].nil?
  query_params[:'date_from'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'date_to'] = opts[:'date_to'] if !opts[:'date_to'].nil?
  query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?
  query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?
  query_params[:'canceled_at_from'] = opts[:'canceled_at_from'] if !opts[:'canceled_at_from'].nil?
  query_params[:'canceled_at_to'] = opts[:'canceled_at_to'] if !opts[:'canceled_at_to'].nil?
  query_params[:'accepted_at_from'] = opts[:'accepted_at_from'] if !opts[:'accepted_at_from'].nil?
  query_params[:'accepted_at_to'] = opts[:'accepted_at_to'] if !opts[:'accepted_at_to'].nil?
  query_params[:'billing_accepted_at_from'] = opts[:'billing_accepted_at_from'] if !opts[:'billing_accepted_at_from'].nil?
  query_params[:'billing_accepted_at_to'] = opts[:'billing_accepted_at_to'] if !opts[:'billing_accepted_at_to'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TransactionsList'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"TransactionApi.get_transactions_list",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionApi#get_transactions_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end