iyzi 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: fd13521b57d2d962340bb49d6b30e222fd59879e
4
- data.tar.gz: 25acdd5ef6ff9352bf73e8c49f87c9d0820e4f06
3
+ metadata.gz: 47aa48b209a4d375ae07f367e7604e1533ecd1cf
4
+ data.tar.gz: 45cdcb29aee854fe0acac23c1b2a92118cdd7b7e
5
5
  SHA512:
6
- metadata.gz: 59985179aabdeb626d74c732df0098c20d4f512dd9cc5d4d13e9c853f78e58c8805dc9e8ea9557e7b7a5ac254134cc3106cf40d18d966128a7a4160ca0518aa6
7
- data.tar.gz: 7edf2081356e0be99bbc488e9d037bedcc331fe5953be4f43df382d066df2bbd81fca7a80ff8a1607b69ad9a0103ab5704a5283c4694d2ef4d9d5f504da53ec6
6
+ metadata.gz: 421d6331bd482c3b16d1f2791ecfcb4273b5434622f3e94af545732a72b9ef867e36a121635c14067961c80208c6b271ba65e8301b1c8b8326c42fdeece36191
7
+ data.tar.gz: 51e97458e7a466b5c6656f25f58ab48e6e25350d837ea384d736cdffe6e927123c5f72f53731b57a8d5e690f2caa7df14274236abc577a123b25d611537fea5b
@@ -283,4 +283,53 @@ Iyzi.bin_control(params)
283
283
  # "bank_name" => "Garanti Bankası",
284
284
  # "bank_code" => 62
285
285
  #}
286
- ```
286
+ ```
287
+
288
+ ### Installment Info
289
+ ```ruby
290
+ params = {
291
+ locale: 'tr',
292
+ conversation_id: '123456',
293
+ binNumber: '552608',
294
+ price: 100
295
+ }
296
+ Iyzi.installment_info(params)
297
+ #=> {
298
+ # "bin_number" => "552608",
299
+ # "price" => 100,
300
+ # "card_type" => "CREDIT_CARD",
301
+ # "card_association" => "MASTER_CARD",
302
+ # "card_family_name" => "Axess",
303
+ # "force3ds" => 0,
304
+ # "bank_code" => 46,
305
+ # "bank_name" => "Akbank",
306
+ # "force_cvc" => 0,
307
+ # "installment_prices" => [
308
+ # [0] {
309
+ # "installment_price" => 100,
310
+ # "total_price" => 100,
311
+ # "installment_number" => 1
312
+ # },
313
+ # [1] {
314
+ # "installment_price" => 51.09,
315
+ # "total_price" => 102.17,
316
+ # "installment_number" => 2
317
+ # },
318
+ # [2] {
319
+ # "installment_price" => 34.46,
320
+ # "total_price" => 103.39,
321
+ # "installment_number" => 3
322
+ # },
323
+ # [3] {
324
+ # "installment_price" => 17.81,
325
+ # "total_price" => 106.89,
326
+ # "installment_number" => 6
327
+ # },
328
+ # [4] {
329
+ # "installment_price" => 12.32,
330
+ # "total_price" => 110.92,
331
+ # "installment_number" => 9
332
+ # }
333
+ # ]
334
+ # }
335
+ ```
@@ -20,6 +20,7 @@ require 'iyzi/pki_builders/payment_card'
20
20
  require 'iyzi/pki_builders/store_card'
21
21
  require 'iyzi/pki_builders/payment_auth'
22
22
  require 'iyzi/pki_builders/bin_control'
23
+ require 'iyzi/pki_builders/installment_info'
23
24
 
24
25
  # Requests
25
26
  require 'iyzi/request'
@@ -30,6 +31,7 @@ require 'iyzi/requests/sub_merchant'
30
31
  require 'iyzi/requests/card_storage'
31
32
  require 'iyzi/requests/payment_auth'
32
33
  require 'iyzi/requests/bin_control'
34
+ require 'iyzi/requests/installment_info'
33
35
 
34
36
  # Misc
35
37
  require 'active_support/all'
@@ -2,6 +2,7 @@ module Iyzi
2
2
  module Endpoints
3
3
  API_TEST = '/payment/test'.freeze
4
4
  BIN_CONTROL = '/payment/bin/check'.freeze
5
+ INSTALLMENT_INFO = '/payment/iyzipos/installment'.freeze
5
6
  CHECKOUT_FORM_INITIALIZE = '/payment/iyzipos/checkoutform/initialize/ecom'.freeze
6
7
  CHECKOUT_FORM_AUTH = '/payment/iyzipos/checkoutform/auth/ecom/detail'.freeze
7
8
  SUB_MERCHANT_CREATE = '/onboarding/submerchant'.freeze
@@ -0,0 +1,20 @@
1
+ module Iyzi
2
+ module PkiBuilders
3
+ class InstallmentInfo < PkiBuilder
4
+ ATTRIBUTES_ORDER = %w{
5
+ locale
6
+ conversationId
7
+ binNumber
8
+ price
9
+ }.freeze
10
+
11
+ TYPE_CAST = {
12
+ price: 'add_price'
13
+ }.freeze
14
+
15
+ def initialize(values = {})
16
+ super(values, ATTRIBUTES_ORDER, TYPE_CAST)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ module Iyzi
2
+ module Requests
3
+ class InstallmentInfo < Request
4
+ def initialize(options = {})
5
+ super(Endpoints::HTTP_POST, Endpoints::INSTALLMENT_INFO, options)
6
+ end
7
+
8
+ def to_pki
9
+ PkiBuilders::InstallmentInfo.new(iyzi_options).request_string
10
+ end
11
+ end
12
+ end
13
+ end
@@ -31,5 +31,9 @@ module Iyzi
31
31
  def bin_control(options, &block)
32
32
  Requests::BinControl.new(options).response(&block)
33
33
  end
34
+
35
+ def installment_info(options, &block)
36
+ Requests::InstallmentInfo.new(options).response(&block)
37
+ end
34
38
  end
35
39
  end
@@ -1,3 +1,3 @@
1
1
  module Iyzi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iyzi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Demirhan Aydin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -184,6 +184,7 @@ files:
184
184
  - lib/iyzi/pki_builders/card_storage.rb
185
185
  - lib/iyzi/pki_builders/checkout_form.rb
186
186
  - lib/iyzi/pki_builders/checkout_form_auth.rb
187
+ - lib/iyzi/pki_builders/installment_info.rb
187
188
  - lib/iyzi/pki_builders/payment_auth.rb
188
189
  - lib/iyzi/pki_builders/payment_card.rb
189
190
  - lib/iyzi/pki_builders/store_card.rb
@@ -194,6 +195,7 @@ files:
194
195
  - lib/iyzi/requests/card_storage.rb
195
196
  - lib/iyzi/requests/checkout_form.rb
196
197
  - lib/iyzi/requests/checkout_form_auth.rb
198
+ - lib/iyzi/requests/installment_info.rb
197
199
  - lib/iyzi/requests/payment_auth.rb
198
200
  - lib/iyzi/requests/sub_merchant.rb
199
201
  - lib/iyzi/resources.rb