iyzipay 1.0.34 → 1.0.35

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.
Files changed (44) hide show
  1. checksums.yaml +5 -13
  2. data/{LICENSE.txt → LICENSE} +0 -0
  3. data/README.md +64 -7
  4. data/VERSION +1 -1
  5. data/iyzipay.gemspec +1 -2
  6. data/lib/Iyzipay.rb +1 -2
  7. data/lib/iyzipay/http_client.rb +1 -1
  8. data/lib/iyzipay/iyzipay_resource.rb +1 -0
  9. data/lib/iyzipay/model.rb +8 -1
  10. data/lib/iyzipay/model/api_test.rb +10 -0
  11. data/lib/iyzipay/model/bkm_initialize.rb +1 -0
  12. data/lib/iyzipay/model/card.rb +36 -0
  13. data/lib/iyzipay/model/card_information.rb +17 -0
  14. data/lib/iyzipay/model/card_list.rb +17 -0
  15. data/lib/iyzipay/model/currency.rb +1 -0
  16. data/lib/iyzipay/model/locale.rb +8 -0
  17. data/lib/iyzipay/model/pecco_initialize.rb +27 -0
  18. data/lib/iyzipay/model/pecco_payment.rb +17 -0
  19. data/spec/{basic_payment_post_auth_spec.rb → api_test_spec.rb} +3 -11
  20. data/spec/approval_spec.rb +2 -17
  21. data/spec/bin_number_spec.rb +2 -2
  22. data/spec/bkm_spec.rb +19 -24
  23. data/spec/cancel_spec.rb +2 -2
  24. data/spec/card_storage_spec.rb +94 -0
  25. data/spec/checkout_form_spec.rb +20 -26
  26. data/spec/{payment_post_auth_spec.rb → disapproval_spec.rb} +5 -8
  27. data/spec/installment_spec.rb +5 -5
  28. data/spec/payment_spec.rb +54 -58
  29. data/spec/{checkout_form_pre_auth_spec.rb → pecco_spec.rb} +30 -18
  30. data/spec/refund_spec.rb +5 -23
  31. data/spec/retrieve_transactions_spec.rb +2 -2
  32. data/spec/spec_helper.rb +2 -2
  33. data/spec/sub_merchant_spec.rb +7 -8
  34. data/spec/threeds_payment_spec.rb +9 -9
  35. metadata +33 -34
  36. data/lib/iyzipay/version.rb +0 -3
  37. data/spec/basic_bkm_spec.rb +0 -261
  38. data/spec/basic_payment_pre_auth_spec.rb +0 -73
  39. data/spec/basic_payment_spec.rb +0 -73
  40. data/spec/basic_threeds_pre_auth_spec.rb +0 -103
  41. data/spec/basic_threeds_spec.rb +0 -103
  42. data/spec/cross_booking_spec.rb +0 -51
  43. data/spec/payment_pre_auth_spec.rb +0 -280
  44. data/spec/threeds_pre_auth_spec.rb +0 -226
@@ -10,7 +10,7 @@ RSpec.describe 'Iyzipay' do
10
10
  @options.base_url = 'https://sandbox-api.iyzipay.com'
11
11
  end
12
12
 
13
- it 'should initialize checkout form' do
13
+ it 'should initialize pecco' do
14
14
  buyer = {
15
15
  id: 'BY789',
16
16
  name: 'John',
@@ -40,9 +40,7 @@ RSpec.describe 'Iyzipay' do
40
40
  category1: 'Collectibles',
41
41
  category2: 'Accessories',
42
42
  itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
43
- price: '0.3',
44
- subMerchantKey: 'sub merchant key',
45
- subMerchantPrice: '0.27'
43
+ price: '30000'
46
44
  }
47
45
  item2 = {
48
46
  id: 'BI102',
@@ -50,9 +48,7 @@ RSpec.describe 'Iyzipay' do
50
48
  category1: 'Game',
51
49
  category2: 'Online Game Items',
52
50
  itemType: Iyzipay::Model::BasketItemType::VIRTUAL,
53
- price: '0.5',
54
- subMerchantKey: 'sub merchant key',
55
- subMerchantPrice: '0.42'
51
+ price: '50000'
56
52
  }
57
53
  item3 = {
58
54
  id: 'BI103',
@@ -60,28 +56,44 @@ RSpec.describe 'Iyzipay' do
60
56
  category1: 'Electronics',
61
57
  category2: 'Usb / Cable',
62
58
  itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
63
- price: '0.2',
64
- subMerchantKey: 'sub merchant key',
65
- subMerchantPrice: '0.18'
59
+ price: '20000'
66
60
  }
67
61
  request = {
68
- locale: 'tr',
62
+ locale: Iyzipay::Model::Locale::TR,
69
63
  conversationId: '123456789',
70
- price: '1.0',
71
- paidPrice: '1.0',
64
+ price: '100000',
65
+ paidPrice: '120000',
72
66
  basketId: 'B67832',
73
- paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
67
+ paymentGroup: Iyzipay::Model::PaymentGroup::LISTING,
74
68
  callbackUrl: 'https://www.merchant.com/callback',
75
- enabledInstallments: [2,3,6,9],
69
+ currency: Iyzipay::Model::Currency::IRR,
76
70
  buyer: buyer,
77
71
  billingAddress: address,
78
72
  shippingAddress: address,
79
73
  basketItems: [item1, item2, item3]
80
74
  }
81
- checkout_form_initialize = Iyzipay::Model::CheckoutFormInitializePreAuth.new.create(request, @options)
75
+ pecco_initialize = Iyzipay::Model::PeccoInitialize.new.create(request, @options)
76
+ begin
77
+ $stderr.puts pecco_initialize.inspect
78
+ threeds_initialize_dict = JSON.parse(pecco_initialize)
79
+ unless threeds_initialize_dict['htmlContent'].nil?
80
+ $stderr.puts Base64.decode64(threeds_initialize_dict['htmlContent']).inspect
81
+ end
82
+ rescue
83
+ $stderr.puts 'oops'
84
+ raise
85
+ end
86
+ end
82
87
 
88
+ it 'should create pecco payment' do
89
+ request = {
90
+ locale: Iyzipay::Model::Locale::TR,
91
+ conversationId: '123456789',
92
+ token: 'token'
93
+ }
94
+ pecco_payment = Iyzipay::Model::PeccoPayment.new.create(request, @options)
83
95
  begin
84
- $stderr.puts checkout_form_initialize.inspect
96
+ $stderr.puts pecco_payment.inspect
85
97
  rescue
86
98
  $stderr.puts 'oops'
87
99
  raise
@@ -90,4 +102,4 @@ RSpec.describe 'Iyzipay' do
90
102
 
91
103
  after :each do
92
104
  end
93
- end
105
+ end
data/spec/refund_spec.rb CHANGED
@@ -12,12 +12,12 @@ RSpec.describe 'Iyzipay' do
12
12
 
13
13
  it 'should refund payment' do
14
14
  request = {
15
- locale: 'tr',
15
+ locale: Iyzipay::Model::Locale::TR,
16
16
  conversationId: '123456789',
17
- paymentTransactionId: '702',
18
- price: '0.1',
19
- ip: '85.34.78.112',
20
- currency: Iyzipay::Model::Currency::TRY
17
+ paymentTransactionId: '1',
18
+ price: '0.5',
19
+ currency: Iyzipay::Model::Currency::TRY,
20
+ ip: '85.34.78.112'
21
21
  }
22
22
  refund = Iyzipay::Model::Refund.new.create(request, @options)
23
23
  begin
@@ -28,24 +28,6 @@ RSpec.describe 'Iyzipay' do
28
28
  end
29
29
  end
30
30
 
31
- it 'should refund payment charged from merchant' do
32
- request = {
33
- locale: 'tr',
34
- conversationId: '123456789',
35
- paymentTransactionId: '258',
36
- price: '0.1',
37
- ip: '85.34.78.112',
38
- currency: Iyzipay::Model::Currency::TRY
39
- }
40
- refund = Iyzipay::Model::RefundChargedFromMerchant.new.create(request, @options)
41
- begin
42
- $stderr.puts refund.inspect
43
- rescue
44
- $stderr.puts 'oops'
45
- raise
46
- end
47
- end
48
-
49
31
  after :each do
50
32
  end
51
33
  end
@@ -12,7 +12,7 @@ RSpec.describe 'Iyzipay' do
12
12
 
13
13
  it 'should retrieve payout completed transactions' do
14
14
  request = {
15
- locale: 'tr',
15
+ locale: Iyzipay::Model::Locale::TR,
16
16
  conversationId: '123456789',
17
17
  date: '2016-01-22 19:13:00'
18
18
  }
@@ -27,7 +27,7 @@ RSpec.describe 'Iyzipay' do
27
27
 
28
28
  it 'should retrieve bounced bank transfers' do
29
29
  request = {
30
- locale: 'tr',
30
+ locale: Iyzipay::Model::Locale::TR,
31
31
  conversationId: '123456789',
32
32
  date: '2016-01-22 19:13:00'
33
33
  }
data/spec/spec_helper.rb CHANGED
@@ -24,8 +24,8 @@ RSpec.configure do |config|
24
24
  mocks.verify_partial_doubles = true
25
25
  end
26
26
 
27
- # The settings below are suggested to provide a good initial experience
28
- # with RSpec, but feel free to customize to your heart's content.
27
+ # The settings below are suggested to provide a good initial experience
28
+ # with RSpec, but feel free to customize to your heart's content.
29
29
  =begin
30
30
  # These two settings work together to allow you to limit a spec run
31
31
  # to individual examples or groups you care about by tagging them with
@@ -12,7 +12,7 @@ RSpec.describe 'Iyzipay' do
12
12
 
13
13
  it 'should create personal sub merchant' do
14
14
  request = {
15
- locale: 'tr',
15
+ locale: Iyzipay::Model::Locale::TR,
16
16
  conversationId: '123456789',
17
17
  subMerchantExternalId: 'B49224',
18
18
  subMerchantType: Iyzipay::Model::SubMerchantType::PERSONAL,
@@ -37,7 +37,7 @@ RSpec.describe 'Iyzipay' do
37
37
 
38
38
  it 'should create private sub merchant' do
39
39
  request = {
40
- locale: 'tr',
40
+ locale: Iyzipay::Model::Locale::TR,
41
41
  conversationId: '123456789',
42
42
  subMerchantExternalId: 'S49222',
43
43
  subMerchantType: Iyzipay::Model::SubMerchantType::PRIVATE_COMPANY,
@@ -62,7 +62,7 @@ RSpec.describe 'Iyzipay' do
62
62
 
63
63
  it 'should create limited company sub merchant' do
64
64
  request = {
65
- locale: 'tr',
65
+ locale: Iyzipay::Model::Locale::TR,
66
66
  conversationId: '123456789',
67
67
  subMerchantExternalId: 'AS49224',
68
68
  subMerchantType: Iyzipay::Model::SubMerchantType::LIMITED_OR_JOINT_STOCK_COMPANY,
@@ -87,7 +87,7 @@ RSpec.describe 'Iyzipay' do
87
87
 
88
88
  it 'should update personal sub merchant' do
89
89
  request = {
90
- locale: 'tr',
90
+ locale: Iyzipay::Model::Locale::TR,
91
91
  conversationId: '123456789',
92
92
  subMerchantExternalId: 'B49224',
93
93
  subMerchantKey: 'sub merchant key',
@@ -112,7 +112,7 @@ RSpec.describe 'Iyzipay' do
112
112
 
113
113
  it 'should update private sub merchant' do
114
114
  request = {
115
- locale: 'tr',
115
+ locale: Iyzipay::Model::Locale::TR,
116
116
  conversationId: '123456789',
117
117
  subMerchantExternalId: 'S49222',
118
118
  subMerchantKey: 'sub merchant key',
@@ -137,9 +137,8 @@ RSpec.describe 'Iyzipay' do
137
137
 
138
138
  it 'should update limited company sub merchant' do
139
139
  request = {
140
- locale: 'tr',
140
+ locale: Iyzipay::Model::Locale::TR,
141
141
  conversationId: '123456789',
142
- subMerchantExternalId: 'AS49224',
143
142
  subMerchantKey: 'sub merchant key',
144
143
  address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
145
144
  taxOffice: 'Tax office',
@@ -162,7 +161,7 @@ RSpec.describe 'Iyzipay' do
162
161
 
163
162
  it 'should retrieve sub merchant' do
164
163
  request = {
165
- locale: 'tr',
164
+ locale: Iyzipay::Model::Locale::TR,
166
165
  conversationId: '123456789',
167
166
  subMerchantExternalId: 'AS49224'
168
167
  }
@@ -48,7 +48,7 @@ RSpec.describe 'Iyzipay' do
48
48
  category1: 'Collectibles',
49
49
  category2: 'Accessories',
50
50
  itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
51
- price: '0.3',
51
+ price: '0.3'
52
52
  }
53
53
  item2 = {
54
54
  id: 'BI102',
@@ -56,7 +56,7 @@ RSpec.describe 'Iyzipay' do
56
56
  category1: 'Game',
57
57
  category2: 'Online Game Items',
58
58
  itemType: Iyzipay::Model::BasketItemType::VIRTUAL,
59
- price: '0.5',
59
+ price: '0.5'
60
60
  }
61
61
  item3 = {
62
62
  id: 'BI103',
@@ -64,10 +64,10 @@ RSpec.describe 'Iyzipay' do
64
64
  category1: 'Electronics',
65
65
  category2: 'Usb / Cable',
66
66
  itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
67
- price: '0.2',
67
+ price: '0.2'
68
68
  }
69
69
  request = {
70
- locale: 'tr',
70
+ locale: Iyzipay::Model::Locale::TR,
71
71
  conversationId: '123456789',
72
72
  price: '1.0',
73
73
  paidPrice: '1.1',
@@ -159,7 +159,7 @@ RSpec.describe 'Iyzipay' do
159
159
  subMerchantPrice: '0.18'
160
160
  }
161
161
  request = {
162
- locale: 'tr',
162
+ locale: Iyzipay::Model::Locale::TR,
163
163
  conversationId: '123456789',
164
164
  price: '1.0',
165
165
  paidPrice: '1.1',
@@ -191,10 +191,10 @@ RSpec.describe 'Iyzipay' do
191
191
 
192
192
  it 'should auth threeds' do
193
193
  request = {
194
- locale: 'tr',
194
+ locale: Iyzipay::Model::Locale::TR,
195
195
  conversationId: '123456789',
196
196
  paymentId: '1',
197
- conversationData: 'conversation data',
197
+ conversationData: 'conversation data'
198
198
  }
199
199
  threeds_payment = Iyzipay::Model::ThreedsPayment.new.create(request, @options)
200
200
  begin
@@ -207,10 +207,10 @@ RSpec.describe 'Iyzipay' do
207
207
 
208
208
  it 'should retrieve payment' do
209
209
  request = {
210
- locale: 'tr',
210
+ locale: Iyzipay::Model::Locale::TR,
211
211
  conversationId: '123456789',
212
212
  paymentId: '9',
213
- paymentConversationId: '123456789',
213
+ paymentConversationId: '123456789'
214
214
  }
215
215
  threeds_payment = Iyzipay::Model::ThreedsPayment.new.retrieve(request, @options)
216
216
  begin
metadata CHANGED
@@ -1,73 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iyzipay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.34
4
+ version: 1.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iyzico
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.8'
20
- - - ! '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.8.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.8'
30
- - - ! '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.8.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '3.3'
40
- - - ! '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: 3.3.0
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: '3.3'
50
- - - ! '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.3.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec-rails
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ~>
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '3.3'
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: 3.3.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '3.3'
70
- - - ! '>='
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: 3.3.0
73
73
  description: iyzipay api ruby client. You can sign up for an iyzico account at https://iyzico.com
@@ -76,13 +76,13 @@ executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
- - .gitignore
80
- - .rspec
81
- - .ruby-gemset
82
- - .ruby-version
83
- - .travis.yml
79
+ - ".gitignore"
80
+ - ".rspec"
81
+ - ".ruby-gemset"
82
+ - ".ruby-version"
83
+ - ".travis.yml"
84
84
  - Gemfile
85
- - LICENSE.txt
85
+ - LICENSE
86
86
  - README.md
87
87
  - Rakefile
88
88
  - VERSION
@@ -93,6 +93,7 @@ files:
93
93
  - lib/iyzipay/iyzipay_resource.rb
94
94
  - lib/iyzipay/model.rb
95
95
  - lib/iyzipay/model/address.rb
96
+ - lib/iyzipay/model/api_test.rb
96
97
  - lib/iyzipay/model/approval.rb
97
98
  - lib/iyzipay/model/basic_bkm.rb
98
99
  - lib/iyzipay/model/basic_bkm_initialize.rb
@@ -110,6 +111,9 @@ files:
110
111
  - lib/iyzipay/model/bounced_bank_transfer_list.rb
111
112
  - lib/iyzipay/model/buyer.rb
112
113
  - lib/iyzipay/model/cancel.rb
114
+ - lib/iyzipay/model/card.rb
115
+ - lib/iyzipay/model/card_information.rb
116
+ - lib/iyzipay/model/card_list.rb
113
117
  - lib/iyzipay/model/checkout_form.rb
114
118
  - lib/iyzipay/model/checkout_form_initialize.rb
115
119
  - lib/iyzipay/model/checkout_form_initialize_pre_auth.rb
@@ -120,6 +124,7 @@ files:
120
124
  - lib/iyzipay/model/installment_details.rb
121
125
  - lib/iyzipay/model/installment_info.rb
122
126
  - lib/iyzipay/model/installment_prices.rb
127
+ - lib/iyzipay/model/locale.rb
123
128
  - lib/iyzipay/model/payment.rb
124
129
  - lib/iyzipay/model/payment_card.rb
125
130
  - lib/iyzipay/model/payment_channel.rb
@@ -127,6 +132,8 @@ files:
127
132
  - lib/iyzipay/model/payment_post_auth.rb
128
133
  - lib/iyzipay/model/payment_pre_auth.rb
129
134
  - lib/iyzipay/model/payout_completed_transaction_list.rb
135
+ - lib/iyzipay/model/pecco_initialize.rb
136
+ - lib/iyzipay/model/pecco_payment.rb
130
137
  - lib/iyzipay/model/refund.rb
131
138
  - lib/iyzipay/model/refund_charged_from_merchant.rb
132
139
  - lib/iyzipay/model/sub_merchant.rb
@@ -136,30 +143,22 @@ files:
136
143
  - lib/iyzipay/model/threeds_payment.rb
137
144
  - lib/iyzipay/options.rb
138
145
  - lib/iyzipay/pki_builder.rb
139
- - lib/iyzipay/version.rb
146
+ - spec/api_test_spec.rb
140
147
  - spec/approval_spec.rb
141
- - spec/basic_bkm_spec.rb
142
- - spec/basic_payment_post_auth_spec.rb
143
- - spec/basic_payment_pre_auth_spec.rb
144
- - spec/basic_payment_spec.rb
145
- - spec/basic_threeds_pre_auth_spec.rb
146
- - spec/basic_threeds_spec.rb
147
148
  - spec/bin_number_spec.rb
148
149
  - spec/bkm_spec.rb
149
150
  - spec/cancel_spec.rb
150
- - spec/checkout_form_pre_auth_spec.rb
151
+ - spec/card_storage_spec.rb
151
152
  - spec/checkout_form_spec.rb
152
- - spec/cross_booking_spec.rb
153
+ - spec/disapproval_spec.rb
153
154
  - spec/installment_spec.rb
154
- - spec/payment_post_auth_spec.rb
155
- - spec/payment_pre_auth_spec.rb
156
155
  - spec/payment_spec.rb
156
+ - spec/pecco_spec.rb
157
157
  - spec/refund_spec.rb
158
158
  - spec/retrieve_transactions_spec.rb
159
159
  - spec/spec_helper.rb
160
160
  - spec/sub_merchant_spec.rb
161
161
  - spec/threeds_payment_spec.rb
162
- - spec/threeds_pre_auth_spec.rb
163
162
  homepage: http://rubygems.org/gems/iyzipay
164
163
  licenses:
165
164
  - MIT
@@ -170,12 +169,12 @@ require_paths:
170
169
  - lib
171
170
  required_ruby_version: !ruby/object:Gem::Requirement
172
171
  requirements:
173
- - - ! '>='
172
+ - - ">="
174
173
  - !ruby/object:Gem::Version
175
174
  version: 1.9.3
176
175
  required_rubygems_version: !ruby/object:Gem::Requirement
177
176
  requirements:
178
- - - ! '>='
177
+ - - ">="
179
178
  - !ruby/object:Gem::Version
180
179
  version: '0'
181
180
  requirements: []