mellat 0.1.3.6.7 → 0.1.3.6.8

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: 14a760c68faaa37e581d3836c07be6626ef41cc1
4
- data.tar.gz: 1bf7d43611f7d9fcf30a755af7ae4be775036204
3
+ metadata.gz: 8f5c6f5f4c5c00c944836d9a61b5227d861ee0ec
4
+ data.tar.gz: c5099071195f670c464efdb98ccbd7fe2960fb89
5
5
  SHA512:
6
- metadata.gz: cc58d1007b2fbc5c89581c15fa6a699aab607dc572d5fc14dde497f015f7c56554b2364d1a8ee3dbc11c67a6c93ea31dd7f933209d58382b979975b2736964f0
7
- data.tar.gz: a124f59ffe58bef0bf8e74790d6a89b2fce4044a07069375eb694ce760f3c2d8ce87e6abff023616cfc3fcac1df6f323e8debf7a5753cfe1cae504314feff64d
6
+ metadata.gz: 176986fd190ce601b8d80bb73940f0c1979993460fb6337799f5ef0fc3cc88feb20d9ee0f101659636ea5a3641168485d3e0ef50887cdc67d61639bfea21e42a
7
+ data.tar.gz: 9b5cdf637e60cec664e8de54be8074380a6f14ddf5dd9d9a6f9f9a4e0e1142833444bd78779c51cfd96542bc6907f416aafcfd4b25b59eb52735c3e4b0c1cdc4
data/lib/mellat.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "mellat/version"
2
2
  require "mellat/requisition"
3
+ require "mellat/verification"
3
4
  require "mellat/respond"
4
5
 
5
6
  module Mellat
@@ -0,0 +1,42 @@
1
+ require "savon"
2
+
3
+ module Mellat
4
+
5
+ class BpPayVerification
6
+ attr_accessor :orderId, :amount, :localDate, :localTime, :additionalData, :payerId, :callBackUrl
7
+ attr_reader :respond
8
+
9
+ def initialize(args = {})
10
+ @orderId = args.fetch(:orderId)
11
+ @amount = args.fetch(:amount)
12
+ @localDate = args.fetch(:localDate,Time.now.strftime("%Y%d%m"))
13
+ @localTime = args.fetch(:localTime,Time.now.strftime("%H%M%S"))
14
+ @additionalData = args.fetch(:additionalData,' ')
15
+ @payerId = args.fetch(:payerId,0)
16
+ @callBackUrl = args.fetch(:callBackUrl,Mellat.configuration.callBackUrl)
17
+ @terminalId = Mellat.configuration.terminalId
18
+ @userName = Mellat.configuration.userName
19
+ @userPassword = Mellat.configuration.userPassword
20
+ @wsdl = Savon.client(wsdl: Mellat.configuration.wsdl, pretty_print_xml: true,namespace: 'http://interfaces.core.sw.bps.com/')
21
+ @response = RespondBpPayRequest.new()
22
+ end
23
+
24
+ def call
25
+ response = @wsdl.call :bp_pay_request, message: {
26
+ 'terminalId' => @terminalId,
27
+ 'userName' => @userName,
28
+ 'userPassword' => @userPassword,
29
+ 'orderId' => @orderId,
30
+ 'amount' => @amount,
31
+ 'localDate' => @localDate.to_s,
32
+ 'localTime' => @localTime.to_s,
33
+ 'additionalData' => @additionalData,
34
+ 'payerId' => @payerId,
35
+ 'callBackUrl' => @callBackUrl
36
+ }
37
+ @response.validate(response.body)
38
+ end
39
+
40
+ end
41
+
42
+ end
@@ -1,5 +1,5 @@
1
1
  module Mellat
2
2
 
3
- VERSION = "0.1.3.6.7"
3
+ VERSION = "0.1.3.6.8"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mellat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.6.7
4
+ version: 0.1.3.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - mohammad mahmoudi
@@ -89,6 +89,7 @@ files:
89
89
  - lib/mellat/plug/unique_bank_code.rb
90
90
  - lib/mellat/requisition.rb
91
91
  - lib/mellat/respond.rb
92
+ - lib/mellat/verification.rb
92
93
  - lib/mellat/version.rb
93
94
  - mellat-0.1.3.2.gem
94
95
  - mellat-0.1.3.3.gem