iyzipay-zebramo 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.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +123 -0
- data/Rakefile +5 -0
- data/contributors +2 -0
- data/iyzipay.gemspec +24 -0
- data/lib/Iyzipay.rb +16 -0
- data/lib/iyzipay/http_client.rb +19 -0
- data/lib/iyzipay/iyzipay_resource.rb +59 -0
- data/lib/iyzipay/model.rb +49 -0
- data/lib/iyzipay/model/address.rb +17 -0
- data/lib/iyzipay/model/api_test.rb +10 -0
- data/lib/iyzipay/model/approval.rb +17 -0
- data/lib/iyzipay/model/basic_bkm.rb +17 -0
- data/lib/iyzipay/model/basic_bkm_initialize.rb +24 -0
- data/lib/iyzipay/model/basic_payment.rb +27 -0
- data/lib/iyzipay/model/basic_payment_post_auth.rb +20 -0
- data/lib/iyzipay/model/basic_payment_pre_auth.rb +27 -0
- data/lib/iyzipay/model/basic_threeds_initialize.rb +27 -0
- data/lib/iyzipay/model/basic_threeds_initialize_pre_auth.rb +27 -0
- data/lib/iyzipay/model/basic_threeds_payment.rb +18 -0
- data/lib/iyzipay/model/basket.rb +26 -0
- data/lib/iyzipay/model/basket_item_type.rb +8 -0
- data/lib/iyzipay/model/bin_number.rb +17 -0
- data/lib/iyzipay/model/bkm.rb +17 -0
- data/lib/iyzipay/model/bkm_initialize.rb +24 -0
- data/lib/iyzipay/model/bounced_bank_transfer_list.rb +17 -0
- data/lib/iyzipay/model/buyer.rb +25 -0
- data/lib/iyzipay/model/cancel.rb +18 -0
- data/lib/iyzipay/model/checkout_form.rb +17 -0
- data/lib/iyzipay/model/checkout_form_initialize.rb +31 -0
- data/lib/iyzipay/model/checkout_form_initialize_pre_auth.rb +30 -0
- data/lib/iyzipay/model/cross_booking_from_sub_merchant.rb +20 -0
- data/lib/iyzipay/model/cross_booking_to_sub_merchant.rb +20 -0
- data/lib/iyzipay/model/currency.rb +11 -0
- data/lib/iyzipay/model/disapproval.rb +17 -0
- data/lib/iyzipay/model/installment_details.rb +19 -0
- data/lib/iyzipay/model/installment_info.rb +18 -0
- data/lib/iyzipay/model/installment_prices.rb +19 -0
- data/lib/iyzipay/model/locale.rb +8 -0
- data/lib/iyzipay/model/payment.rb +47 -0
- data/lib/iyzipay/model/payment_card.rb +22 -0
- data/lib/iyzipay/model/payment_channel.rb +14 -0
- data/lib/iyzipay/model/payment_group.rb +9 -0
- data/lib/iyzipay/model/payment_post_auth.rb +20 -0
- data/lib/iyzipay/model/payment_pre_auth.rb +47 -0
- data/lib/iyzipay/model/payout_completed_transaction_list.rb +17 -0
- data/lib/iyzipay/model/pecco_initialize.rb +27 -0
- data/lib/iyzipay/model/pecco_payment.rb +17 -0
- data/lib/iyzipay/model/refund.rb +20 -0
- data/lib/iyzipay/model/refund_charged_from_merchant.rb +20 -0
- data/lib/iyzipay/model/sub_merchant.rb +72 -0
- data/lib/iyzipay/model/sub_merchant_type.rb +9 -0
- data/lib/iyzipay/model/threeds_initialize.rb +32 -0
- data/lib/iyzipay/model/threeds_initialize_pre_auth.rb +32 -0
- data/lib/iyzipay/model/threeds_payment.rb +34 -0
- data/lib/iyzipay/options.rb +7 -0
- data/lib/iyzipay/pki_builder.rb +101 -0
- data/lib/iyzipay/version.rb +3 -0
- data/spec/api_test_spec.rb +25 -0
- data/spec/approval_spec.rb +30 -0
- data/spec/bin_number_spec.rb +30 -0
- data/spec/bkm_spec.rb +105 -0
- data/spec/cancel_spec.rb +31 -0
- data/spec/card_storage_spec.rb +0 -0
- data/spec/checkout_form_spec.rb +103 -0
- data/spec/disapproval_spec.rb +30 -0
- data/spec/installment_spec.rb +31 -0
- data/spec/payment_spec.rb +276 -0
- data/spec/pecco_spec.rb +105 -0
- data/spec/refund_spec.rb +33 -0
- data/spec/retrieve_transactions_spec.rb +45 -0
- data/spec/spec_helper.rb +80 -0
- data/spec/sub_merchant_spec.rb +179 -0
- data/spec/threeds_payment_spec.rb +226 -0
- metadata +178 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 293acc020de77530a28f256704eb4344e09c046b
|
|
4
|
+
data.tar.gz: 5d9609178e1c05973051b775c7a05d2fe332f06e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 16ea4f3ac3e22623cc7d469103f505be3879233c02f3c486daa19a6f732cf643c720e3591276a57e69b94031dad66fb1877bd781bb1f47fec05f36d4a661404f
|
|
7
|
+
data.tar.gz: 659c4be70d469a875563e0340c5cace0a423c51c62783fb3be7a91b19c309d3b8d61bf8d9e9887929ff6e120ebb7d3560965e1734c99fe39a714132d1eabc4d9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
iyzipay-zebramo
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-2.1.8
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 - iyzico Ödeme Hizmetleri A.Ş. (https://iyzico.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# iyzipay-ruby
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/iyzico/iyzipay-ruby)
|
|
4
|
+
|
|
5
|
+
You can sign up for an iyzico account at https://iyzico.com
|
|
6
|
+
|
|
7
|
+
# Requirements
|
|
8
|
+
|
|
9
|
+
* Ruby 1.9.3 or newer
|
|
10
|
+
* rest-client
|
|
11
|
+
|
|
12
|
+
# Installation
|
|
13
|
+
|
|
14
|
+
gem install iyzipay
|
|
15
|
+
|
|
16
|
+
## Bundler
|
|
17
|
+
|
|
18
|
+
``` ruby
|
|
19
|
+
source 'https://rubygems.org'
|
|
20
|
+
|
|
21
|
+
gem 'rails'
|
|
22
|
+
gem 'iyzipay'
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
# Usage
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
|
|
30
|
+
before :all do
|
|
31
|
+
@options = Iyzipay::Options.new
|
|
32
|
+
@options.api_key = 'your api key'
|
|
33
|
+
@options.secret_key = 'your secret key'
|
|
34
|
+
@options.base_url = 'https://sandbox-api.iyzipay.com'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it 'should create payment with physical and virtual item for listing or subscription' do
|
|
38
|
+
payment_card = {
|
|
39
|
+
cardHolderName: 'John Doe',
|
|
40
|
+
cardNumber: '5528790000000008',
|
|
41
|
+
expireYear: '2030',
|
|
42
|
+
expireMonth: '12',
|
|
43
|
+
cvc: '123',
|
|
44
|
+
registerCard: 0
|
|
45
|
+
}
|
|
46
|
+
buyer = {
|
|
47
|
+
id: 'BY789',
|
|
48
|
+
name: 'John',
|
|
49
|
+
surname: 'Doe',
|
|
50
|
+
identityNumber: '74300864791',
|
|
51
|
+
email: 'email@email.com',
|
|
52
|
+
gsmNumber: '+905350000000',
|
|
53
|
+
registrationDate: '2013-04-21 15:12:09',
|
|
54
|
+
lastLoginDate: '2015-10-05 12:43:35',
|
|
55
|
+
registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
|
|
56
|
+
city: 'Istanbul',
|
|
57
|
+
country: 'Turkey',
|
|
58
|
+
zipCode: '34732',
|
|
59
|
+
ip: '85.34.78.112'
|
|
60
|
+
}
|
|
61
|
+
address = {
|
|
62
|
+
address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
|
|
63
|
+
zipCode: '34732',
|
|
64
|
+
contactName: 'John Doe',
|
|
65
|
+
city: 'Istanbul',
|
|
66
|
+
country: 'Turkey'
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
item1 = {
|
|
70
|
+
id: 'BI101',
|
|
71
|
+
name: 'Binocular',
|
|
72
|
+
category1: 'Collectibles',
|
|
73
|
+
category2: 'Accessories',
|
|
74
|
+
itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
|
|
75
|
+
price: '0.3',
|
|
76
|
+
}
|
|
77
|
+
item2 = {
|
|
78
|
+
id: 'BI102',
|
|
79
|
+
name: 'Game code',
|
|
80
|
+
category1: 'Game',
|
|
81
|
+
category2: 'Online Game Items',
|
|
82
|
+
itemType: Iyzipay::Model::BasketItemType::VIRTUAL,
|
|
83
|
+
price: '0.5',
|
|
84
|
+
}
|
|
85
|
+
item3 = {
|
|
86
|
+
id: 'BI103',
|
|
87
|
+
name: 'Usb',
|
|
88
|
+
category1: 'Electronics',
|
|
89
|
+
category2: 'Usb / Cable',
|
|
90
|
+
itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
|
|
91
|
+
price: '0.2',
|
|
92
|
+
}
|
|
93
|
+
request = {
|
|
94
|
+
locale: Iyzipay::Model::Locale::TR,
|
|
95
|
+
conversationId: '123456789',
|
|
96
|
+
price: '1.0',
|
|
97
|
+
paidPrice: '1.1',
|
|
98
|
+
installment: 1,
|
|
99
|
+
paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
|
|
100
|
+
basketId: 'B67832',
|
|
101
|
+
paymentGroup: Iyzipay::Model::PaymentGroup::SUBSCRIPTION,
|
|
102
|
+
currency: Iyzipay::Model::Currency::TRY,
|
|
103
|
+
paymentCard: payment_card,
|
|
104
|
+
buyer: buyer,
|
|
105
|
+
billingAddress: address,
|
|
106
|
+
shippingAddress: address,
|
|
107
|
+
basketItems: [item1, item2, item3]
|
|
108
|
+
}
|
|
109
|
+
payment = Iyzipay::Model::Payment.new.create(request, @options)
|
|
110
|
+
begin
|
|
111
|
+
$stderr.puts payment.inspect
|
|
112
|
+
rescue
|
|
113
|
+
$stderr.puts 'oops'
|
|
114
|
+
raise
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
```
|
|
118
|
+
See other samples under iyzipay-ruby/spec module.
|
|
119
|
+
|
|
120
|
+
Testing
|
|
121
|
+
=======
|
|
122
|
+
|
|
123
|
+
You can run specs with RSpec under spec module.
|
data/Rakefile
ADDED
data/contributors
ADDED
data/iyzipay.gemspec
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require 'iyzipay/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = 'iyzipay-zebramo'
|
|
7
|
+
s.version = Iyzipay::VERSION
|
|
8
|
+
s.platform = Gem::Platform::RUBY
|
|
9
|
+
s.required_ruby_version = '>= 1.9.3'
|
|
10
|
+
s.summary = 'A Fork of iyzipay API Ruby Client'
|
|
11
|
+
s.description = ''
|
|
12
|
+
s.authors = ['Iyzico', 'Zebramo']
|
|
13
|
+
s.email = 'dev@zebramo.com'
|
|
14
|
+
s.files = `git ls-files`.split("\n")
|
|
15
|
+
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
|
16
|
+
s.homepage = 'http://rubygems.org/gems/iyzipay-zebramo'
|
|
17
|
+
s.license = 'MIT'
|
|
18
|
+
|
|
19
|
+
s.add_runtime_dependency 'rest-client', '~> 2.0'
|
|
20
|
+
s.add_development_dependency 'rspec', '~> 3.3', '>= 3.3.0'
|
|
21
|
+
s.add_development_dependency 'rspec-rails', '~> 3.3', '>= 3.3.0'
|
|
22
|
+
|
|
23
|
+
s.require_paths = ['lib']
|
|
24
|
+
end
|
data/lib/Iyzipay.rb
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# coding: utf-8
|
|
3
|
+
|
|
4
|
+
require 'json'
|
|
5
|
+
require 'rest-client'
|
|
6
|
+
require 'base64'
|
|
7
|
+
|
|
8
|
+
module Iyzipay
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
require_relative 'iyzipay/http_client'
|
|
12
|
+
require_relative 'iyzipay/pki_builder'
|
|
13
|
+
require_relative 'iyzipay/iyzipay_resource'
|
|
14
|
+
require_relative 'iyzipay/model'
|
|
15
|
+
require_relative 'iyzipay/options'
|
|
16
|
+
require_relative 'iyzipay/version'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Iyzipay
|
|
2
|
+
class HttpClient
|
|
3
|
+
def self.get(url, header={})
|
|
4
|
+
RestClient.get(url, header)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.post(url, header, content)
|
|
8
|
+
RestClient.post(url, content, header)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.put(url, header, content)
|
|
12
|
+
RestClient.put(url, content, header)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.delete(url, headers={}, content, &block)
|
|
16
|
+
RestClient::Request.execute(:method => :delete, :url => url, :payload => content, :headers => headers, &block)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
module Iyzipay
|
|
2
|
+
class IyzipayResource
|
|
3
|
+
|
|
4
|
+
AUTHORIZATION_HEADER_NAME = 'Authorization'
|
|
5
|
+
RANDOM_HEADER_NAME = 'x-iyzi-rnd';
|
|
6
|
+
AUTHORIZATION_HEADER_STRING = 'IYZWS %s:%s'
|
|
7
|
+
RANDOM_STRING_SIZE = 8
|
|
8
|
+
RANDOM_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
9
|
+
|
|
10
|
+
def get_http_header(pki_string = nil, options = nil, authorize_request = true)
|
|
11
|
+
header = {:accept => 'application/json',
|
|
12
|
+
:'content-type' => 'application/json'}
|
|
13
|
+
|
|
14
|
+
if authorize_request
|
|
15
|
+
random_header_value = random_string(RANDOM_STRING_SIZE)
|
|
16
|
+
header[:'Authorization'] = "#{prepare_authorization_string(pki_string, random_header_value, options)}"
|
|
17
|
+
header[:'x-iyzi-rnd'] = "#{random_header_value}"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
header
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def get_plain_http_header
|
|
24
|
+
get_http_header(nil, false)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def prepare_authorization_string(pki_string, random_header_value, options)
|
|
28
|
+
hash_digest = calculate_hash(pki_string, random_header_value, options)
|
|
29
|
+
format_header_string(options.api_key, hash_digest)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def json_decode(response, raw_result)
|
|
33
|
+
json_result = JSON::parse(raw_result)
|
|
34
|
+
response.from_json(json_result)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def calculate_hash(pki_string, random_header_value, options)
|
|
38
|
+
Digest::SHA1.base64digest("#{options.api_key}#{random_header_value}#{options.secret_key}#{pki_string}")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def format_header_string(*args)
|
|
42
|
+
sprintf(AUTHORIZATION_HEADER_STRING, *args)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def random_string(string_length)
|
|
46
|
+
random_string = ''
|
|
47
|
+
string_length.times do
|
|
48
|
+
random_string << RANDOM_CHARS.split('').sample
|
|
49
|
+
end
|
|
50
|
+
random_string
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def to_pki_string(request)
|
|
54
|
+
PkiBuilder.new.append(:locale, request[:locale]).
|
|
55
|
+
append(:conversationId, request[:conversationId]).
|
|
56
|
+
get_request_string
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module Model
|
|
2
|
+
end
|
|
3
|
+
|
|
4
|
+
require_relative 'model/address'
|
|
5
|
+
require_relative 'model/api_test'
|
|
6
|
+
require_relative 'model/approval'
|
|
7
|
+
require_relative 'model/basic_bkm'
|
|
8
|
+
require_relative 'model/basic_bkm_initialize'
|
|
9
|
+
require_relative 'model/basic_payment'
|
|
10
|
+
require_relative 'model/basic_payment_post_auth'
|
|
11
|
+
require_relative 'model/basic_payment_pre_auth'
|
|
12
|
+
require_relative 'model/basic_threeds_initialize'
|
|
13
|
+
require_relative 'model/basic_threeds_initialize_pre_auth'
|
|
14
|
+
require_relative 'model/basic_threeds_payment'
|
|
15
|
+
require_relative 'model/basket'
|
|
16
|
+
require_relative 'model/basket_item_type'
|
|
17
|
+
require_relative 'model/bin_number'
|
|
18
|
+
require_relative 'model/bkm'
|
|
19
|
+
require_relative 'model/bkm_initialize'
|
|
20
|
+
require_relative 'model/bounced_bank_transfer_list'
|
|
21
|
+
require_relative 'model/buyer'
|
|
22
|
+
require_relative 'model/cancel'
|
|
23
|
+
require_relative 'model/checkout_form'
|
|
24
|
+
require_relative 'model/checkout_form_initialize'
|
|
25
|
+
require_relative 'model/checkout_form_initialize_pre_auth'
|
|
26
|
+
require_relative 'model/cross_booking_from_sub_merchant'
|
|
27
|
+
require_relative 'model/cross_booking_to_sub_merchant'
|
|
28
|
+
require_relative 'model/disapproval'
|
|
29
|
+
require_relative 'model/installment_details'
|
|
30
|
+
require_relative 'model/installment_info'
|
|
31
|
+
require_relative 'model/installment_prices'
|
|
32
|
+
require_relative 'model/locale'
|
|
33
|
+
require_relative 'model/payment'
|
|
34
|
+
require_relative 'model/payment_card'
|
|
35
|
+
require_relative 'model/payment_channel'
|
|
36
|
+
require_relative 'model/payment_group'
|
|
37
|
+
require_relative 'model/payment_post_auth'
|
|
38
|
+
require_relative 'model/payment_pre_auth'
|
|
39
|
+
require_relative 'model/payout_completed_transaction_list'
|
|
40
|
+
require_relative 'model/pecco_initialize'
|
|
41
|
+
require_relative 'model/pecco_payment'
|
|
42
|
+
require_relative 'model/refund'
|
|
43
|
+
require_relative 'model/refund_charged_from_merchant'
|
|
44
|
+
require_relative 'model/sub_merchant'
|
|
45
|
+
require_relative 'model/sub_merchant_type'
|
|
46
|
+
require_relative 'model/threeds_initialize'
|
|
47
|
+
require_relative 'model/threeds_initialize_pre_auth'
|
|
48
|
+
require_relative 'model/threeds_payment'
|
|
49
|
+
require_relative 'model/currency'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Iyzipay
|
|
2
|
+
module Model
|
|
3
|
+
class Address
|
|
4
|
+
def self.to_pki_string(request)
|
|
5
|
+
unless request.nil?
|
|
6
|
+
PkiBuilder.new.
|
|
7
|
+
append(:address, request[:address]).
|
|
8
|
+
append(:zipCode, request[:zipCode]).
|
|
9
|
+
append(:contactName, request[:contactName]).
|
|
10
|
+
append(:city, request[:city]).
|
|
11
|
+
append(:country, request[:country]).
|
|
12
|
+
get_request_string
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Iyzipay
|
|
2
|
+
module Model
|
|
3
|
+
class Approval < IyzipayResource
|
|
4
|
+
|
|
5
|
+
def create(request = {}, options)
|
|
6
|
+
pki_string = to_pki_string(request)
|
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/item/approve", get_http_header(pki_string, options), request.to_json)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def to_pki_string(request)
|
|
11
|
+
PkiBuilder.new.append_super(super).
|
|
12
|
+
append(:paymentTransactionId, request[:paymentTransactionId]).
|
|
13
|
+
get_request_string
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Iyzipay
|
|
2
|
+
module Model
|
|
3
|
+
class BasicBkm < IyzipayResource
|
|
4
|
+
|
|
5
|
+
def retrieve(request = {}, options)
|
|
6
|
+
pki_string = to_pki_string(request)
|
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/bkm/auth/detail", get_http_header(pki_string, options), request.to_json)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def to_pki_string(request)
|
|
11
|
+
PkiBuilder.new.append_super(super).
|
|
12
|
+
append(:token, request[:token]).
|
|
13
|
+
get_request_string
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|