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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2772e443f17b080d453f47ee2c232f222be94d33
4
- data.tar.gz: 59f6bea6843f2c19ccf3a55581f2af996ef81ea9
3
+ metadata.gz: 613e356d30126c0f94edb864239d0b9d5dddcc95
4
+ data.tar.gz: 140eef4727b936e336507ebe820a68eabc40b6db
5
5
  SHA512:
6
- metadata.gz: 85fea9f9834a1a5e3f647cc2489fa3b678e2f04fedd6c62653f6e2854789f8d58b754750efb52694cba8456d93de7f3acddb2d6b31dc7eaccf191346bb2c7213
7
- data.tar.gz: 77234201540516829c6ed2b8036bac60fcd1802e5c1929f6960094c5104bd295e56e5bfc591f27077d626d3cd3a1feb0fa2de7ca72f70af4d148a4e6541421eb
6
+ metadata.gz: 31ff0e638d0c6c5f8f90ace4a016909d76a3c36fcf9e48641084025e31a3bcff649fd8e77260df4a4eae0d8e0aabb8151918ccd2fb85aaf966b54ee994065ef8
7
+ data.tar.gz: a403e6dcf845d33ddb2508e675d4ef92aed057ed4bff310b6f1218f1c2f716151e86f0cb33070568b287c41d39fa12b1637ea0c0c797a5737f534b95d02214a8
@@ -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 payment gem}
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.add_dependency "savon", "~> 2.11.1"
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
- # puts "add your Jahanpay 'api' to config/initializers/jpay.rb"
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
 
@@ -1,19 +1,20 @@
1
+ # encoding: utf-8
1
2
  module Jpay
2
3
  module Errors
3
4
  IDS = {
4
- '-32' => 'Amount does not match',
5
- '-31' => 'Unsuccessful transaction',
6
- '-30' => 'Invalid transaction',
7
- '-29' => 'CallBack was not specified',
8
- '-27' => 'your IP is blocked',
9
- '-26' => 'Gateway is deactivated',
10
- '-24' => 'Invalid amount',
11
- '-23' => 'Too much amount',
12
- '-22' => 'Amount should be greater than 100 Toman',
13
- '-21' => 'Invalid IP for this Gateway',
14
- '-20' => 'Invalid API',
15
- '-6' => 'Bank connection error',
16
- '-9' => 'System error',
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
@@ -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' => Jpay.configuration.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' => Jpay.configuration.api,
28
+ 'api' => @api,
28
29
  'amount' => @amount,
29
30
  'authority' => @authority,
30
31
  }
@@ -1,3 +1,3 @@
1
1
  module Jpay
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-22 00:00:00.000000000 Z
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: JahanPay payment gem
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: []