docdata 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docdata.rb +2 -1
- data/lib/docdata/response.rb +9 -5
- data/lib/docdata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5271138fe601489cd244592780fc9f386673c7cc
|
4
|
+
data.tar.gz: c60ccad98f4ae791df1e84608047a4e71e8ab7ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaa1d9dac46967a8e34d13e1a9435dcd72b6ec49134a83c49f7b5d10c6f7e01050af98a18d9a24824cb35f3881d766d6a4e997fe3232a83e8997c2e03988f34c
|
7
|
+
data.tar.gz: b7f90e1cfe8c8284e8bec9fce47256c67e32c8f87ef0438e29d88b6ded7efa917e06d1267c56a20be4d351bb46325864b69682bf1f55f0eb22980b23603c89ae
|
data/lib/docdata.rb
CHANGED
@@ -61,7 +61,8 @@ module Docdata
|
|
61
61
|
"https://test.docdatapayments.com/ps/services/paymentservice/1_1?wsdl"
|
62
62
|
else
|
63
63
|
# "https://www.docdatapayments.com/ps/services/paymentservice/1_1?wsdl"
|
64
|
-
"https://secure.docdatapayments.com/ps/services/paymentservice/1_0?wsdl"
|
64
|
+
# "https://secure.docdatapayments.com/ps/services/paymentservice/1_0?wsdl"
|
65
|
+
"https://secure.docdatapayments.com/ps/services/paymentservice/1_1?wsdl"
|
65
66
|
end
|
66
67
|
end
|
67
68
|
|
data/lib/docdata/response.rb
CHANGED
@@ -61,7 +61,7 @@ module Docdata
|
|
61
61
|
# Set the attributes based on the API response
|
62
62
|
def set_attributes
|
63
63
|
self.paid = is_paid?
|
64
|
-
self.amount = report[:payment][:authorization][:amount].to_i if report && report[:payment] && report[:payment][:authorization]
|
64
|
+
self.amount = report[:payment][:authorization][:amount].to_i if (report && report[:payment] && report[:payment][:authorization] && report[:payment][:authorization][:amount].present?)
|
65
65
|
self.status = capture_status if capture_status
|
66
66
|
self.currency = currency_to_set
|
67
67
|
end
|
@@ -111,16 +111,20 @@ module Docdata
|
|
111
111
|
|
112
112
|
# @return [String] the payment method of this transaction
|
113
113
|
def payment_method
|
114
|
-
|
115
|
-
report[:payment][:payment_method]
|
116
|
-
|
114
|
+
begin
|
115
|
+
if report && report[:payment].present? && report[:payment][:payment_method].present?
|
116
|
+
report[:payment][:payment_method].to_s
|
117
|
+
else
|
118
|
+
nil
|
119
|
+
end
|
120
|
+
rescue
|
117
121
|
nil
|
118
122
|
end
|
119
123
|
end
|
120
124
|
|
121
125
|
# @return [String] the status string provided by the API. One of [AUTHORIZED, CANCELED]
|
122
126
|
def payment_status
|
123
|
-
if report[:payment]
|
127
|
+
if report && report[:payment] && report[:payment][:authorization]
|
124
128
|
report[:payment][:authorization][:status]
|
125
129
|
else
|
126
130
|
nil
|
data/lib/docdata/version.rb
CHANGED