doku_library 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/doku.rb +7 -4
  3. data/lib/properties.yml +16 -0
  4. metadata +33 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0b388e276becb87f607875636b8890330541e01
4
- data.tar.gz: 2216ee955167f7ca553a6dcbe4a5665912c6f1ff
3
+ metadata.gz: 42c01d18a6dcdeff101ff1814d60a09fc1872050
4
+ data.tar.gz: fc8e220877aaf1a8446c3f644b1f38f28b161203
5
5
  SHA512:
6
- metadata.gz: 0cf71ee26a3d33670ac7cafc9373b2b14cffb83b07ce203f90b6c59e70ccccba57be0c9e84361e22d8df596c45c445d7cc929ae2df04a2adc6799663eec9fe2d
7
- data.tar.gz: f716670aa8fb4c7b4c2a6132abbe8a52192c2e40b1b70df6d389eb976ebb52d954787480fad213ae1165ccf67b1fe4df7ff4bf5a3e0763da257dc6459a27b164
6
+ metadata.gz: c899f4d0fdefd488dba215276feb06ce495e08ae5b265ccc99602fa5643cd902b0c06a9c61da2dba7d2ec666aa2f2b876318627d12850fe5bf418e10e17ec666
7
+ data.tar.gz: ee187dfea97a791d2c0a42027fc2b3395828cf207691cadead68dac2e768c0bbf368e4221478aed231cd5947d0a05fd0ffe9c32dde9425070f9366dcbbfaded7
data/lib/doku.rb CHANGED
@@ -6,11 +6,16 @@ OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
6
6
  require 'yaml'
7
7
 
8
8
  class Doku
9
- @properties = YAML.load_file('properties.yml')
9
+ file_path = File.join(File.dirname(__FILE__),"properties.yml")
10
+ @properties = YAML.load_file(file_path)
10
11
  def self.get_times
11
12
  Time.now.strftime("%d%m%Y%H%M%S")
12
13
  end
13
14
 
15
+ def self.get_properties
16
+ @properties
17
+ end
18
+
14
19
  def self.do_sha1(data)
15
20
  Digest::SHA1.hexdigest(data)
16
21
  end
@@ -47,10 +52,8 @@ class Doku
47
52
  Digest::SHA1.hexdigest(data.with_indifferent_access[amount].to_s + data.with_indifferent_access[mall_id].to_s + sharekey + data.with_indifferent_access[trans_id].to_s + data.with_indifferent_access[currency].to_s + data.with_indifferent_access[device_id].to_s)
48
53
  end
49
54
  elsif data.with_indifferent_access[pairing_codes].to_s != ''
50
- # p '3 --> ' + data.with_indifferent_access[amount].to_s + ' ' + data.with_indifferent_access[mall_id].to_s + ' ' + sharekey + ' ' + data.with_indifferent_access[trans_id].to_s + ' ' + data.with_indifferent_access[currency].to_s + ' ' + data.with_indifferent_access[token].to_s + ' ' + data.with_indifferent_access[pairing_codes].to_s
51
55
  Digest::SHA1.hexdigest(data.with_indifferent_access[amount].to_s + data.with_indifferent_access[mall_id].to_s + sharekey + data.with_indifferent_access[trans_id].to_s + data.with_indifferent_access[currency].to_s + data.with_indifferent_access[token].to_s + data.with_indifferent_access[pairing_codes].to_s)
52
56
  elsif data.with_indifferent_access[currency].to_s != ''
53
- # p '4 --> ' + data.with_indifferent_access[amount].to_s + ' ' + data.with_indifferent_access[mall_id].to_s + ' ' + sharekey + ' ' + data.with_indifferent_access[trans_id].to_s + ' ' + data.with_indifferent_access[currency].to_s
54
57
  Digest::SHA1.hexdigest(data.with_indifferent_access[amount].to_s + data.with_indifferent_access[mall_id].to_s + sharekey + data.with_indifferent_access[trans_id].to_s + data.with_indifferent_access[currency].to_s)
55
58
  else
56
59
  Digest::SHA1.hexdigest(data.with_indifferent_access[amount].to_s + data.with_indifferent_access[mall_id].to_s + sharekey + data.with_indifferent_access[trans_id].to_s)
@@ -92,7 +95,7 @@ class Doku
92
95
 
93
96
  def self.do_direct_payment(param_data)
94
97
  if !param_data.nil?
95
- uri = URI.parse(@properties['direct_payment_url'])
98
+ uri = URI.parse(@properties['production']['direct_payment_url'])
96
99
  response = Net::HTTP.post_form(uri, {"data" => param_data})
97
100
  response.body
98
101
  end
@@ -0,0 +1,16 @@
1
+ production:
2
+ environment: production
3
+ share_key: D0Ku123m3Rc
4
+ prepayment_url: https://staging.doku.com/api/payment/PrePayment
5
+ payment_url: https://staging.doku.com/api/payment/paymentMip
6
+ direct_payment_url: https://staging.doku.com/api/payment/PaymentMIPDirect
7
+ generate_code_url: https://staging.doku.com/api/payment/doGeneratePaymentCode
8
+ redirect_payment_url: https://staging.doku.com/api/payment/doInitiatePayment
9
+ development:
10
+ environment: sandbox
11
+ share_key: D0Ku123m3Rc
12
+ prepayment_url: https://staging.doku.com/api/payment/PrePayment
13
+ payment_url: https://staging.doku.com/api/payment/paymentMip
14
+ direct_payment_url: https://staging.doku.com/api/payment/PaymentMIPDirect
15
+ generate_code_url: https://staging.doku.com/api/payment/doGeneratePaymentCode
16
+ redirect_payment_url: https://staging.doku.com/api/payment/doInitiatePayment
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doku_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codeplush
@@ -9,7 +9,35 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2016-11-06 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: digest/sha1
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: net/http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  description: Doku Payment Gateway for ruby (rails)
14
42
  email: codeplush@gmail.com
15
43
  executables: []
@@ -17,6 +45,7 @@ extensions: []
17
45
  extra_rdoc_files: []
18
46
  files:
19
47
  - lib/doku.rb
48
+ - lib/properties.yml
20
49
  homepage: http://codeplush.com
21
50
  licenses:
22
51
  - MIT
@@ -29,12 +58,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
29
58
  requirements:
30
59
  - - ">="
31
60
  - !ruby/object:Gem::Version
32
- version: '0'
61
+ version: 2.2.4
33
62
  required_rubygems_version: !ruby/object:Gem::Requirement
34
63
  requirements:
35
64
  - - ">="
36
65
  - !ruby/object:Gem::Version
37
- version: '0'
66
+ version: 2.6.7
38
67
  requirements: []
39
68
  rubyforge_project:
40
69
  rubygems_version: 2.6.7