mellat 0.1.3.7.5 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29a66deb91ca122f41d4d22057c18a1e67c0c290
4
- data.tar.gz: 5ba94e79d9ca1543b6cacec7377663a14c53022f
3
+ metadata.gz: e6c57b69bb837674c81594d802acbc4161312291
4
+ data.tar.gz: 0978338621d321fcee00e5bf6a21937eb84ca672
5
5
  SHA512:
6
- metadata.gz: 7bc26fd641c3193aa8394ad52ecf8e7c06893700be15eab69ccc69d00fe0fe896143958da50bc608f13c9ec805a82cf90399907716c10ac954e6fef10f3291f5
7
- data.tar.gz: 3fa71e5f2680afbd9fec3d24ae94fd3b13801f832fe4285d7faea4b0459aa58c177f4a6b80df693658bb2787ca9772884e5990092cc1a406e250c3e7e8359723
6
+ metadata.gz: 5682b7373e4f64353db87f8be2eeefb1fcfc7740569ceda98a5748d5b64e6b592ee04a2a693970b31a3b67386585807cd290662c32d1a813456441881c00581e
7
+ data.tar.gz: 46b0806c8d29d4733fa10a2ed3c3def16ba4bbcb103b3827fdca0705db5204821099fb83d9aa6a98c7b5579ba1ffafb72764b5a0db1aa2ca0991b8bb9440e549
data/.gitignore CHANGED
@@ -7,4 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- /.idea/
10
+ /.idea/
11
+ /.gem
@@ -1,8 +1,7 @@
1
1
  require "mellat/version"
2
2
  require "mellat/requisition"
3
- require "mellat/verification"
4
- require 'mellat/verify_rquest_respond'
5
3
  require "mellat/respond"
4
+ require "mellat/plug/bank_name"
6
5
 
7
6
  module Mellat
8
7
 
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+ require 'mellat/plug/unique_bank_code'
3
+ module Mellat
4
+
5
+ module BankName
6
+ def to_bank
7
+ id=self.to_s[0...6]
8
+ return Mellat::UniqueBankCode::IDS[id]
9
+ end
10
+ end
11
+
12
+ end
13
+
14
+ class Integer
15
+ # Patch Integer class to include `to_bank` method
16
+ include Mellat::BankName
17
+
18
+ end
19
+
20
+ class String
21
+ # Patch Integer class to include `to_bank` method
22
+ include Mellat::BankName
23
+ end
@@ -16,8 +16,8 @@ module Mellat
16
16
 
17
17
  def refID
18
18
  @RefID.to_s
19
-
20
19
  end
20
+
21
21
  private
22
22
 
23
23
  def perform_validation
@@ -27,6 +27,6 @@ module Mellat
27
27
  @RefID = @status.split(',')[1] if @valid
28
28
  end
29
29
 
30
- end
30
+ end
31
31
 
32
32
  end
@@ -1,5 +1,5 @@
1
1
  module Mellat
2
2
 
3
- VERSION = "0.1.3.7.5"
3
+ VERSION = "0.1.5"
4
4
 
5
5
  end
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  # to allow pushing to a single host or delete this section to allow pushing to any host.
18
18
 
19
19
  spec.add_dependency 'savon', ['~> 2.0']
20
+ spec.add_dependency 'i18n', ['~> 0.8.0']
20
21
 
21
22
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
22
23
  f.match(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mellat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.7.5
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - mohammad mahmoudi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-11 00:00:00.000000000 Z
11
+ date: 2017-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: i18n
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.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.8.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +88,6 @@ extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
76
90
  - ".gitignore"
77
- - ".idea/vcs.xml"
78
91
  - CODE_OF_CONDUCT.md
79
92
  - Gemfile
80
93
  - LICENSE.txt
@@ -86,16 +99,11 @@ files:
86
99
  - lib/generators/mellat/install_generator.rb
87
100
  - lib/generators/templates/mellat_initializer.rb
88
101
  - lib/mellat.rb
102
+ - lib/mellat/plug/bank_name.rb
89
103
  - lib/mellat/plug/unique_bank_code.rb
90
104
  - lib/mellat/requisition.rb
91
105
  - lib/mellat/respond.rb
92
- - lib/mellat/verification.rb
93
- - lib/mellat/verify_rquest_respond.rb
94
106
  - lib/mellat/version.rb
95
- - mellat-0.1.3.2.gem
96
- - mellat-0.1.3.3.gem
97
- - mellat-0.1.3.4.gem
98
- - mellat-0.1.3.5.gem
99
107
  - mellat.gemspec
100
108
  homepage: https://github.com/mm580486/mellat
101
109
  licenses:
@@ -1,50 +0,0 @@
1
- require "savon"
2
-
3
- module Mellat
4
-
5
- class BpVerifyRequest
6
- attr_accessor :orderId, :saleOrderId, :saleReferenceId,:status
7
- attr_reader :respond
8
-
9
- def initialize(args = {})
10
- @orderId = args.fetch(:orderId)
11
- @saleOrderId = args.fetch(:saleOrderId)
12
- @saleReferenceId = args.fetch(:saleReferenceId)
13
- @terminalId = Mellat.configuration.terminalId
14
- @userName = Mellat.configuration.userName
15
- @userPassword = Mellat.configuration.userPassword
16
- @wsdl = Savon.client(wsdl: Mellat.configuration.wsdl, pretty_print_xml: true,namespace: 'http://interfaces.core.sw.bps.com/')
17
- @response = RespondBpPayVerificationRequest.new()
18
-
19
- end
20
-
21
- def call
22
- response = @wsdl.call :bp_verify_request, message: {
23
- 'terminalId' => @terminalId,
24
- 'userName' => @userName,
25
- 'userPassword' => @userPassword,
26
- 'orderId' => @orderId,
27
- 'saleOrderId' => @saleOrderId,
28
- 'saleReferenceId'=> @saleReferenceId,
29
- }
30
- @response.validate(response.body)
31
- end
32
-
33
- def bpSettleRequest
34
- response = @wsdl.call :bp_settle_request, message: {
35
- 'terminalId' => @terminalId,
36
- 'userName' => @userName,
37
- 'userPassword' => @userPassword,
38
- 'orderId' => @orderId,
39
- 'saleOrderId' => @saleOrderId,
40
- 'saleReferenceId'=> @saleReferenceId,
41
- }
42
-
43
- @response.validate_settle(response.body)
44
- end
45
-
46
-
47
-
48
- end
49
-
50
- end
@@ -1,42 +0,0 @@
1
- module Mellat
2
-
3
- class RespondBpPayVerificationRequest
4
-
5
- attr_reader :respond, :status,:statusmessage,:status_settle
6
- def validate(response = nil)
7
- @response = response
8
- perform_validation
9
- return self
10
- end
11
-
12
- def validate_settle(response = nil)
13
- @response = response
14
- perform_validation_settle
15
- return self
16
- end
17
-
18
- def valid?
19
- @valid
20
- end
21
-
22
- private
23
-
24
- def perform_validation
25
- raise ArgumentError, 'not a valid response' if @response.nil?
26
- @status = @response[:bp_verify_request_response][:return]
27
- @valid = (@status.to_i==0)
28
- end
29
-
30
- def perform_validation_settle
31
- raise ArgumentError, 'not a valid response' if @response.nil?
32
- @status = @response[:bp_settle_request_response][:return]
33
- @valid = (@status.to_i==45)
34
- end
35
-
36
-
37
-
38
-
39
-
40
- end
41
-
42
- end
Binary file
Binary file
Binary file
Binary file