iyzipay 1.0.42 → 1.0.43
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/VERSION +1 -1
- data/iyzipay.gemspec +1 -1
- data/lib/iyzipay/iyzipay_resource.rb +1 -1
- data/lib/iyzipay/model.rb +2 -1
- 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/spec/cancel_spec.rb +29 -0
- data/spec/refund_spec.rb +31 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1f69247a2b8c5db2ad3461572c026f51ea40ab8e78f31c052ee1fef35db4f361
|
4
|
+
data.tar.gz: b92f6e94ad012c09f95c04d07411497190600434dbc168032f47d2f4def798b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb94b25502775f23f3ad0237855249372c2a0df3e0531e9248a91b2475f1c1f8cb97bf99f86f7c50ae71ffb3d80ea7c1729d27f8c38b35ed383e19b41063e922
|
7
|
+
data.tar.gz: 8ea27b332ef6701fb5b21ac7d4340932d51547447e27ae7a42b57898efc636964161652033101fc154b3f92395dd9c027557ec3e0be0904dbaaea24e189c3edc
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.43
|
data/iyzipay.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'iyzipay'
|
6
|
-
s.version = '1.0.
|
6
|
+
s.version = '1.0.43'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.required_ruby_version = '>= 1.9.3'
|
9
9
|
s.summary = %q{iyzipay api ruby client}
|
@@ -15,7 +15,7 @@ module Iyzipay
|
|
15
15
|
random_header_value = random_string(RANDOM_STRING_SIZE)
|
16
16
|
header[:'Authorization'] = "#{prepare_authorization_string(pki_string, random_header_value, options)}"
|
17
17
|
header[:'x-iyzi-rnd'] = "#{random_header_value}"
|
18
|
-
header[:'x-iyzi-client-version'] = 'iyzipay-ruby-1.0.
|
18
|
+
header[:'x-iyzi-client-version'] = 'iyzipay-ruby-1.0.43'
|
19
19
|
end
|
20
20
|
|
21
21
|
header
|
data/lib/iyzipay/model.rb
CHANGED
@@ -49,4 +49,5 @@ require_relative 'model/sub_merchant_type'
|
|
49
49
|
require_relative 'model/threeds_initialize'
|
50
50
|
require_relative 'model/threeds_initialize_pre_auth'
|
51
51
|
require_relative 'model/threeds_payment'
|
52
|
-
require_relative 'model/currency'
|
52
|
+
require_relative 'model/currency'
|
53
|
+
require_relative 'model/refund_reason'
|
data/lib/iyzipay/model/cancel.rb
CHANGED
data/lib/iyzipay/model/refund.rb
CHANGED
data/spec/cancel_spec.rb
CHANGED
@@ -38,6 +38,35 @@ RSpec.describe 'Iyzipay' do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
it 'should cancel payment with reason and description' do
|
42
|
+
payment = Builder::PaymentBuilder.new.create_standard_listing_payment(@options)
|
43
|
+
|
44
|
+
request = {
|
45
|
+
locale: Iyzipay::Model::Locale::TR,
|
46
|
+
conversationId: '123456789',
|
47
|
+
paymentId: payment['paymentId'],
|
48
|
+
ip: '85.34.78.112',
|
49
|
+
reason: Iyzipay::Model::RefundReason::OTHER,
|
50
|
+
description: 'customer requested for default sample'
|
51
|
+
}
|
52
|
+
cancel = Iyzipay::Model::Cancel.new.create(request, @options)
|
53
|
+
begin
|
54
|
+
$stdout.puts cancel.inspect
|
55
|
+
cancel = JSON.parse(cancel)
|
56
|
+
expect(cancel['status']).to eq('success')
|
57
|
+
expect(cancel['locale']).to eq('tr')
|
58
|
+
expect(cancel['systemTime']).not_to be_nil
|
59
|
+
expect(cancel['conversationId']).to eq('123456789')
|
60
|
+
expect(cancel['paymentId']).to eq(payment['paymentId'])
|
61
|
+
expect(cancel['price']).to eq(1.10000000)
|
62
|
+
expect(cancel['currency']).to eq('TRY')
|
63
|
+
expect(cancel['authCode']).not_to be_nil
|
64
|
+
rescue
|
65
|
+
$stderr.puts 'oops'
|
66
|
+
raise
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
41
70
|
after :each do
|
42
71
|
end
|
43
72
|
end
|
data/spec/refund_spec.rb
CHANGED
@@ -40,6 +40,37 @@ RSpec.describe 'Iyzipay' do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
it 'should refund payment with reason and description' do
|
44
|
+
# create payment
|
45
|
+
payment = Builder::PaymentBuilder.new.create_standard_listing_payment(@options)
|
46
|
+
|
47
|
+
request = {
|
48
|
+
locale: Iyzipay::Model::Locale::TR,
|
49
|
+
conversationId: '123456789',
|
50
|
+
paymentTransactionId: payment['itemTransactions'][0]['paymentTransactionId'],
|
51
|
+
price: '0.2',
|
52
|
+
currency: Iyzipay::Model::Currency::TRY,
|
53
|
+
ip: '85.34.78.112',
|
54
|
+
reason: Iyzipay::Model::RefundReason::OTHER,
|
55
|
+
description: 'customer requested for default sample'
|
56
|
+
}
|
57
|
+
refund = Iyzipay::Model::Refund.new.create(request, @options)
|
58
|
+
begin
|
59
|
+
$stdout.puts refund.inspect
|
60
|
+
refund = JSON.parse(refund)
|
61
|
+
expect(refund['status']).to eq('success')
|
62
|
+
expect(refund['locale']).to eq('tr')
|
63
|
+
expect(refund['systemTime']).not_to be_nil
|
64
|
+
expect(refund['conversationId']).to eq('123456789')
|
65
|
+
expect(refund['paymentId']).to eq(payment['paymentId'])
|
66
|
+
expect(refund['paymentTransactionId']).to eq(payment['itemTransactions'][0]['paymentTransactionId'])
|
67
|
+
expect(refund['price']).to eq(0.2)
|
68
|
+
rescue
|
69
|
+
$stderr.puts 'oops'
|
70
|
+
raise
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
43
74
|
after :each do
|
44
75
|
end
|
45
76
|
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.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iyzico
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/iyzipay/model/pecco_payment.rb
|
125
125
|
- lib/iyzipay/model/refund.rb
|
126
126
|
- lib/iyzipay/model/refund_charged_from_merchant.rb
|
127
|
+
- lib/iyzipay/model/refund_reason.rb
|
127
128
|
- lib/iyzipay/model/sub_merchant.rb
|
128
129
|
- lib/iyzipay/model/sub_merchant_type.rb
|
129
130
|
- lib/iyzipay/model/threeds_initialize.rb
|
@@ -176,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
177
|
version: '0'
|
177
178
|
requirements: []
|
178
179
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.
|
180
|
+
rubygems_version: 2.7.3
|
180
181
|
signing_key:
|
181
182
|
specification_version: 4
|
182
183
|
summary: iyzipay api ruby client
|