fake_stripe 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08e95a4cddf4f2ad7dc6e8764c75cc7280f23f5b
4
- data.tar.gz: 76e6d95ba8cf2acc1f854f1a14a4dbb0d688bb5b
3
+ metadata.gz: bb5a6346e68286a1b606da53581cb87235338610
4
+ data.tar.gz: 49ec132bf0abfe6747b8c992f1c168ba4d7d49c4
5
5
  SHA512:
6
- metadata.gz: b096557043a584130d61e84960f868d32ce758f10624a1650b00720ea5cbf9de1367efc3d5cbbe55685b6e3d378b135eb44297b84de3bdf2bbacf06a221cac05
7
- data.tar.gz: 876629c56a9314d49fc665b3bd1fda1292b88c68fcd9228494ed4aadbd015ded62219ddc98882e85f2bb87bcdcf232afc2c44b7f25778d0439520f0a55eff49e
6
+ metadata.gz: b4c9f8e6e4f9151957050a985f10dac0f3cfd0d8632b0141dd760db676804540ccc92574d20ef87b814b5890e4d31ed682ea7b4ff43bba8877075a4eb09ff807
7
+ data.tar.gz: a11ed7901febadb885494b577515cccbe759aadf6e494e6288b70ca39f8b59cdae038bb78f972c35cc6a236c9add53ff63682d5cc771dc01a908747460a6adea
@@ -9,6 +9,9 @@ module FakeStripe
9
9
  VALID_CARD_NUMBER = '4242424242424242'
10
10
  STRIPE_OBJECTS = %w{card charge coupon customer invoice invoiceitem plan
11
11
  recipient refund subscription token transfer}.freeze
12
+ CARD_OBJECT_TYPE = "card"
13
+ BANK_ACCOUNT_OBJECT_TYPE = "bank_account"
14
+
12
15
 
13
16
  STRIPE_OBJECTS.each do |object|
14
17
  define_singleton_method "#{object}_count" do
@@ -0,0 +1,108 @@
1
+ {
2
+ "id": "acct_1032D82eZvKYlo2C",
3
+ "email": "bob@example.com",
4
+ "statement_descriptor": null,
5
+ "display_name": "Stripe.com",
6
+ "timezone": "US/Pacific",
7
+ "details_submitted": false,
8
+ "charges_enabled": false,
9
+ "transfers_enabled": false,
10
+ "currencies_supported": [
11
+ "usd",
12
+ "aed",
13
+ "afn",
14
+ "..."
15
+ ],
16
+ "default_currency": "usd",
17
+ "country": "US",
18
+ "object": "account",
19
+ "business_name": "Stripe.com",
20
+ "business_url": null,
21
+ "support_phone": null,
22
+ "business_logo": null,
23
+ "managed": false,
24
+ "product_description": null,
25
+ "debit_negative_balances": true,
26
+ "bank_accounts": {
27
+ "object": "list",
28
+ "total_count": 0,
29
+ "has_more": false,
30
+ "url": "/v1/accounts/acct_1032D82eZvKYlo2C/bank_accounts",
31
+ "data": [
32
+
33
+ ]
34
+ },
35
+ "external_accounts": {
36
+ "object": "list",
37
+ "total_count": 0,
38
+ "has_more": false,
39
+ "url": "/v1/accounts/acct_1032D82eZvKYlo2C/external_accounts",
40
+ "data": [
41
+
42
+ ]
43
+ },
44
+ "verification": {
45
+ "fields_needed": [
46
+ "bank_account",
47
+ "business_url",
48
+ "product_description",
49
+ "support_phone",
50
+ "tos_acceptance.date",
51
+ "tos_acceptance.ip"
52
+ ],
53
+ "due_by": null,
54
+ "disabled_reason": "fields_needed"
55
+ },
56
+ "transfer_schedule": {
57
+ "delay_days": 7,
58
+ "interval": "daily"
59
+ },
60
+ "decline_charge_on": {
61
+ "cvc_failure": false,
62
+ "avs_failure": false
63
+ },
64
+ "tos_acceptance": {
65
+ "ip": null,
66
+ "date": null,
67
+ "user_agent": null
68
+ },
69
+ "legal_entity": {
70
+ "type": null,
71
+ "business_name": null,
72
+ "address": {
73
+ "line1": null,
74
+ "line2": null,
75
+ "city": null,
76
+ "state": null,
77
+ "postal_code": null,
78
+ "country": "US"
79
+ },
80
+ "first_name": null,
81
+ "last_name": null,
82
+ "personal_address": {
83
+ "line1": null,
84
+ "line2": null,
85
+ "city": null,
86
+ "state": null,
87
+ "postal_code": null,
88
+ "country": null
89
+ },
90
+ "dob": {
91
+ "day": null,
92
+ "month": null,
93
+ "year": null
94
+ },
95
+ "additional_owners": null,
96
+ "verification": {
97
+ "status": "unverified",
98
+ "document": null,
99
+ "details": null
100
+ },
101
+ "personal_id_number_provided": false,
102
+ "ssn_last_4_provided": false
103
+ },
104
+ "keys": {
105
+ "secret": "sk_test_sZNZe3vkCcTaOHv5fcZKzqdj",
106
+ "publishable": "pk_test_ahej4zmobxbm5NAH3tD3fCjM"
107
+ }
108
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "btok_708phkA019nh7S",
3
+ "livemode": false,
4
+ "created": 1442519980,
5
+ "used": false,
6
+ "object": "token",
7
+ "type": "bank_account",
8
+ "bank_account": {
9
+ "object": "bank_account",
10
+ "id": "ba_16m8Xg2eZvKYlo2CXbwc60ZX",
11
+ "last4": "6789",
12
+ "country": "US",
13
+ "currency": "usd",
14
+ "status": "new",
15
+ "fingerprint": "1JWtPxqbdX5Gamtc",
16
+ "routing_number": "110000000",
17
+ "bank_name": "STRIPE TEST BANK"
18
+ },
19
+ "client_ip": null
20
+ }
@@ -268,6 +268,10 @@ module FakeStripe
268
268
  json_response 200, fixture('retrieve_account')
269
269
  end
270
270
 
271
+ post "/v1/accounts" do
272
+ json_response 201, fixture("create_account")
273
+ end
274
+
271
275
  # Balance
272
276
  get '/v1/balance' do
273
277
  json_response 200, fixture('retrieve_balance')
@@ -293,7 +297,7 @@ module FakeStripe
293
297
  # Tokens
294
298
  post '/v1/tokens' do
295
299
  FakeStripe.token_count += 1
296
- json_response 200, fixture('create_token')
300
+ json_response 200, fixture(token_fixture_name)
297
301
  end
298
302
 
299
303
  get '/v1/tokens/:token_id' do
@@ -312,5 +316,13 @@ module FakeStripe
312
316
  status response_code
313
317
  response_body
314
318
  end
319
+
320
+ def token_fixture_name
321
+ if params.has_key?(FakeStripe::BANK_ACCOUNT_OBJECT_TYPE)
322
+ "create_bank_account_token"
323
+ else
324
+ "create_card_token"
325
+ end
326
+ end
315
327
  end
316
328
  end
@@ -1,3 +1,3 @@
1
1
  module FakeStripe
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake_stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harlow Ward
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-20 00:00:00.000000000 Z
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -118,7 +118,10 @@ files:
118
118
  - lib/fake_stripe/fixtures/cancel_transfer.json
119
119
  - lib/fake_stripe/fixtures/capture_charge.json
120
120
  - lib/fake_stripe/fixtures/close_dispute.json
121
+ - lib/fake_stripe/fixtures/create_account.json
122
+ - lib/fake_stripe/fixtures/create_bank_account_token.json
121
123
  - lib/fake_stripe/fixtures/create_card.json
124
+ - lib/fake_stripe/fixtures/create_card_token.json
122
125
  - lib/fake_stripe/fixtures/create_charge.json
123
126
  - lib/fake_stripe/fixtures/create_coupon.json
124
127
  - lib/fake_stripe/fixtures/create_customer.json
@@ -127,7 +130,6 @@ files:
127
130
  - lib/fake_stripe/fixtures/create_plan.json
128
131
  - lib/fake_stripe/fixtures/create_recipient.json
129
132
  - lib/fake_stripe/fixtures/create_subscription.json
130
- - lib/fake_stripe/fixtures/create_token.json
131
133
  - lib/fake_stripe/fixtures/create_transfer.json
132
134
  - lib/fake_stripe/fixtures/delete_card.json
133
135
  - lib/fake_stripe/fixtures/delete_coupon.json