docdata 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/docdata.rb +6 -5
- data/lib/docdata/version.rb +1 -1
- data/spec/payment_spec.rb +2 -0
- 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: a7edc73fb794e32434f69452187355b9abb8b3a0
|
4
|
+
data.tar.gz: ac78d7e6331cd04f07b250ee0fd7bd35185ef51c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ced0139c86f63df549b2313fa7aa3f20b9227af3f96a4727bc5ea40bdfb558269818396158858c0a7a95dce641ea4b2784a86f97045a3024fe4b842835c1770
|
7
|
+
data.tar.gz: 6761e99ae59a345aeb09bcb20b0c2355243194c0cdd7028f6ac7f00b829fd96c181dc1155d2815ea2cfb69f2b32230cb46560c57abb3ab4ebc784023cbc38d4c
|
data/README.md
CHANGED
@@ -87,7 +87,7 @@ Example usage. Use appropriate settings in `development.rb`, `production.rb` etc
|
|
87
87
|
config.docdata.username = "my_app_com"
|
88
88
|
config.docdata.password = "HeJ35N"
|
89
89
|
config.docdata.return_url = "http://localhost:3000/docdata" # gets appended by '/success', '/error', '/pending' depending on response
|
90
|
-
config.test_mode
|
90
|
+
config.docdata.test_mode = true
|
91
91
|
```
|
92
92
|
|
93
93
|
## Example usage in Rails application
|
data/lib/docdata.rb
CHANGED
@@ -57,10 +57,11 @@ module Docdata
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.url
|
60
|
-
if
|
60
|
+
if Config.test_mode
|
61
61
|
"https://test.docdatapayments.com/ps/services/paymentservice/1_1?wsdl"
|
62
62
|
else
|
63
|
-
"https://www.docdatapayments.com/ps/services/paymentservice/1_1?wsdl"
|
63
|
+
# "https://www.docdatapayments.com/ps/services/paymentservice/1_1?wsdl"
|
64
|
+
"https://secure.docdatapayments.com/ps/services/paymentservice/1_0?wsdl"
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
@@ -68,9 +69,9 @@ module Docdata
|
|
68
69
|
# in environment variables to make the tests pass with your test
|
69
70
|
# credentials.
|
70
71
|
def self.set_credentials_from_environment
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
Config.password = ENV["DOCDATA_PASSWORD"]
|
73
|
+
Config.username = ENV["DOCDATA_USERNAME"]
|
74
|
+
Config.return_url = ENV["DOCDATA_RETURN_URL"]
|
74
75
|
end
|
75
76
|
|
76
77
|
def self.client
|
data/lib/docdata/version.rb
CHANGED
data/spec/payment_spec.rb
CHANGED
@@ -2,6 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Docdata::Payment do
|
4
4
|
before(:each) do
|
5
|
+
Docdata::Config.test_mode = true
|
5
6
|
@shopper = Docdata::Shopper.create_valid_shopper
|
6
7
|
@payment = Docdata::Payment.new
|
7
8
|
@payment.amount = 500
|
@@ -183,6 +184,7 @@ describe Docdata::Payment do
|
|
183
184
|
|
184
185
|
describe "#cancel" do
|
185
186
|
before(:each) do
|
187
|
+
Docdata::Config.test_mode = true
|
186
188
|
Docdata.set_credentials_from_environment
|
187
189
|
VCR.use_cassette("payments-successful-create") do
|
188
190
|
@payment.create
|