paygent 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,3 +23,4 @@ module Paygent
23
23
  end
24
24
 
25
25
  require "paygent/request"
26
+ require "paygent/service"
@@ -45,10 +45,11 @@ module Paygent
45
45
  end
46
46
 
47
47
  def post
48
- # $this->replaceTelegramKana();
49
- # $this->validateTelegramLengthCheck();
48
+ telegram_kind = params[:telegram_kind]
49
+ base_url = Paygent::Service.get_url_with_telegram_kind(params[:telegram_kind])
50
+ log("Can't found related paygent URL with #{telegram_kind}") unless base_url
50
51
 
51
- url = "https://mdev.paygent.co.jp/n/card/request?" + params_str
52
+ url = "#{base_url}?#{params_str}"
52
53
  c = Curl::Easy.new(url)
53
54
  c.cacert = Paygent.ca_file_path
54
55
  c.cert = Paygent.client_file_path
@@ -0,0 +1,50 @@
1
+ module Paygent
2
+ class Service
3
+ @@url ||= {}
4
+
5
+ ###ATM決済URL###
6
+ @@url["01"] ||= "https://mdev.paygent.co.jp/n/atm/request"
7
+ ###クレジットカード決済URL1###
8
+ @@url["02"] ||= "https://mdev.paygent.co.jp/n/atm/request"
9
+ ###クレジットカード決済URL2###
10
+ @@url["11"] ||= "https://mdev.paygent.co.jp/n/card/request"
11
+ ###コンビニ番号方式決済URL###
12
+ @@url["03"] ||= "https://mdev.paygent.co.jp/n/conveni/request"
13
+ ###コンビニ帳票方式決済URL###
14
+ @@url["04"] ||= "https://mdev.paygent.co.jp/n/conveni/request_print"
15
+ ###銀行ネット決済URL###
16
+ @@url["05"] ||= "https://mdev.paygent.co.jp/n/bank/request"
17
+ ###銀行ネット決済ASPURL###
18
+ @@url["06"] ||= "https://mdev.paygent.co.jp/n/bank/requestasp"
19
+ ###仮想口座決済URL###
20
+ @@url["07"] ||= "https://mdev.paygent.co.jp/n/virtualaccount/request"
21
+ ###決済情報照会URL###
22
+ @@url["09"] ||= "https://mdev.paygent.co.jp/n/ref/request"
23
+ ###決済情報差分照会URL###
24
+ @@url["091"] ||= "https://mdev.paygent.co.jp/n/ref/paynotice"
25
+ ###キャリア継続課金差分照会URL###
26
+ @@url["093"] ||= "https://mdev.paygent.co.jp/n/ref/runnotice"
27
+ ###携帯キャリア決済URL###
28
+ @@url["10"] ||= "https://mdev.paygent.co.jp/n/c/request"
29
+ ###携帯キャリア決済URL(継続課金用)###
30
+ @@url["12"] ||= "https://mdev.paygent.co.jp/n/c/request"
31
+ ###ファイル決済URL###
32
+ @@url["20"] ||= "https://mdev.paygent.co.jp/n/o/requestdata"
33
+ ###PayPal決済URL###
34
+ @@url["13"] ||= "https://mdev.paygent.co.jp/n/paypal/request"
35
+ ###電子マネー決済URL###
36
+ @@url["15"] ||= "https://mdev.paygent.co.jp/n/emoney/request"
37
+
38
+ def self.set_url(kind, url)
39
+ @@url[kind.to_s] = url
40
+ end
41
+
42
+ def self.get_url_with_telegram_kind(kind)
43
+ kind_str = kind.to_s
44
+ return @@url[kind_str] if @@url[kind_str]
45
+ kind_str.sub!(/\w$/,'')
46
+ return @@url[kind_str] if @@url[kind_str]
47
+ return false
48
+ end
49
+ end
50
+ end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "paygent"
6
- s.version = "0.0.4"
6
+ s.version = "0.0.5"
7
7
  s.authors = ["Jinzhu"]
8
8
  s.email = ["wosmvp@gmail.com"]
9
9
  s.homepage = ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paygent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-24 00:00:00.000000000 Z
12
+ date: 2012-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb
16
- requirement: &13638180 !ruby/object:Gem::Requirement
16
+ requirement: &13479660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13638180
24
+ version_requirements: *13479660
25
25
  description: Ruby wrapper for paygent
26
26
  email:
27
27
  - wosmvp@gmail.com
@@ -37,6 +37,7 @@ files:
37
37
  - lib/paygent/entity.rb
38
38
  - lib/paygent/exception.rb
39
39
  - lib/paygent/request.rb
40
+ - lib/paygent/service.rb
40
41
  - lib/paygent/util.rb
41
42
  - paygent.gemspec
42
43
  homepage: ''
@@ -59,9 +60,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
60
  version: '0'
60
61
  requirements: []
61
62
  rubyforge_project: paygent
62
- rubygems_version: 1.8.10
63
+ rubygems_version: 1.8.15
63
64
  signing_key:
64
65
  specification_version: 3
65
66
  summary: Ruby wrapper for paygent
66
67
  test_files: []
67
- has_rdoc: