money_mover 0.0.7 → 0.0.8
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/.gitignore +1 -0
- data/lib/money_mover/dwolla/models/customer.rb +11 -0
- data/lib/money_mover/dwolla/models/unverified_business_customer.rb +1 -1
- data/lib/money_mover/dwolla/models/verified_business_customer.rb +3 -3
- data/lib/money_mover/version.rb +1 -1
- data/spec/unit/money_mover/dwolla/models/verified_business_customer_spec.rb +11 -2
- 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: d384fcc541d447e0024f99f74bd35a86efd5e6f3
|
4
|
+
data.tar.gz: c2ed3f26ead4817f33dc299008ac8f271dcd5e0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ae798d8a1645250d6921a23ce0d6a6e34f84df9ae07a15a6e92ad51acd008a723057742725b9976212283c73d6e3727964597f3d34f63a558b8c9d46b7a3df
|
7
|
+
data.tar.gz: 52ba34020553f73241115d173ee9c4b1350f4626db30c79622e8b50cfd35aab81a4bc2c7dc05d3424e06d52806a6ec79397e1ad10769edd5720420c17f0ab7b4
|
data/.gitignore
CHANGED
@@ -40,6 +40,17 @@ module MoneyMover
|
|
40
40
|
|
41
41
|
private
|
42
42
|
|
43
|
+
# dwolla doesnt accept urls without a scheme
|
44
|
+
def website_with_protocol
|
45
|
+
return nil unless website.present?
|
46
|
+
|
47
|
+
if website =~ %r{^https?://}
|
48
|
+
website
|
49
|
+
else
|
50
|
+
"http://#{website}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
43
54
|
def self.fetch_endpoint(id)
|
44
55
|
"/customers/#{id}"
|
45
56
|
end
|
@@ -35,9 +35,9 @@ module MoneyMover
|
|
35
35
|
businessName: businessName,
|
36
36
|
ein: ein,
|
37
37
|
doingBusinessAs: doingBusinessAs,
|
38
|
-
website:
|
39
|
-
|
40
|
-
|
38
|
+
website: website_with_protocol,
|
39
|
+
ipAddress: ipAddress,
|
40
|
+
type: 'business'
|
41
41
|
}
|
42
42
|
|
43
43
|
# hack to fix bug on dwolla's side with funding sources being removed if no dba is sent
|
data/lib/money_mover/version.rb
CHANGED
@@ -17,7 +17,7 @@ describe MoneyMover::Dwolla::VerifiedBusinessCustomer do
|
|
17
17
|
let(:businessName) { double 'business name' }
|
18
18
|
let(:ein) { double 'ein' }
|
19
19
|
let(:doingBusinessAs) { double 'dba' }
|
20
|
-
let(:website) {
|
20
|
+
let(:website) { 'www.buildpay.co' }
|
21
21
|
let(:ipAddress) { double 'ip address' }
|
22
22
|
|
23
23
|
# TODO: add test for not being able to set type, status, created, etc. directly...
|
@@ -65,11 +65,13 @@ describe MoneyMover::Dwolla::VerifiedBusinessCustomer do
|
|
65
65
|
businessName: businessName,
|
66
66
|
ein: ein,
|
67
67
|
doingBusinessAs: doingBusinessAs,
|
68
|
-
website:
|
68
|
+
website: website_with_protocol,
|
69
69
|
ipAddress: ipAddress,
|
70
70
|
type: 'business'
|
71
71
|
}}
|
72
72
|
|
73
|
+
let(:website_with_protocol) { "http://#{website}" }
|
74
|
+
|
73
75
|
let(:dwolla_response) { double 'dwolla response', success?: success?, resource_id: resource_id, resource_location: resource_location, errors: dwolla_errors }
|
74
76
|
let(:resource_id) { double 'resource id' }
|
75
77
|
let(:resource_location) { double 'resource location' }
|
@@ -182,6 +184,13 @@ describe MoneyMover::Dwolla::VerifiedBusinessCustomer do
|
|
182
184
|
|
183
185
|
it_behaves_like "resource created successfully"
|
184
186
|
end
|
187
|
+
|
188
|
+
context 'using https for website protocol' do
|
189
|
+
let(:website) { 'https://something.com' }
|
190
|
+
let(:website_with_protocol) { 'https://something.com' }
|
191
|
+
|
192
|
+
it_behaves_like "resource created successfully"
|
193
|
+
end
|
185
194
|
end
|
186
195
|
|
187
196
|
context 'fail' do
|