fake_stripe 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +33 -0
  3. data/LICENSE +19 -0
  4. data/README.md +66 -0
  5. data/Rakefile +8 -0
  6. data/lib/fake_stripe.rb +49 -0
  7. data/lib/fake_stripe/assets/v1.js +38 -0
  8. data/lib/fake_stripe/assets/v2-mock.js +18 -0
  9. data/lib/fake_stripe/assets/v2.js +757 -0
  10. data/lib/fake_stripe/configuration.rb +15 -0
  11. data/lib/fake_stripe/fixtures/cancel_subscription.json +18 -0
  12. data/lib/fake_stripe/fixtures/cancel_transfer.json +161 -0
  13. data/lib/fake_stripe/fixtures/capture_charge.json +51 -0
  14. data/lib/fake_stripe/fixtures/close_dispute.json +13 -0
  15. data/lib/fake_stripe/fixtures/create_card.json +21 -0
  16. data/lib/fake_stripe/fixtures/create_charge.json +45 -0
  17. data/lib/fake_stripe/fixtures/create_coupon.json +17 -0
  18. data/lib/fake_stripe/fixtures/create_customer.json +51 -0
  19. data/lib/fake_stripe/fixtures/create_invoice.json +52 -0
  20. data/lib/fake_stripe/fixtures/create_invoiceitem.json +15 -0
  21. data/lib/fake_stripe/fixtures/create_plan.json +14 -0
  22. data/lib/fake_stripe/fixtures/create_recipient.json +25 -0
  23. data/lib/fake_stripe/fixtures/create_subscription.json +18 -0
  24. data/lib/fake_stripe/fixtures/create_token.json +26 -0
  25. data/lib/fake_stripe/fixtures/create_transfer.json +161 -0
  26. data/lib/fake_stripe/fixtures/delete_card.json +4 -0
  27. data/lib/fake_stripe/fixtures/delete_coupon.json +4 -0
  28. data/lib/fake_stripe/fixtures/delete_customer.json +4 -0
  29. data/lib/fake_stripe/fixtures/delete_customer_discount.json +4 -0
  30. data/lib/fake_stripe/fixtures/delete_invoiceitem.json +4 -0
  31. data/lib/fake_stripe/fixtures/delete_plan.json +4 -0
  32. data/lib/fake_stripe/fixtures/delete_recipient.json +4 -0
  33. data/lib/fake_stripe/fixtures/delete_subscription_discount.json +4 -0
  34. data/lib/fake_stripe/fixtures/list_application_fees.json +55 -0
  35. data/lib/fake_stripe/fixtures/list_balance_history.json +76 -0
  36. data/lib/fake_stripe/fixtures/list_cards.json +70 -0
  37. data/lib/fake_stripe/fixtures/list_charges.json +146 -0
  38. data/lib/fake_stripe/fixtures/list_coupons.json +58 -0
  39. data/lib/fake_stripe/fixtures/list_customers.json +157 -0
  40. data/lib/fake_stripe/fixtures/list_events.json +172 -0
  41. data/lib/fake_stripe/fixtures/list_invoiceitems.json +52 -0
  42. data/lib/fake_stripe/fixtures/list_invoices.json +199 -0
  43. data/lib/fake_stripe/fixtures/list_plans.json +49 -0
  44. data/lib/fake_stripe/fixtures/list_recipients.json +82 -0
  45. data/lib/fake_stripe/fixtures/list_subscriptions.json +100 -0
  46. data/lib/fake_stripe/fixtures/list_transfers.json +488 -0
  47. data/lib/fake_stripe/fixtures/pay_invoice.json +65 -0
  48. data/lib/fake_stripe/fixtures/refund_application_fee.json +17 -0
  49. data/lib/fake_stripe/fixtures/refund_charge.json +51 -0
  50. data/lib/fake_stripe/fixtures/retrieve_account.json +19 -0
  51. data/lib/fake_stripe/fixtures/retrieve_application_fee.json +17 -0
  52. data/lib/fake_stripe/fixtures/retrieve_balance.json +16 -0
  53. data/lib/fake_stripe/fixtures/retrieve_balance_transaction.json +23 -0
  54. data/lib/fake_stripe/fixtures/retrieve_card.json +21 -0
  55. data/lib/fake_stripe/fixtures/retrieve_charge.json +45 -0
  56. data/lib/fake_stripe/fixtures/retrieve_coupon.json +17 -0
  57. data/lib/fake_stripe/fixtures/retrieve_customer.json +51 -0
  58. data/lib/fake_stripe/fixtures/retrieve_event.json +56 -0
  59. data/lib/fake_stripe/fixtures/retrieve_invoice.json +64 -0
  60. data/lib/fake_stripe/fixtures/retrieve_invoice_line_items.json +61 -0
  61. data/lib/fake_stripe/fixtures/retrieve_invoiceitem.json +15 -0
  62. data/lib/fake_stripe/fixtures/retrieve_plan.json +14 -0
  63. data/lib/fake_stripe/fixtures/retrieve_recipient.json +25 -0
  64. data/lib/fake_stripe/fixtures/retrieve_subscription.json +31 -0
  65. data/lib/fake_stripe/fixtures/retrieve_token.json +26 -0
  66. data/lib/fake_stripe/fixtures/retrieve_transfer.json +161 -0
  67. data/lib/fake_stripe/fixtures/retrieve_upcoming_invoice.json +63 -0
  68. data/lib/fake_stripe/fixtures/update_card.json +21 -0
  69. data/lib/fake_stripe/fixtures/update_charge.json +45 -0
  70. data/lib/fake_stripe/fixtures/update_customer.json +51 -0
  71. data/lib/fake_stripe/fixtures/update_dispute.json +13 -0
  72. data/lib/fake_stripe/fixtures/update_invoice.json +64 -0
  73. data/lib/fake_stripe/fixtures/update_invoiceitem.json +15 -0
  74. data/lib/fake_stripe/fixtures/update_plan.json +14 -0
  75. data/lib/fake_stripe/fixtures/update_recipient.json +25 -0
  76. data/lib/fake_stripe/fixtures/update_subscription.json +18 -0
  77. data/lib/fake_stripe/fixtures/update_transfer.json +161 -0
  78. data/lib/fake_stripe/initializers/webmock.rb +3 -0
  79. data/lib/fake_stripe/stub_app.rb +307 -0
  80. data/lib/fake_stripe/stub_stripe_js.rb +29 -0
  81. data/lib/fake_stripe/version.rb +3 -0
  82. metadata +211 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "object": "invoiceitem",
3
+ "id": "ii_103UAn2eZvKYlo2CkLmj7ne9",
4
+ "date": 1392247767,
5
+ "amount": 0,
6
+ "livemode": false,
7
+ "proration": false,
8
+ "currency": "usd",
9
+ "customer": "abcdefghijklmnop",
10
+ "description": null,
11
+ "metadata": {
12
+ },
13
+ "invoice": "in_103UAp2eZvKYlo2C6xOPMzPj",
14
+ "subscription": null
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "interval": "month",
3
+ "name": "New plan name123",
4
+ "created": 1386247539,
5
+ "amount": 2000,
6
+ "currency": "usd",
7
+ "id": "gold21323",
8
+ "object": "plan",
9
+ "livemode": false,
10
+ "interval_count": 1,
11
+ "trial_period_days": null,
12
+ "metadata": {
13
+ }
14
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "rp_103WyK2eZvKYlo2CXgqlepdQ",
3
+ "object": "recipient",
4
+ "created": 1392893343,
5
+ "livemode": false,
6
+ "type": "individual",
7
+ "description": null,
8
+ "email": null,
9
+ "name": "John Doe",
10
+ "verified": false,
11
+ "metadata": {
12
+ },
13
+ "active_account": {
14
+ "object": "bank_account",
15
+ "id": "ba_103WyK2eZvKYlo2CRbxre4Eb",
16
+ "bank_name": "BANK OF AMERICA, N.A.",
17
+ "last4": "6789",
18
+ "country": "US",
19
+ "currency": "usd",
20
+ "validated": false,
21
+ "verified": false,
22
+ "fingerprint": "j1CvuuIQNXSIdZuK",
23
+ "disabled": false
24
+ }
25
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "sub_3ewdhCIki3FxWt",
3
+ "plan": "basic",
4
+ "object": "subscription",
5
+ "start": 1394732152,
6
+ "status": "active",
7
+ "customer": "abcdefghijklmnop",
8
+ "cancel_at_period_end": false,
9
+ "current_period_start": 1394732152,
10
+ "current_period_end": 1397410552,
11
+ "ended_at": null,
12
+ "trial_start": null,
13
+ "trial_end": null,
14
+ "canceled_at": null,
15
+ "quantity": 1,
16
+ "application_fee_percent": null,
17
+ "discount": null
18
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "id": "tok_103eog2eZvKYlo2CE8etNomD",
3
+ "livemode": false,
4
+ "created": 1394702572,
5
+ "used": false,
6
+ "object": "token",
7
+ "type": "card",
8
+ "card": {
9
+ "id": "card_103eog2eZvKYlo2CoLfqGwa4",
10
+ "object": "card",
11
+ "last4": "4242",
12
+ "brand": "Visa",
13
+ "exp_month": 8,
14
+ "exp_year": 2015,
15
+ "fingerprint": "ZYXWVUTSRQPONMLK",
16
+ "customer": null,
17
+ "country": "US",
18
+ "name": null,
19
+ "address_line1": null,
20
+ "address_line2": null,
21
+ "address_city": null,
22
+ "address_state": null,
23
+ "address_zip": null,
24
+ "address_country": null
25
+ }
26
+ }
@@ -0,0 +1,161 @@
1
+ {
2
+ "id": "tr_103ehW2eZvKYlo2CvqXdcIQL",
3
+ "object": "transfer",
4
+ "date": 1394841600,
5
+ "livemode": false,
6
+ "amount": 336081,
7
+ "currency": "usd",
8
+ "status": "pending",
9
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2nh",
10
+ "summary": {
11
+ "charge_gross": 365872,
12
+ "charge_fees": 29694,
13
+ "charge_fee_details": [
14
+ {
15
+ "amount": 29661,
16
+ "currency": "usd",
17
+ "type": "stripe_fee",
18
+ "description": null,
19
+ "application": null
20
+ }
21
+ ],
22
+ "refund_gross": -100,
23
+ "refund_fees": -3,
24
+ "refund_fee_details": [
25
+ {
26
+ "amount": -3,
27
+ "currency": "usd",
28
+ "type": "stripe_fee",
29
+ "description": null,
30
+ "application": null
31
+ }
32
+ ],
33
+ "adjustment_gross": 0,
34
+ "adjustment_fees": 0,
35
+ "adjustment_fee_details": [
36
+
37
+ ],
38
+ "validation_fees": 0,
39
+ "validation_count": 0,
40
+ "charge_count": 625,
41
+ "refund_count": 1,
42
+ "adjustment_count": 0,
43
+ "net": 336081,
44
+ "currency": "usd",
45
+ "collected_fee_gross": 0,
46
+ "collected_fee_count": 0,
47
+ "collected_fee_refund_gross": 0,
48
+ "collected_fee_refund_count": 0
49
+ },
50
+ "transactions": {
51
+ "object": "list",
52
+ "count": 626,
53
+ "url": "/v1/transfers/tr_103ehW2eZvKYlo2CvqXdcIQL/transactions",
54
+ "data": [
55
+ {
56
+ "id": "ch_103d7S2eZvKYlo2ClgiFvMVj",
57
+ "type": "charge",
58
+ "amount": 500,
59
+ "currency": "usd",
60
+ "net": 455,
61
+ "created": 1394311101,
62
+ "description": null,
63
+ "fee": 45,
64
+ "fee_details": [
65
+ {
66
+ "amount": 45,
67
+ "currency": "usd",
68
+ "type": "stripe_fee",
69
+ "description": "Stripe processing fees",
70
+ "application": null
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "id": "ch_103d4l2eZvKYlo2CYxMUKdVS",
76
+ "type": "charge",
77
+ "amount": 500,
78
+ "currency": "usd",
79
+ "net": 455,
80
+ "created": 1394301116,
81
+ "description": null,
82
+ "fee": 45,
83
+ "fee_details": [
84
+ {
85
+ "amount": 45,
86
+ "currency": "usd",
87
+ "type": "stripe_fee",
88
+ "description": "Stripe processing fees",
89
+ "application": null
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "id": "ch_103cv62eZvKYlo2CC16QiOJh",
95
+ "type": "charge",
96
+ "amount": 2000,
97
+ "currency": "usd",
98
+ "net": 1912,
99
+ "created": 1394265182,
100
+ "description": "payinguser@example.com",
101
+ "fee": 88,
102
+ "fee_details": [
103
+ {
104
+ "amount": 88,
105
+ "currency": "usd",
106
+ "type": "stripe_fee",
107
+ "description": "Stripe processing fees",
108
+ "application": null
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "id": "ch_103cnV2eZvKYlo2CRoDM3aSW",
114
+ "type": "charge",
115
+ "amount": 500,
116
+ "currency": "usd",
117
+ "net": 455,
118
+ "created": 1394236904,
119
+ "description": null,
120
+ "fee": 45,
121
+ "fee_details": [
122
+ {
123
+ "amount": 45,
124
+ "currency": "usd",
125
+ "type": "stripe_fee",
126
+ "description": "Stripe processing fees",
127
+ "application": null
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "id": "ch_103cnX2eZvKYlo2CrtXEpq5u",
133
+ "type": "charge",
134
+ "amount": 500,
135
+ "currency": "usd",
136
+ "net": 455,
137
+ "created": 1394237040,
138
+ "description": null,
139
+ "fee": 45,
140
+ "fee_details": [
141
+ {
142
+ "amount": 45,
143
+ "currency": "usd",
144
+ "type": "stripe_fee",
145
+ "description": "Stripe processing fees",
146
+ "application": null
147
+ }
148
+ ]
149
+ }
150
+ ]
151
+ },
152
+ "other_transfers": [
153
+ "tr_103ehW2eZvKYlo2CvqXdcIQL"
154
+ ],
155
+ "account": null,
156
+ "description": "STRIPE TRANSFER",
157
+ "metadata": {
158
+ },
159
+ "statement_descriptor": null,
160
+ "recipient": null
161
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "card_103ewd2eZvKYlo2CzCsKfISF"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "25OFF"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "abcdefghijklmnop"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "di_103Yo92eZvKYlo2COEMtohUE"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "ii_103UAn2eZvKYlo2CkLmj7ne9"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "gold21323"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "rp_103WyK2eZvKYlo2CXgqlepdQ"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "deleted": true,
3
+ "id": "di_103Yo92eZvKYlo2COEMtohUE"
4
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "object": "list",
3
+ "url": "/v1/application_fees",
4
+ "count": 3,
5
+ "data": [
6
+ {
7
+ "id": "fee_3ewdpQuL9AggWF",
8
+ "object": "application_fee",
9
+ "created": 1394732153,
10
+ "livemode": false,
11
+ "amount": 100,
12
+ "currency": "usd",
13
+ "refunded": false,
14
+ "amount_refunded": 0,
15
+ "refunds": [
16
+ ],
17
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2nh",
18
+ "account": "acct_1032D82eZvKYlo2C",
19
+ "application": "ca_3ewdjwfoVd3Ccrb69CJKNS0tZJ6D4eQm",
20
+ "charge": "ch_103ewb2eZvKYlo2CjopvmZyM"
21
+ },
22
+ {
23
+ "id": "fee_3ewdpQuL9AggWG",
24
+ "object": "application_fee",
25
+ "created": 1394732154,
26
+ "livemode": false,
27
+ "amount": 100,
28
+ "currency": "usd",
29
+ "refunded": false,
30
+ "amount_refunded": 0,
31
+ "refunds": [
32
+ ],
33
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2ni",
34
+ "account": "acct_1032D82eZvKYlo2D",
35
+ "application": "ca_3ewdjwfoVd3Ccrb69CJKNS0tZJ6D4eQn",
36
+ "charge": "ch_103ewb2eZvKYlo2CjopvmZyN"
37
+ },
38
+ {
39
+ "id": "fee_3ewdpQuL9AggWH",
40
+ "object": "application_fee",
41
+ "created": 1394732155,
42
+ "livemode": false,
43
+ "amount": 100,
44
+ "currency": "usd",
45
+ "refunded": false,
46
+ "amount_refunded": 0,
47
+ "refunds": [
48
+ ],
49
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2nj",
50
+ "account": "acct_1032D82eZvKYlo2E",
51
+ "application": "ca_3ewdjwfoVd3Ccrb69CJKNS0tZJ6D4eQo",
52
+ "charge": "ch_103ewb2eZvKYlo2CjopvmZyO"
53
+ }
54
+ ]
55
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "object": "list",
3
+ "url": "/v1/balance/history",
4
+ "count": 3,
5
+ "data": [
6
+ {
7
+ "id": "txn_103cQg2eZvKYlo2CYKVlR2nh",
8
+ "object": "balance_transaction",
9
+ "source": "ch_103cQg2eZvKYlo2CdLNiUG5P",
10
+ "amount": 100,
11
+ "currency": "usd",
12
+ "net": 41,
13
+ "type": "charge",
14
+ "created": 1394152014,
15
+ "available_on": 1394755200,
16
+ "status": "pending",
17
+ "fee": 59,
18
+ "fee_details": [
19
+ {
20
+ "amount": 45,
21
+ "currency": "usd",
22
+ "type": "stripe_fee",
23
+ "description": "Stripe processing fees",
24
+ "application": null
25
+ }
26
+ ],
27
+ "description": null
28
+ },
29
+ {
30
+ "id": "txn_103cQg2eZvKYlo2CYKVlR2ni",
31
+ "object": "balance_transaction",
32
+ "source": "ch_103cQg2eZvKYlo2CdLNiUG5Q",
33
+ "amount": 100,
34
+ "currency": "usd",
35
+ "net": 41,
36
+ "type": "charge",
37
+ "created": 1394152015,
38
+ "available_on": 1394755201,
39
+ "status": "pending",
40
+ "fee": 59,
41
+ "fee_details": [
42
+ {
43
+ "amount": 45,
44
+ "currency": "usd",
45
+ "type": "stripe_fee",
46
+ "description": "Stripe processing fees",
47
+ "application": null
48
+ }
49
+ ],
50
+ "description": null
51
+ },
52
+ {
53
+ "id": "txn_103cQg2eZvKYlo2CYKVlR2nj",
54
+ "object": "balance_transaction",
55
+ "source": "ch_103cQg2eZvKYlo2CdLNiUG5R",
56
+ "amount": 100,
57
+ "currency": "usd",
58
+ "net": 41,
59
+ "type": "charge",
60
+ "created": 1394152016,
61
+ "available_on": 1394755202,
62
+ "status": "pending",
63
+ "fee": 59,
64
+ "fee_details": [
65
+ {
66
+ "amount": 45,
67
+ "currency": "usd",
68
+ "type": "stripe_fee",
69
+ "description": "Stripe processing fees",
70
+ "application": null
71
+ }
72
+ ],
73
+ "description": null
74
+ }
75
+ ]
76
+ }