paya 0.9.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/paya.rb +5 -1
- data/lib/paya/base.rb +21 -35
- data/lib/paya/version.rb +1 -1
- data/paya.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 280044176ed7f32b10a574989da8ce082e7afc9e
|
4
|
+
data.tar.gz: 41251798b257c3914d5686134feefc8465633677
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81bdc5ccae0731499557ad46e311e5924e89a0ce304628574435d9bd6e564d2550aeafdfa3bc5160df05fd59d874b0dc5a2df5668cec5090b971e07850314da6
|
7
|
+
data.tar.gz: 1326bf96f99bb8eb325ee5bf22079556193b6c2407a756575509a6c02c434aeb8cadafcddc9fbf3dcce7b70a0b7140275781e2a13c7d417e5c0d4d50048cdad9
|
data/.gitignore
CHANGED
data/lib/paya.rb
CHANGED
@@ -96,10 +96,14 @@ xml
|
|
96
96
|
attr_accessor :user_name, :password, :production
|
97
97
|
|
98
98
|
def client
|
99
|
+
test_mode ? sandbox_client : live_client
|
100
|
+
end
|
101
|
+
|
102
|
+
def live_client
|
99
103
|
::Savon.client(wsdl: Paya::API_END_POINT)
|
100
104
|
end
|
101
105
|
|
102
|
-
def
|
106
|
+
def sandbox_client
|
103
107
|
::Savon.client(wsdl: Paya::CERTITICATION_API_END_POINT)
|
104
108
|
end
|
105
109
|
|
data/lib/paya/base.rb
CHANGED
@@ -12,61 +12,47 @@ module Paya
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def process_single_check options={}, terminal_id=nil, identifier='R'
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def process_single_check_with_token
|
19
|
-
Paya.production == true ? process_single_actual_check_with_token(options, terminal_id, identifier) : process_single_certification_check_with_token(options, terminal_id, identifier)
|
20
|
-
end
|
21
|
-
|
22
|
-
def get_archived_response request_id
|
23
|
-
@terminal_id = terminal_id.to_s
|
24
|
-
xml = Paya::GET_ARCHIVED_RESPONSE.gsub("&&&REQUEST_ID&&&", request_id).gsub("&&&TERMINAL_ID&&&", @terminal_id).gsub("&&&USER_NAME&&&", Paya.user_name).gsub("&&&PASSWORD", Paya.password)
|
25
|
-
response = Paya.client.call(:get_archived_response, xml: xml)
|
26
|
-
response = Hash.from_xml(response.body[:get_archived_response])
|
27
|
-
{request: xml, response: response}
|
28
|
-
end
|
29
|
-
|
30
|
-
alias_method :archived, :get_archived_response
|
31
|
-
alias_method :get_archived, :get_archived_response
|
32
|
-
alias_method :archived_response, :get_archived_response
|
33
|
-
|
34
|
-
def process_single_actual_check options={}, terminal_id=nil, identifier='R'
|
15
|
+
=begin
|
35
16
|
@terminal_id = terminal_id.to_s
|
36
17
|
@data_packet = data_packet(options, identifier)
|
37
18
|
xml = Paya::PROCESS_SINGLE_CHECK.gsub("&&&DATA_PACKET&&&", @data_packet).gsub("&&&TERMINAL_ID&&&", @terminal_id).gsub("&&&USER_NAME&&&", Paya.user_name).gsub("&&&PASSWORD&&&", Paya.password)
|
38
|
-
response = Paya.client.call(:
|
39
|
-
|
40
|
-
{request: xml, response:
|
19
|
+
response = Paya.client.call(:process_single_certification_check, xml: xml)
|
20
|
+
response_hash = Hash.from_xml(response.body[:process_single_certification_check_response][:process_single_check_result])
|
21
|
+
{request: xml, response: response_hash}
|
22
|
+
=end
|
23
|
+
process_single_certification_check options, terminal_id, identifier
|
41
24
|
end
|
42
25
|
|
43
|
-
def
|
26
|
+
def process_single_check_with_token
|
44
27
|
@terminal_id = terminal_id.to_s
|
45
28
|
@data_packet = data_packet(options, identifier)
|
46
29
|
xml = Paya::PROCESS_SINGLE_CERTIFICATION_CHECK.gsub("&&&DATA_PACKET&&&", @data_packet).gsub("&&&TERMINAL_ID&&&", @terminal_id).gsub("&&&USER_NAME&&&", Paya.user_name).gsub("&&&PASSWORD&&&", Paya.password)
|
47
|
-
response = Paya.
|
48
|
-
|
49
|
-
{request: xml, response:
|
30
|
+
response = Paya.client.call(:process_single_certification_check, xml: xml)
|
31
|
+
response_hash = Hash.from_xml(response.body[:process_single_certification_check_response][:process_single_certification_check_result])
|
32
|
+
{request: xml, response: response_hash}
|
50
33
|
end
|
51
34
|
|
52
|
-
def
|
35
|
+
def process_single_certification_check options={}, terminal_id=nil, identifier='R'
|
53
36
|
@terminal_id = terminal_id.to_s
|
54
37
|
@data_packet = data_packet(options, identifier)
|
55
38
|
xml = Paya::PROCESS_SINGLE_CERTIFICATION_CHECK.gsub("&&&DATA_PACKET&&&", @data_packet).gsub("&&&TERMINAL_ID&&&", @terminal_id).gsub("&&&USER_NAME&&&", Paya.user_name).gsub("&&&PASSWORD&&&", Paya.password)
|
56
|
-
response = Paya.
|
39
|
+
response = Paya.client.call(:process_single_certification_check, xml: xml)
|
57
40
|
response = Hash.from_xml(response.body[:process_single_certification_check_response][:process_single_certification_check_result])
|
58
41
|
{request: xml, response: response}
|
59
42
|
end
|
60
43
|
|
61
|
-
def
|
44
|
+
def get_archived_response request_id
|
62
45
|
@terminal_id = terminal_id.to_s
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
{request: xml, response: response}
|
46
|
+
xml = Paya::GET_ARCHIVED_RESPONSE.gsub("&&&REQUEST_ID&&&", request_id).gsub("&&&TERMINAL_ID&&&", @terminal_id).gsub("&&&USER_NAME&&&", Paya.user_name).gsub("&&&PASSWORD", Paya.password)
|
47
|
+
response = Paya.client.call(:get_archived_response, xml: xml)
|
48
|
+
response_hash = Hash.from_xml(response.body[:get_archived_response])
|
49
|
+
{request: xml, response: response_hash}
|
68
50
|
end
|
69
51
|
|
52
|
+
alias_method :archived, :get_archived_response
|
53
|
+
alias_method :get_archived, :get_archived_response
|
54
|
+
alias_method :archived_response, :get_archived_response
|
55
|
+
|
70
56
|
def data_packet options={}, identifier
|
71
57
|
identifier = options[:identifier] if options[:identifier].present?
|
72
58
|
xml = <<xml
|
data/lib/paya/version.rb
CHANGED
data/paya.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.description = %q{Ruby wrapper for Paya ACH payment gateway integration. This is developed by reading Paya documentation and is not official team of Paya}
|
14
14
|
spec.homepage = "https://github.com/mshahzadtariq"
|
15
15
|
spec.license = "MIT"
|
16
|
-
|
16
|
+
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
19
|
spec.bindir = "exe"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shahzad Tariq
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|