jpay 0.0.4 → 0.0.5
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 +4 -4
- data/jpay.gemspec +3 -3
- data/lib/generators/jpay/install_generator.rb +1 -1
- data/lib/jpay/errors.rb +14 -13
- data/lib/jpay/payment_request.rb +2 -1
- data/lib/jpay/payment_verification.rb +2 -1
- data/lib/jpay/version.rb +1 -1
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 613e356d30126c0f94edb864239d0b9d5dddcc95
|
4
|
+
data.tar.gz: 140eef4727b936e336507ebe820a68eabc40b6db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31ff0e638d0c6c5f8f90ace4a016909d76a3c36fcf9e48641084025e31a3bcff649fd8e77260df4a4eae0d8e0aabb8151918ccd2fb85aaf966b54ee994065ef8
|
7
|
+
data.tar.gz: a403e6dcf845d33ddb2508e675d4ef92aed057ed4bff310b6f1218f1c2f716151e86f0cb33070568b287c41d39fa12b1637ea0c0c797a5737f534b95d02214a8
|
data/jpay.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Jpay::VERSION
|
9
9
|
spec.authors = ["Reza Morsali"]
|
10
10
|
spec.email = ["light.reza@gmail.com"]
|
11
|
-
spec.summary = %q{JahanPay payment gem}
|
12
|
-
spec.description = %q{JahanPay
|
11
|
+
spec.summary = %q{JahanPay payment gateway gem for rails}
|
12
|
+
spec.description = %q{the Jpay gem provides Ruby APIs for proccessing payments, transactions and verifications using JahanPay's Merchant APIs. For more information please visit JahanPay website}
|
13
13
|
spec.homepage = "https://github.com/rezam90/jpay"
|
14
14
|
spec.license = "MIT"
|
15
15
|
# spec.required_ruby_version = '~> 2.0.0'
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.
|
22
|
+
spec.add_runtime_dependency "savon", '~> 2.11', '>= 2.11.1'
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -8,7 +8,7 @@ module Jpay
|
|
8
8
|
|
9
9
|
def copy_initializer
|
10
10
|
template "jpay_initializer.rb", "config/initializers/jpay.rb"
|
11
|
-
|
11
|
+
puts "please config your gateway at: config/initializers/jpay.rb"
|
12
12
|
# puts "add 'callback_url' to config/initializers/jpay.rb"
|
13
13
|
puts "Install complete!"
|
14
14
|
|
data/lib/jpay/errors.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module Jpay
|
2
3
|
module Errors
|
3
4
|
IDS = {
|
4
|
-
'-32' => '
|
5
|
-
'-31' => '
|
6
|
-
'-30' => '
|
7
|
-
'-29' => '
|
8
|
-
'-27' => '
|
9
|
-
'-26' => '
|
10
|
-
'-24' => '
|
11
|
-
'-23' => '
|
12
|
-
'-22' => '
|
13
|
-
'-21' => '
|
14
|
-
'-20' => '
|
15
|
-
'-6' => '
|
16
|
-
'-9' => '
|
5
|
+
'-32' => 'مبلغ وارد شده مطابقت ندارد',
|
6
|
+
'-31' => 'پرداخت ناموفق',
|
7
|
+
'-30' => 'پرداخت نامعتبر',
|
8
|
+
'-29' => 'لینک بازگشت تعیین نشده است',
|
9
|
+
'-27' => 'IP شما مسدود شده است',
|
10
|
+
'-26' => 'درگاه غیر فعال شده است',
|
11
|
+
'-24' => 'مبلغ نامعتبر است',
|
12
|
+
'-23' => 'مبلغ زیاد است',
|
13
|
+
'-22' => 'مبلغ باید بیشتر از 100 تومان باشد',
|
14
|
+
'-21' => 'IP برای درگاه نامعتبر است',
|
15
|
+
'-20' => 'API نامعتبر است',
|
16
|
+
'-6' => 'خطای ارتباط با بانک',
|
17
|
+
'-9' => 'خطای سیستمی',
|
17
18
|
}
|
18
19
|
end
|
19
20
|
end
|
data/lib/jpay/payment_request.rb
CHANGED
@@ -17,6 +17,7 @@ module Jpay
|
|
17
17
|
# @option args [string] :text payment description
|
18
18
|
|
19
19
|
def initialize(args = {})
|
20
|
+
@api = args[:api] || Jpay.configuration.api
|
20
21
|
@amount = args[:amount]
|
21
22
|
@callback_url = args[:callback_url] || Jpay.configuration.callback_url
|
22
23
|
@order_id = args[:order_id]
|
@@ -27,7 +28,7 @@ module Jpay
|
|
27
28
|
|
28
29
|
def pay
|
29
30
|
response = @client.call :requestpayment, message: {
|
30
|
-
'api' =>
|
31
|
+
'api' => @api,
|
31
32
|
'amount' => @amount,
|
32
33
|
'callback' => @callback_url,
|
33
34
|
'orderid' => @order_id,
|
@@ -13,6 +13,7 @@ module Jpay
|
|
13
13
|
# @option args [String] :authority Authority code returned by verify url params
|
14
14
|
# @option args [Integer] :amount price of the request
|
15
15
|
def initialize(args = {})
|
16
|
+
@api = args.fetch(:api) || Jpay.configuration.api
|
16
17
|
@authority = args.fetch(:authority)
|
17
18
|
@amount = args.fetch(:amount)
|
18
19
|
@client ||= Savon.client(wsdl: Jpay.configuration.client, pretty_print_xml: true)
|
@@ -24,7 +25,7 @@ module Jpay
|
|
24
25
|
# @return [Jpay::Response]
|
25
26
|
def verify
|
26
27
|
response = @client.call :verification, message: {
|
27
|
-
'api' =>
|
28
|
+
'api' => @api,
|
28
29
|
'amount' => @amount,
|
29
30
|
'authority' => @authority,
|
30
31
|
}
|
data/lib/jpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reza Morsali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.11'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 2.11.1
|
20
23
|
type: :runtime
|
@@ -22,6 +25,9 @@ dependencies:
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.11'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 2.11.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
@@ -52,7 +58,9 @@ dependencies:
|
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '10.0'
|
55
|
-
description:
|
61
|
+
description: the Jpay gem provides Ruby APIs for proccessing payments, transactions
|
62
|
+
and verifications using JahanPay's Merchant APIs. For more information please visit
|
63
|
+
JahanPay website
|
56
64
|
email:
|
57
65
|
- light.reza@gmail.com
|
58
66
|
executables: []
|
@@ -97,5 +105,5 @@ rubyforge_project:
|
|
97
105
|
rubygems_version: 2.4.8
|
98
106
|
signing_key:
|
99
107
|
specification_version: 4
|
100
|
-
summary: JahanPay payment gem
|
108
|
+
summary: JahanPay payment gateway gem for rails
|
101
109
|
test_files: []
|