docdata 0.1.2 → 0.1.4

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: a7edc73fb794e32434f69452187355b9abb8b3a0
4
- data.tar.gz: ac78d7e6331cd04f07b250ee0fd7bd35185ef51c
3
+ metadata.gz: 5271138fe601489cd244592780fc9f386673c7cc
4
+ data.tar.gz: c60ccad98f4ae791df1e84608047a4e71e8ab7ab
5
5
  SHA512:
6
- metadata.gz: 3ced0139c86f63df549b2313fa7aa3f20b9227af3f96a4727bc5ea40bdfb558269818396158858c0a7a95dce641ea4b2784a86f97045a3024fe4b842835c1770
7
- data.tar.gz: 6761e99ae59a345aeb09bcb20b0c2355243194c0cdd7028f6ac7f00b829fd96c181dc1155d2815ea2cfb69f2b32230cb46560c57abb3ab4ebc784023cbc38d4c
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
 
@@ -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
- if report[:payment]
115
- report[:payment][:payment_method]
116
- else
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
@@ -1,3 +1,3 @@
1
1
  module Docdata
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henk Meijer