iyzipay 1.0.36 → 1.0.45
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 +5 -5
- data/.travis.yml +6 -6
- data/Gemfile +3 -6
- data/README.md +5 -1
- data/VERSION +1 -1
- data/gemfiles/Gemfile.nokogiri-1.6.8.1 +7 -0
- data/iyzipay.gemspec +6 -5
- data/lib/iyzipay/iyzipay_resource.rb +1 -1
- data/lib/iyzipay/model/bkm_initialize.rb +1 -0
- data/lib/iyzipay/model/cancel.rb +2 -0
- data/lib/iyzipay/model/refund.rb +2 -0
- data/lib/iyzipay/model/refund_reason.rb +10 -0
- data/lib/iyzipay/model.rb +2 -1
- data/spec/api_test_spec.rb +7 -4
- data/spec/approval_spec.rb +26 -15
- data/spec/bin_number_spec.rb +16 -4
- data/spec/bkm_spec.rb +6 -21
- data/spec/builder/approval_builder.rb +18 -0
- data/spec/builder/card_builder.rb +27 -0
- data/spec/builder/checkout_form_builder.rb +75 -0
- data/spec/builder/payment_builder.rb +167 -0
- data/spec/builder/pecco_initialize_builder.rb +74 -0
- data/spec/builder/sub_merchant_builder.rb +91 -0
- data/spec/builder.rb +9 -0
- data/spec/cancel_spec.rb +46 -5
- data/spec/card_storage_spec.rb +71 -12
- data/spec/checkout_form_spec.rb +18 -8
- data/spec/disapproval_spec.rb +22 -5
- data/spec/installment_spec.rb +19 -4
- data/spec/payment_spec.rb +62 -18
- data/spec/pecco_spec.rb +20 -9
- data/spec/refund_spec.rb +49 -6
- data/spec/retrieve_transactions_spec.rb +17 -7
- data/spec/spec_helper.rb +2 -1
- data/spec/spec_options.rb +5 -0
- data/spec/sub_merchant_spec.rb +68 -20
- data/spec/threeds_payment_spec.rb +22 -19
- data/spec/tls12_test_spec.rb +16 -0
- metadata +47 -27
- data/.ruby-version +0 -1
- /data/lib/{Iyzipay.rb → iyzipay.rb} +0 -0
@@ -1,13 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require_relative 'spec_helper'
|
4
|
+
require_relative 'builder'
|
4
5
|
|
5
6
|
RSpec.describe 'Iyzipay' do
|
6
7
|
before :all do
|
7
8
|
@options = Iyzipay::Options.new
|
8
|
-
@options.api_key =
|
9
|
-
@options.secret_key =
|
10
|
-
@options.base_url =
|
9
|
+
@options.api_key = SpecOptions::API_KEY
|
10
|
+
@options.secret_key = SpecOptions::SECRET_KEY
|
11
|
+
@options.base_url = SpecOptions::BASE_URL
|
11
12
|
end
|
12
13
|
|
13
14
|
it 'should create payment with physical and virtual item for standard merchant' do
|
@@ -74,7 +75,7 @@ RSpec.describe 'Iyzipay' do
|
|
74
75
|
installment: 1,
|
75
76
|
paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
|
76
77
|
basketId: 'B67832',
|
77
|
-
paymentGroup: Iyzipay::Model::PaymentGroup::
|
78
|
+
paymentGroup: Iyzipay::Model::PaymentGroup::LISTING,
|
78
79
|
callbackUrl: 'https://www.merchant.com/callback',
|
79
80
|
currency: Iyzipay::Model::Currency::TRY,
|
80
81
|
paymentCard: payment_card,
|
@@ -85,10 +86,13 @@ RSpec.describe 'Iyzipay' do
|
|
85
86
|
}
|
86
87
|
threeds_initialize = Iyzipay::Model::ThreedsInitialize.new.create(request, @options)
|
87
88
|
begin
|
88
|
-
$
|
89
|
+
$stdout.puts threeds_initialize.inspect
|
89
90
|
threeds_initialize_dict = JSON.parse(threeds_initialize)
|
90
91
|
unless threeds_initialize_dict['threeDSHtmlContent'].nil?
|
91
|
-
$
|
92
|
+
$stdout.puts Base64.decode64(threeds_initialize_dict['threeDSHtmlContent']).inspect
|
93
|
+
expect(threeds_initialize_dict['status']).to eq('success')
|
94
|
+
expect(threeds_initialize_dict['locale']).to eq('tr')
|
95
|
+
expect(threeds_initialize_dict['systemTime']).not_to be_nil
|
92
96
|
end
|
93
97
|
rescue
|
94
98
|
$stderr.puts 'oops'
|
@@ -135,8 +139,6 @@ RSpec.describe 'Iyzipay' do
|
|
135
139
|
category2: 'Accessories',
|
136
140
|
itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
|
137
141
|
price: '0.3',
|
138
|
-
subMerchantKey: 'sub merchant key',
|
139
|
-
subMerchantPrice: '0.27'
|
140
142
|
}
|
141
143
|
item2 = {
|
142
144
|
id: 'BI102',
|
@@ -145,8 +147,6 @@ RSpec.describe 'Iyzipay' do
|
|
145
147
|
category2: 'Online Game Items',
|
146
148
|
itemType: Iyzipay::Model::BasketItemType::VIRTUAL,
|
147
149
|
price: '0.5',
|
148
|
-
subMerchantKey: 'sub merchant key',
|
149
|
-
subMerchantPrice: '0.42'
|
150
150
|
}
|
151
151
|
item3 = {
|
152
152
|
id: 'BI103',
|
@@ -155,8 +155,6 @@ RSpec.describe 'Iyzipay' do
|
|
155
155
|
category2: 'Usb / Cable',
|
156
156
|
itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
|
157
157
|
price: '0.2',
|
158
|
-
subMerchantKey: 'sub merchant key',
|
159
|
-
subMerchantPrice: '0.18'
|
160
158
|
}
|
161
159
|
request = {
|
162
160
|
locale: Iyzipay::Model::Locale::TR,
|
@@ -166,7 +164,7 @@ RSpec.describe 'Iyzipay' do
|
|
166
164
|
installment: 1,
|
167
165
|
paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
|
168
166
|
basketId: 'B67832',
|
169
|
-
paymentGroup: Iyzipay::Model::PaymentGroup::
|
167
|
+
paymentGroup: Iyzipay::Model::PaymentGroup::LISTING,
|
170
168
|
callbackUrl: 'https://www.merchant.com/callback',
|
171
169
|
currency: Iyzipay::Model::Currency::TRY,
|
172
170
|
paymentCard: payment_card,
|
@@ -177,11 +175,14 @@ RSpec.describe 'Iyzipay' do
|
|
177
175
|
}
|
178
176
|
threeds_initialize = Iyzipay::Model::ThreedsInitialize.new.create(request, @options)
|
179
177
|
begin
|
180
|
-
$
|
178
|
+
$stdout.puts threeds_initialize.inspect
|
181
179
|
|
182
180
|
threeds_initialize_dict = JSON.parse(threeds_initialize)
|
183
181
|
unless threeds_initialize_dict['threeDSHtmlContent'].nil?
|
184
|
-
$
|
182
|
+
$stdout.puts Base64.decode64(threeds_initialize_dict['threeDSHtmlContent']).inspect
|
183
|
+
expect(threeds_initialize_dict['status']).to eq('success')
|
184
|
+
expect(threeds_initialize_dict['locale']).to eq('tr')
|
185
|
+
expect(threeds_initialize_dict['systemTime']).not_to be_nil
|
185
186
|
end
|
186
187
|
rescue
|
187
188
|
$stderr.puts 'oops'
|
@@ -190,6 +191,7 @@ RSpec.describe 'Iyzipay' do
|
|
190
191
|
end
|
191
192
|
|
192
193
|
it 'should auth threeds' do
|
194
|
+
# This test needs manual payment from Pecco on sandbox environment. So it does not contain any assertions.
|
193
195
|
request = {
|
194
196
|
locale: Iyzipay::Model::Locale::TR,
|
195
197
|
conversationId: '123456789',
|
@@ -198,14 +200,15 @@ RSpec.describe 'Iyzipay' do
|
|
198
200
|
}
|
199
201
|
threeds_payment = Iyzipay::Model::ThreedsPayment.new.create(request, @options)
|
200
202
|
begin
|
201
|
-
$
|
203
|
+
$stdout.puts threeds_payment.inspect
|
202
204
|
rescue
|
203
|
-
$
|
205
|
+
$stdout.puts 'oops'
|
204
206
|
raise
|
205
207
|
end
|
206
208
|
end
|
207
209
|
|
208
210
|
it 'should retrieve payment' do
|
211
|
+
# This test needs manual payment from Pecco on sandbox environment. So it does not contain any assertions.
|
209
212
|
request = {
|
210
213
|
locale: Iyzipay::Model::Locale::TR,
|
211
214
|
conversationId: '123456789',
|
@@ -214,9 +217,9 @@ RSpec.describe 'Iyzipay' do
|
|
214
217
|
}
|
215
218
|
threeds_payment = Iyzipay::Model::ThreedsPayment.new.retrieve(request, @options)
|
216
219
|
begin
|
217
|
-
$
|
220
|
+
$stdout.puts threeds_payment.inspect
|
218
221
|
rescue
|
219
|
-
$
|
222
|
+
$stdout.puts 'oops'
|
220
223
|
raise
|
221
224
|
end
|
222
225
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe 'Iyzipay' do
|
6
|
+
before :all do
|
7
|
+
@options = Iyzipay::Options.new
|
8
|
+
@options.base_url = 'https://sandbox-api-tls12.iyzipay.com/'
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should test tls 1.2 support' do
|
12
|
+
api_test = Iyzipay::Model::ApiTest.new.retrieve(@options)
|
13
|
+
api_test = JSON.parse(api_test)
|
14
|
+
expect(api_test['status']).to eq('success')
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iyzipay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iyzico
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -16,60 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.8.0
|
19
|
+
version: '2.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.6.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
31
39
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
40
|
+
version: 1.6.4
|
33
41
|
- !ruby/object:Gem::Dependency
|
34
42
|
name: rspec
|
35
43
|
requirement: !ruby/object:Gem::Requirement
|
36
44
|
requirements:
|
37
45
|
- - "~>"
|
38
46
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 3.3.0
|
47
|
+
version: 3.5.0
|
43
48
|
type: :development
|
44
49
|
prerelease: false
|
45
50
|
version_requirements: !ruby/object:Gem::Requirement
|
46
51
|
requirements:
|
47
52
|
- - "~>"
|
48
53
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 3.3.0
|
54
|
+
version: 3.5.0
|
53
55
|
- !ruby/object:Gem::Dependency
|
54
56
|
name: rspec-rails
|
55
57
|
requirement: !ruby/object:Gem::Requirement
|
56
58
|
requirements:
|
57
59
|
- - "~>"
|
58
60
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 3.3.0
|
61
|
+
version: 3.5.0
|
63
62
|
type: :development
|
64
63
|
prerelease: false
|
65
64
|
version_requirements: !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
66
|
- - "~>"
|
68
67
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
70
|
-
|
68
|
+
version: 3.5.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: nokogiri
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.8.2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
71
81
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
82
|
+
version: 1.8.2
|
73
83
|
description: iyzipay api ruby client. You can sign up for an iyzico account at https://iyzico.com
|
74
84
|
email: iyzico-ci@iyzico.com
|
75
85
|
executables: []
|
@@ -79,7 +89,6 @@ files:
|
|
79
89
|
- ".gitignore"
|
80
90
|
- ".rspec"
|
81
91
|
- ".ruby-gemset"
|
82
|
-
- ".ruby-version"
|
83
92
|
- ".travis.yml"
|
84
93
|
- Gemfile
|
85
94
|
- LICENSE
|
@@ -87,8 +96,9 @@ files:
|
|
87
96
|
- Rakefile
|
88
97
|
- VERSION
|
89
98
|
- contributors
|
99
|
+
- gemfiles/Gemfile.nokogiri-1.6.8.1
|
90
100
|
- iyzipay.gemspec
|
91
|
-
- lib/
|
101
|
+
- lib/iyzipay.rb
|
92
102
|
- lib/iyzipay/http_client.rb
|
93
103
|
- lib/iyzipay/iyzipay_resource.rb
|
94
104
|
- lib/iyzipay/model.rb
|
@@ -136,6 +146,7 @@ files:
|
|
136
146
|
- lib/iyzipay/model/pecco_payment.rb
|
137
147
|
- lib/iyzipay/model/refund.rb
|
138
148
|
- lib/iyzipay/model/refund_charged_from_merchant.rb
|
149
|
+
- lib/iyzipay/model/refund_reason.rb
|
139
150
|
- lib/iyzipay/model/sub_merchant.rb
|
140
151
|
- lib/iyzipay/model/sub_merchant_type.rb
|
141
152
|
- lib/iyzipay/model/threeds_initialize.rb
|
@@ -147,6 +158,13 @@ files:
|
|
147
158
|
- spec/approval_spec.rb
|
148
159
|
- spec/bin_number_spec.rb
|
149
160
|
- spec/bkm_spec.rb
|
161
|
+
- spec/builder.rb
|
162
|
+
- spec/builder/approval_builder.rb
|
163
|
+
- spec/builder/card_builder.rb
|
164
|
+
- spec/builder/checkout_form_builder.rb
|
165
|
+
- spec/builder/payment_builder.rb
|
166
|
+
- spec/builder/pecco_initialize_builder.rb
|
167
|
+
- spec/builder/sub_merchant_builder.rb
|
150
168
|
- spec/cancel_spec.rb
|
151
169
|
- spec/card_storage_spec.rb
|
152
170
|
- spec/checkout_form_spec.rb
|
@@ -157,8 +175,10 @@ files:
|
|
157
175
|
- spec/refund_spec.rb
|
158
176
|
- spec/retrieve_transactions_spec.rb
|
159
177
|
- spec/spec_helper.rb
|
178
|
+
- spec/spec_options.rb
|
160
179
|
- spec/sub_merchant_spec.rb
|
161
180
|
- spec/threeds_payment_spec.rb
|
181
|
+
- spec/tls12_test_spec.rb
|
162
182
|
homepage: http://rubygems.org/gems/iyzipay
|
163
183
|
licenses:
|
164
184
|
- MIT
|
@@ -179,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
199
|
version: '0'
|
180
200
|
requirements: []
|
181
201
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.7.6
|
183
203
|
signing_key:
|
184
204
|
specification_version: 4
|
185
205
|
summary: iyzipay api ruby client
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.9.3
|
File without changes
|