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
data/spec/bkm_spec.rb CHANGED
@@ -10,28 +10,28 @@ RSpec.describe 'Iyzipay' do
10
10
  @options.base_url = 'https://sandbox-api.iyzipay.com'
11
11
  end
12
12
 
13
- it 'should initialize bkm express' do
13
+ it 'should initialize bkm' do
14
14
  buyer = {
15
15
  id: 'BY789',
16
16
  name: 'John',
17
17
  surname: 'Doe',
18
- identityNumber: '74300864791',
19
- email: 'email@email.com',
20
18
  gsmNumber: '+905350000000',
21
- registrationDate: '2013-04-21 15:12:09',
19
+ email: 'email@email.com',
20
+ identityNumber: '74300864791',
22
21
  lastLoginDate: '2015-10-05 12:43:35',
22
+ registrationDate: '2013-04-21 15:12:09',
23
23
  registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
24
+ ip: '85.34.78.112',
24
25
  city: 'Istanbul',
25
26
  country: 'Turkey',
26
- zipCode: '34732',
27
- ip: '85.34.78.112'
27
+ zipCode: '34732'
28
28
  }
29
29
  address = {
30
- address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
31
- zipCode: '34732',
32
- contactName: 'John Doe',
30
+ contactName: 'Jane Doe',
33
31
  city: 'Istanbul',
34
- country: 'Turkey'
32
+ country: 'Turkey',
33
+ address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
34
+ zipCode: '34732'
35
35
  }
36
36
 
37
37
  item1 = {
@@ -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: '0.3'
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: '0.5'
56
52
  }
57
53
  item3 = {
58
54
  id: 'BI103',
@@ -60,17 +56,16 @@ 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: '0.2'
66
60
  }
67
61
  request = {
68
- locale: 'tr',
62
+ locale: Iyzipay::Model::Locale::TR,
69
63
  conversationId: '123456789',
70
- price: '1.0',
64
+ price: '1',
71
65
  basketId: 'B67832',
72
66
  paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
73
67
  callbackUrl: 'https://www.merchant.com/callback',
68
+ enabledInstallments: [2, 3, 6, 9],
74
69
  buyer: buyer,
75
70
  billingAddress: address,
76
71
  shippingAddress: address,
@@ -91,11 +86,11 @@ RSpec.describe 'Iyzipay' do
91
86
  end
92
87
  end
93
88
 
94
- it 'should retrieve bkm express payment' do
89
+ it 'should retrieve bkm result' do
95
90
  request = {
96
- locale: 'tr',
91
+ locale: Iyzipay::Model::Locale::TR,
97
92
  conversationId: '123456789',
98
- token: '1462280336796'
93
+ token: 'token'
99
94
  }
100
95
  bkm = Iyzipay::Model::Bkm.new.retrieve(request, @options)
101
96
  begin
data/spec/cancel_spec.rb CHANGED
@@ -12,9 +12,9 @@ RSpec.describe 'Iyzipay' do
12
12
 
13
13
  it 'should cancel payment' do
14
14
  request = {
15
- locale: 'tr',
15
+ locale: Iyzipay::Model::Locale::TR,
16
16
  conversationId: '123456789',
17
- paymentId: '238',
17
+ paymentId: '1',
18
18
  ip: '85.34.78.112'
19
19
  }
20
20
  cancel = Iyzipay::Model::Cancel.new.create(request, @options)
@@ -0,0 +1,94 @@
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.api_key = 'your api key'
9
+ @options.secret_key = 'your secret key'
10
+ @options.base_url = 'https://sandbox-api.iyzipay.com'
11
+ end
12
+
13
+ it 'should create user and add card' do
14
+ card_information = {
15
+ cardAlias: 'card alias',
16
+ cardHolderName: 'John Doe',
17
+ cardNumber: '5528790000000008',
18
+ expireYear: '2030',
19
+ expireMonth: '12'
20
+ }
21
+ request = {
22
+ locale: Iyzipay::Model::Locale::TR,
23
+ conversationId: '123456789',
24
+ email: 'email@email.com',
25
+ externalId: 'external id',
26
+ card: card_information
27
+ }
28
+ card = Iyzipay::Model::Card.new.create(request, @options)
29
+ begin
30
+ $stderr.puts card.inspect
31
+ rescue
32
+ $stderr.puts 'oops'
33
+ raise
34
+ end
35
+ end
36
+
37
+ it 'should create card' do
38
+ card_information = {
39
+ cardAlias: 'card alias',
40
+ cardHolderName: 'John Doe',
41
+ cardNumber: '5528790000000008',
42
+ expireYear: '2030',
43
+ expireMonth: '12'
44
+ }
45
+ request = {
46
+ locale: Iyzipay::Model::Locale::TR,
47
+ conversationId: '123456789',
48
+ email: 'email@email.com',
49
+ cardUserKey: 'card user key',
50
+ card: card_information
51
+ }
52
+ card = Iyzipay::Model::Card.new.create(request, @options)
53
+ begin
54
+ $stderr.puts card.inspect
55
+ rescue
56
+ $stderr.puts 'oops'
57
+ raise
58
+ end
59
+ end
60
+
61
+ it 'should delete card' do
62
+ request = {
63
+ locale: Iyzipay::Model::Locale::TR,
64
+ conversationId: '123456789',
65
+ cardToken: 'card token',
66
+ cardUserKey: 'card user key'
67
+ }
68
+ card = Iyzipay::Model::Card.new.delete(request, @options)
69
+ begin
70
+ $stderr.puts card.inspect
71
+ rescue
72
+ $stderr.puts 'oops'
73
+ raise
74
+ end
75
+ end
76
+
77
+ it 'should retrieve card' do
78
+ request = {
79
+ locale: Iyzipay::Model::Locale::TR,
80
+ conversationId: '123456789',
81
+ cardUserKey: 'card user key'
82
+ }
83
+ card_list = Iyzipay::Model::CardList.new.retrieve(request, @options)
84
+ begin
85
+ $stderr.puts card_list.inspect
86
+ rescue
87
+ $stderr.puts 'oops'
88
+ raise
89
+ end
90
+ end
91
+
92
+ after :each do
93
+ end
94
+ end
@@ -15,23 +15,23 @@ RSpec.describe 'Iyzipay' do
15
15
  id: 'BY789',
16
16
  name: 'John',
17
17
  surname: 'Doe',
18
- identityNumber: '74300864791',
19
- email: 'email@email.com',
20
18
  gsmNumber: '+905350000000',
21
- registrationDate: '2013-04-21 15:12:09',
19
+ email: 'email@email.com',
20
+ identityNumber: '74300864791',
22
21
  lastLoginDate: '2015-10-05 12:43:35',
22
+ registrationDate: '2013-04-21 15:12:09',
23
23
  registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
24
+ ip: '85.34.78.112',
24
25
  city: 'Istanbul',
25
26
  country: 'Turkey',
26
- zipCode: '34732',
27
- ip: '85.34.78.112'
27
+ zipCode: '34732'
28
28
  }
29
29
  address = {
30
- address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
31
- zipCode: '34732',
32
- contactName: 'John Doe',
30
+ contactName: 'Jane Doe',
33
31
  city: 'Istanbul',
34
- country: 'Turkey'
32
+ country: 'Turkey',
33
+ address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
34
+ zipCode: '34732'
35
35
  }
36
36
 
37
37
  item1 = {
@@ -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: '0.3'
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: '0.5'
56
52
  }
57
53
  item3 = {
58
54
  id: 'BI103',
@@ -60,20 +56,18 @@ 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: '0.2'
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: '1',
65
+ paidPrice: '1.2',
66
+ currency: Iyzipay::Model::Currency::TRY,
72
67
  basketId: 'B67832',
73
68
  paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
74
69
  callbackUrl: 'https://www.merchant.com/callback',
75
- enabledInstallments: [2,3,6,9],
76
- currency: Iyzipay::Model::Currency::TRY,
70
+ enabledInstallments: [2, 3, 6, 9],
77
71
  buyer: buyer,
78
72
  billingAddress: address,
79
73
  shippingAddress: address,
@@ -89,11 +83,11 @@ RSpec.describe 'Iyzipay' do
89
83
  end
90
84
  end
91
85
 
92
- it 'should retrieve checkout form payment' do
86
+ it 'should retrieve checkout form result' do
93
87
  request = {
94
- locale: 'tr',
88
+ locale: Iyzipay::Model::Locale::TR,
95
89
  conversationId: '123456789',
96
- token: 'b4d8088e-ce35-452d-94c9-d5bd9f385557'
90
+ token: 'token'
97
91
  }
98
92
  checkout_form_payment = Iyzipay::Model::CheckoutForm.new.retrieve(request, @options)
99
93
  begin
@@ -10,18 +10,15 @@ RSpec.describe 'Iyzipay' do
10
10
  @options.base_url = 'https://sandbox-api.iyzipay.com'
11
11
  end
12
12
 
13
- it 'should post auth' do
13
+ it 'should disapprove payment item' do
14
14
  request = {
15
- locale: 'tr',
15
+ locale: Iyzipay::Model::Locale::TR,
16
16
  conversationId: '123456789',
17
- paymentId: '258',
18
- paidPrice: '1',
19
- ip: '85.34.78.112',
20
- currency: Iyzipay::Model::Currency::TRY,
17
+ paymentTransactionId: '1'
21
18
  }
22
- payment = Iyzipay::Model::PaymentPostAuth.new.create(request, @options)
19
+ disapproval = Iyzipay::Model::Disapproval.new.create(request, @options)
23
20
  begin
24
- $stderr.puts payment.inspect
21
+ $stderr.puts disapproval.inspect
25
22
  rescue
26
23
  $stderr.puts 'oops'
27
24
  raise
@@ -10,12 +10,12 @@ RSpec.describe 'Iyzipay' do
10
10
  @options.base_url = 'https://sandbox-api.iyzipay.com'
11
11
  end
12
12
 
13
- it 'should retrieve bin number' do
13
+ it 'should retrieve installment' do
14
14
  request = {
15
- locale: 'tr',
15
+ locale: Iyzipay::Model::Locale::TR,
16
16
  conversationId: '123456789',
17
- binNumber: '454671',
18
- price: '1',
17
+ binNumber: '554960',
18
+ price: '100'
19
19
  }
20
20
  installment_info = Iyzipay::Model::InstallmentInfo.new.retrieve(request, @options)
21
21
  begin
@@ -28,4 +28,4 @@ RSpec.describe 'Iyzipay' do
28
28
 
29
29
  after :each do
30
30
  end
31
- end
31
+ end
data/spec/payment_spec.rb CHANGED
@@ -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 create payment with physical and virtual item for standard merchant' do
13
+ it 'should create payment' do
14
14
  payment_card = {
15
15
  cardHolderName: 'John Doe',
16
16
  cardNumber: '5528790000000008',
@@ -23,23 +23,23 @@ RSpec.describe 'Iyzipay' do
23
23
  id: 'BY789',
24
24
  name: 'John',
25
25
  surname: 'Doe',
26
- identityNumber: '74300864791',
27
- email: 'email@email.com',
28
26
  gsmNumber: '+905350000000',
29
- registrationDate: '2013-04-21 15:12:09',
27
+ email: 'email@email.com',
28
+ identityNumber: '74300864791',
30
29
  lastLoginDate: '2015-10-05 12:43:35',
30
+ registrationDate: '2013-04-21 15:12:09',
31
31
  registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
32
+ ip: '85.34.78.112',
32
33
  city: 'Istanbul',
33
34
  country: 'Turkey',
34
- zipCode: '34732',
35
- ip: '85.34.78.112'
35
+ zipCode: '34732'
36
36
  }
37
37
  address = {
38
- address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
39
- zipCode: '34732',
40
- contactName: 'John Doe',
38
+ contactName: 'Jane Doe',
41
39
  city: 'Istanbul',
42
- country: 'Turkey'
40
+ country: 'Turkey',
41
+ address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
42
+ zipCode: '34732'
43
43
  }
44
44
 
45
45
  item1 = {
@@ -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,18 +64,18 @@ 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
- price: '1.0',
72
+ price: '1',
73
73
  paidPrice: '1.1',
74
+ currency: Iyzipay::Model::Currency::TRY,
74
75
  installment: 1,
75
- paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
76
76
  basketId: 'B67832',
77
+ paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
77
78
  paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
78
- currency: Iyzipay::Model::Currency::TRY,
79
79
  paymentCard: payment_card,
80
80
  buyer: buyer,
81
81
  billingAddress: address,
@@ -91,7 +91,7 @@ RSpec.describe 'Iyzipay' do
91
91
  end
92
92
  end
93
93
 
94
- it 'should create payment with physical and virtual item for market place' do
94
+ it 'should create marketplace payment' do
95
95
  payment_card = {
96
96
  cardHolderName: 'John Doe',
97
97
  cardNumber: '5528790000000008',
@@ -104,23 +104,23 @@ RSpec.describe 'Iyzipay' do
104
104
  id: 'BY789',
105
105
  name: 'John',
106
106
  surname: 'Doe',
107
- identityNumber: '74300864791',
108
- email: 'email@email.com',
109
107
  gsmNumber: '+905350000000',
110
- registrationDate: '2013-04-21 15:12:09',
108
+ email: 'email@email.com',
109
+ identityNumber: '74300864791',
111
110
  lastLoginDate: '2015-10-05 12:43:35',
111
+ registrationDate: '2013-04-21 15:12:09',
112
112
  registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
113
+ ip: '85.34.78.112',
113
114
  city: 'Istanbul',
114
115
  country: 'Turkey',
115
- zipCode: '34732',
116
- ip: '85.34.78.112'
116
+ zipCode: '34732'
117
117
  }
118
118
  address = {
119
- address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
120
- zipCode: '34732',
121
- contactName: 'John Doe',
119
+ contactName: 'Jane Doe',
122
120
  city: 'Istanbul',
123
- country: 'Turkey'
121
+ country: 'Turkey',
122
+ address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
123
+ zipCode: '34732'
124
124
  }
125
125
 
126
126
  item1 = {
@@ -154,15 +154,15 @@ RSpec.describe 'Iyzipay' do
154
154
  subMerchantPrice: '0.18'
155
155
  }
156
156
  request = {
157
- locale: 'tr',
157
+ locale: Iyzipay::Model::Locale::TR,
158
158
  conversationId: '123456789',
159
- price: '1.0',
159
+ price: '1',
160
160
  paidPrice: '1.1',
161
+ currency: Iyzipay::Model::Currency::TRY,
161
162
  installment: 1,
162
- paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
163
163
  basketId: 'B67832',
164
+ paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
164
165
  paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
165
- currency: Iyzipay::Model::Currency::TRY,
166
166
  paymentCard: payment_card,
167
167
  buyer: buyer,
168
168
  billingAddress: address,
@@ -178,36 +178,32 @@ RSpec.describe 'Iyzipay' do
178
178
  end
179
179
  end
180
180
 
181
- it 'should create payment with physical and virtual item for listing or subscription' do
181
+ it 'should create payment with registered card' do
182
182
  payment_card = {
183
- cardHolderName: 'John Doe',
184
- cardNumber: '5528790000000008',
185
- expireYear: '2030',
186
- expireMonth: '12',
187
- cvc: '123',
188
- registerCard: 0
183
+ cardUserKey: 'card user key',
184
+ cardToken: 'card token'
189
185
  }
190
186
  buyer = {
191
187
  id: 'BY789',
192
188
  name: 'John',
193
189
  surname: 'Doe',
194
- identityNumber: '74300864791',
195
- email: 'email@email.com',
196
190
  gsmNumber: '+905350000000',
197
- registrationDate: '2013-04-21 15:12:09',
191
+ email: 'email@email.com',
192
+ identityNumber: '74300864791',
198
193
  lastLoginDate: '2015-10-05 12:43:35',
194
+ registrationDate: '2013-04-21 15:12:09',
199
195
  registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
196
+ ip: '85.34.78.112',
200
197
  city: 'Istanbul',
201
198
  country: 'Turkey',
202
- zipCode: '34732',
203
- ip: '85.34.78.112'
199
+ zipCode: '34732'
204
200
  }
205
201
  address = {
206
- address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
207
- zipCode: '34732',
208
- contactName: 'John Doe',
202
+ contactName: 'Jane Doe',
209
203
  city: 'Istanbul',
210
- country: 'Turkey'
204
+ country: 'Turkey',
205
+ address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
206
+ zipCode: '34732'
211
207
  }
212
208
 
213
209
  item1 = {
@@ -216,7 +212,7 @@ RSpec.describe 'Iyzipay' do
216
212
  category1: 'Collectibles',
217
213
  category2: 'Accessories',
218
214
  itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
219
- price: '0.3',
215
+ price: '0.3'
220
216
  }
221
217
  item2 = {
222
218
  id: 'BI102',
@@ -224,7 +220,7 @@ RSpec.describe 'Iyzipay' do
224
220
  category1: 'Game',
225
221
  category2: 'Online Game Items',
226
222
  itemType: Iyzipay::Model::BasketItemType::VIRTUAL,
227
- price: '0.5',
223
+ price: '0.5'
228
224
  }
229
225
  item3 = {
230
226
  id: 'BI103',
@@ -232,18 +228,18 @@ RSpec.describe 'Iyzipay' do
232
228
  category1: 'Electronics',
233
229
  category2: 'Usb / Cable',
234
230
  itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
235
- price: '0.2',
231
+ price: '0.2'
236
232
  }
237
233
  request = {
238
- locale: 'tr',
234
+ locale: Iyzipay::Model::Locale::TR,
239
235
  conversationId: '123456789',
240
- price: '1.0',
236
+ price: '1',
241
237
  paidPrice: '1.1',
238
+ currency: Iyzipay::Model::Currency::TRY,
242
239
  installment: 1,
243
- paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
244
240
  basketId: 'B67832',
245
- paymentGroup: Iyzipay::Model::PaymentGroup::SUBSCRIPTION,
246
- currency: Iyzipay::Model::Currency::TRY,
241
+ paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
242
+ paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
247
243
  paymentCard: payment_card,
248
244
  buyer: buyer,
249
245
  billingAddress: address,
@@ -259,11 +255,11 @@ RSpec.describe 'Iyzipay' do
259
255
  end
260
256
  end
261
257
 
262
- it 'should retrieve payment' do
258
+ it 'should retrieve payment result' do
263
259
  request = {
264
- locale: 'tr',
260
+ locale: Iyzipay::Model::Locale::TR,
265
261
  conversationId: '123456789',
266
- paymentId: '262',
262
+ paymentId: '1',
267
263
  paymentConversationId: '123456789'
268
264
  }
269
265
  bkm = Iyzipay::Model::Payment.new.retrieve(request, @options)