paynow_sdk 1.0.8 → 1.0.9
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/paynow_sdk.rb +4 -8
- data/lib/paynow_sdk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c11a04492e6602903f3cad2293b665015e7eb82e9d4bea7624f0207ee40d46b6
|
|
4
|
+
data.tar.gz: 11a44f1ebe69d2d0bba1885aee5fea4a67f2d1474521487bbdf539dbe9a69723
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aeb75814e52a89e4bb3c8ce15e19412858d57eaba1dfb128b812e395452f1aafc15e5ea1741528b3df36c040c4b9dea5dd49437ce320cf5a25815d73469cd5e2
|
|
7
|
+
data.tar.gz: b53de4887d9a737d8a5e7996dc53ba7b252f0f34db7fcf9a7960f4a8c1b10b5f4c859c0c57ac357e1f539cca2ff6aa98c2321475a6d276fa0b066f123aea56b2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -90,7 +90,7 @@ end
|
|
|
90
90
|
|
|
91
91
|
# Checking transaction status
|
|
92
92
|
|
|
93
|
-
The SDK exposes a handy method that you can use to check the status of a transaction.
|
|
93
|
+
The SDK exposes a handy method that you can use to check the status of a transaction.
|
|
94
94
|
|
|
95
95
|
```ruby
|
|
96
96
|
# Check the status of the transaction with the specified poll url
|
data/lib/paynow_sdk.rb
CHANGED
|
@@ -6,12 +6,12 @@ require "net/http"
|
|
|
6
6
|
|
|
7
7
|
#throws error when hash from Paynow does not match locally generated hash
|
|
8
8
|
module PaynowStatus
|
|
9
|
-
def paid
|
|
9
|
+
def self.paid
|
|
10
10
|
status_paid = check_transaction_status(poll_url)
|
|
11
11
|
status_paid["status"] == "Paid"
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def check_transaction_status(poll_url)
|
|
14
|
+
def self.check_transaction_status(poll_url)
|
|
15
15
|
url = URI(poll_url)
|
|
16
16
|
|
|
17
17
|
http = Net::HTTP.new(url.host, url.port)
|
|
@@ -24,12 +24,8 @@ module PaynowStatus
|
|
|
24
24
|
response = http.request(request)
|
|
25
25
|
response.read_body
|
|
26
26
|
|
|
27
|
-
response_object =
|
|
28
|
-
response_object
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def rebuild_response(response)
|
|
32
|
-
URI.decode_www_form(response).to_h
|
|
27
|
+
response_object = rebuild(response.read_body)
|
|
28
|
+
URI.decode_www_form(response_object).to_h
|
|
33
29
|
end
|
|
34
30
|
end
|
|
35
31
|
|
data/lib/paynow_sdk/version.rb
CHANGED