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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6381fecabe648a60a7a28e66f67582988c1645f
4
- data.tar.gz: 585d5f5e065aafff7d61dc146dafa2d9196e912e
3
+ metadata.gz: d384fcc541d447e0024f99f74bd35a86efd5e6f3
4
+ data.tar.gz: c2ed3f26ead4817f33dc299008ac8f271dcd5e0f
5
5
  SHA512:
6
- metadata.gz: d453300e4eac7fc7d5f966d25697aaf2cf235b0d59906c55b7910df70d60eb9e954e3d937d84dbd352c1a3478ded530fb987a2a95b2aa2bde0131f7051a18131
7
- data.tar.gz: d9595b26247a965c2603bff50f1583c0c2506572ae0fd456e26332deb9c881d99f2f5ff99178cf50f20aa75cc6cb7736d6520f4ee1db92d189e92ad6fcadbadf
6
+ metadata.gz: b6ae798d8a1645250d6921a23ce0d6a6e34f84df9ae07a15a6e92ad51acd008a723057742725b9976212283c73d6e3727964597f3d34f63a558b8c9d46b7a3df
7
+ data.tar.gz: 52ba34020553f73241115d173ee9c4b1350f4626db30c79622e8b50cfd35aab81a4bc2c7dc05d3424e06d52806a6ec79397e1ad10769edd5720420c17f0ab7b4
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  tmp
2
+ *.gem
@@ -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
@@ -24,7 +24,7 @@ module MoneyMover
24
24
  businessName: businessName,
25
25
  ein: ein,
26
26
  doingBusinessAs: doingBusinessAs,
27
- website: website,
27
+ website: website_with_protocol,
28
28
  ipAddress: ipAddress
29
29
  }
30
30
 
@@ -35,9 +35,9 @@ module MoneyMover
35
35
  businessName: businessName,
36
36
  ein: ein,
37
37
  doingBusinessAs: doingBusinessAs,
38
- website: website,
39
- type: 'business',
40
- ipAddress: ipAddress
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
@@ -1,3 +1,3 @@
1
1
  module MoneyMover
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -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) { double '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: 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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: money_mover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Errante