iyzipay 1.0.36 → 1.0.39
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 +4 -4
- data/.travis.yml +1 -0
- data/Gemfile +1 -0
- data/VERSION +1 -1
- data/gemfiles/Gemfile.nokogiri-1.6.8.1 +7 -0
- data/iyzipay.gemspec +3 -3
- data/lib/{Iyzipay.rb → iyzipay.rb} +0 -0
- data/lib/iyzipay/iyzipay_resource.rb +1 -1
- data/lib/iyzipay/model/bkm_initialize.rb +1 -0
- 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.rb +9 -0
- 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/cancel_spec.rb +17 -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 +18 -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
- metadata +12 -16
- data/.ruby-version +0 -1
@@ -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
|
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.39
|
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: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -35,9 +35,6 @@ dependencies:
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '3.3'
|
40
|
-
- - ">="
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: 3.3.0
|
43
40
|
type: :development
|
@@ -45,9 +42,6 @@ dependencies:
|
|
45
42
|
version_requirements: !ruby/object:Gem::Requirement
|
46
43
|
requirements:
|
47
44
|
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '3.3'
|
50
|
-
- - ">="
|
51
45
|
- !ruby/object:Gem::Version
|
52
46
|
version: 3.3.0
|
53
47
|
- !ruby/object:Gem::Dependency
|
@@ -55,9 +49,6 @@ dependencies:
|
|
55
49
|
requirement: !ruby/object:Gem::Requirement
|
56
50
|
requirements:
|
57
51
|
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '3.3'
|
60
|
-
- - ">="
|
61
52
|
- !ruby/object:Gem::Version
|
62
53
|
version: 3.3.0
|
63
54
|
type: :development
|
@@ -65,9 +56,6 @@ dependencies:
|
|
65
56
|
version_requirements: !ruby/object:Gem::Requirement
|
66
57
|
requirements:
|
67
58
|
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.3'
|
70
|
-
- - ">="
|
71
59
|
- !ruby/object:Gem::Version
|
72
60
|
version: 3.3.0
|
73
61
|
description: iyzipay api ruby client. You can sign up for an iyzico account at https://iyzico.com
|
@@ -79,7 +67,6 @@ files:
|
|
79
67
|
- ".gitignore"
|
80
68
|
- ".rspec"
|
81
69
|
- ".ruby-gemset"
|
82
|
-
- ".ruby-version"
|
83
70
|
- ".travis.yml"
|
84
71
|
- Gemfile
|
85
72
|
- LICENSE
|
@@ -87,8 +74,9 @@ files:
|
|
87
74
|
- Rakefile
|
88
75
|
- VERSION
|
89
76
|
- contributors
|
77
|
+
- gemfiles/Gemfile.nokogiri-1.6.8.1
|
90
78
|
- iyzipay.gemspec
|
91
|
-
- lib/
|
79
|
+
- lib/iyzipay.rb
|
92
80
|
- lib/iyzipay/http_client.rb
|
93
81
|
- lib/iyzipay/iyzipay_resource.rb
|
94
82
|
- lib/iyzipay/model.rb
|
@@ -147,6 +135,13 @@ files:
|
|
147
135
|
- spec/approval_spec.rb
|
148
136
|
- spec/bin_number_spec.rb
|
149
137
|
- spec/bkm_spec.rb
|
138
|
+
- spec/builder.rb
|
139
|
+
- spec/builder/approval_builder.rb
|
140
|
+
- spec/builder/card_builder.rb
|
141
|
+
- spec/builder/checkout_form_builder.rb
|
142
|
+
- spec/builder/payment_builder.rb
|
143
|
+
- spec/builder/pecco_initialize_builder.rb
|
144
|
+
- spec/builder/sub_merchant_builder.rb
|
150
145
|
- spec/cancel_spec.rb
|
151
146
|
- spec/card_storage_spec.rb
|
152
147
|
- spec/checkout_form_spec.rb
|
@@ -157,6 +152,7 @@ files:
|
|
157
152
|
- spec/refund_spec.rb
|
158
153
|
- spec/retrieve_transactions_spec.rb
|
159
154
|
- spec/spec_helper.rb
|
155
|
+
- spec/spec_options.rb
|
160
156
|
- spec/sub_merchant_spec.rb
|
161
157
|
- spec/threeds_payment_spec.rb
|
162
158
|
homepage: http://rubygems.org/gems/iyzipay
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.9.3
|