stripe-ruby-mock 1.8.4.10 → 1.8.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/stripe_mock/api/webhooks.rb +1 -0
- data/lib/stripe_mock/data.rb +2 -1
- data/lib/stripe_mock/instance.rb +4 -0
- data/lib/stripe_mock/request_handlers/cards.rb +26 -0
- data/lib/stripe_mock/version.rb +1 -1
- data/lib/stripe_mock/webhook_fixtures/account.updated.json +13 -11
- data/lib/stripe_mock/webhook_fixtures/balance.available.json +25 -0
- data/lib/stripe_mock/webhook_fixtures/charge.dispute.closed.json +12 -11
- data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +12 -11
- data/lib/stripe_mock/webhook_fixtures/charge.dispute.updated.json +12 -11
- data/lib/stripe_mock/webhook_fixtures/charge.failed.json +40 -43
- data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +44 -40
- data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +40 -43
- data/lib/stripe_mock/webhook_fixtures/coupon.created.json +12 -12
- data/lib/stripe_mock/webhook_fixtures/coupon.deleted.json +45 -15
- data/lib/stripe_mock/webhook_fixtures/customer.created.json +44 -32
- data/lib/stripe_mock/webhook_fixtures/customer.discount.created.json +15 -15
- data/lib/stripe_mock/webhook_fixtures/customer.discount.deleted.json +15 -15
- data/lib/stripe_mock/webhook_fixtures/customer.discount.updated.json +22 -22
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +25 -23
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +25 -23
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.trial_will_end.json +25 -23
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +31 -29
- data/lib/stripe_mock/webhook_fixtures/customer.updated.json +44 -32
- data/lib/stripe_mock/webhook_fixtures/invoice.created.json +41 -40
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +41 -40
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +41 -40
- data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +45 -42
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +13 -13
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.deleted.json +13 -13
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +13 -13
- data/lib/stripe_mock/webhook_fixtures/plan.created.json +12 -12
- data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +12 -12
- data/lib/stripe_mock/webhook_fixtures/plan.updated.json +12 -12
- data/lib/stripe_mock/webhook_fixtures/transfer.created.json +80 -15
- data/lib/stripe_mock/webhook_fixtures/transfer.failed.json +80 -15
- data/lib/stripe_mock/webhook_fixtures/transfer.paid.json +80 -15
- data/lib/stripe_mock/webhook_fixtures/transfer.updated.json +80 -15
- data/spec/readme_spec.rb +1 -1
- data/spec/shared_stripe_examples/card_examples.rb +20 -0
- data/spec/shared_stripe_examples/charge_examples.rb +1 -0
- metadata +3 -2
@@ -1,34 +1,36 @@
|
|
1
1
|
{
|
2
2
|
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.deleted",
|
6
|
+
"object": "event",
|
3
7
|
"data": {
|
4
8
|
"object": {
|
5
|
-
"
|
6
|
-
"canceled_at": null,
|
7
|
-
"current_period_end": 1371760585,
|
8
|
-
"current_period_start": 1371501385,
|
9
|
-
"customer": "cus_00000000000000",
|
10
|
-
"ended_at": 1371420375,
|
11
|
-
"object": "subscription",
|
9
|
+
"id": "su_00000000000000",
|
12
10
|
"plan": {
|
13
|
-
"amount": 1000,
|
14
|
-
"currency": "usd",
|
15
|
-
"id": "1_00000000000000",
|
16
11
|
"interval": "month",
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
12
|
+
"name": "Member's Club",
|
13
|
+
"amount": 100,
|
14
|
+
"currency": "usd",
|
15
|
+
"id": "fkx0AFo_00000000000000",
|
20
16
|
"object": "plan",
|
21
|
-
"
|
17
|
+
"livemode": false,
|
18
|
+
"interval_count": 1,
|
19
|
+
"trial_period_days": null
|
22
20
|
},
|
23
|
-
"
|
24
|
-
"start":
|
21
|
+
"object": "subscription",
|
22
|
+
"start": 1381080564,
|
25
23
|
"status": "canceled",
|
26
|
-
"
|
27
|
-
"
|
24
|
+
"customer": "cus_00000000000000",
|
25
|
+
"cancel_at_period_end": false,
|
26
|
+
"current_period_start": 1381080564,
|
27
|
+
"current_period_end": 1383758964,
|
28
|
+
"ended_at": 1381021514,
|
29
|
+
"trial_start": null,
|
30
|
+
"trial_end": null,
|
31
|
+
"canceled_at": null,
|
32
|
+
"quantity": 1,
|
33
|
+
"application_fee_percent": null
|
28
34
|
}
|
29
|
-
}
|
30
|
-
"id": "evt_00000000000000",
|
31
|
-
"livemode": false,
|
32
|
-
"object": "event",
|
33
|
-
"type": "customer.subscription.deleted"
|
35
|
+
}
|
34
36
|
}
|
@@ -1,34 +1,36 @@
|
|
1
1
|
{
|
2
2
|
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.trial_will_end",
|
6
|
+
"object": "event",
|
3
7
|
"data": {
|
4
8
|
"object": {
|
5
|
-
"
|
6
|
-
"canceled_at": null,
|
7
|
-
"current_period_end": 1371760588,
|
8
|
-
"current_period_start": 1371501388,
|
9
|
-
"customer": "cus_00000000000000",
|
10
|
-
"ended_at": null,
|
11
|
-
"object": "subscription",
|
9
|
+
"id": "su_00000000000000",
|
12
10
|
"plan": {
|
13
|
-
"amount": 1000,
|
14
|
-
"currency": "usd",
|
15
|
-
"id": "1_00000000000000",
|
16
11
|
"interval": "month",
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
12
|
+
"name": "Member's Club",
|
13
|
+
"amount": 100,
|
14
|
+
"currency": "usd",
|
15
|
+
"id": "fkx0AFo_00000000000000",
|
20
16
|
"object": "plan",
|
21
|
-
"
|
17
|
+
"livemode": false,
|
18
|
+
"interval_count": 1,
|
19
|
+
"trial_period_days": null
|
22
20
|
},
|
23
|
-
"
|
24
|
-
"start":
|
21
|
+
"object": "subscription",
|
22
|
+
"start": 1381080623,
|
25
23
|
"status": "trialing",
|
26
|
-
"
|
27
|
-
"
|
24
|
+
"customer": "cus_00000000000000",
|
25
|
+
"cancel_at_period_end": false,
|
26
|
+
"current_period_start": 1381080623,
|
27
|
+
"current_period_end": 1383759023,
|
28
|
+
"ended_at": null,
|
29
|
+
"trial_start": 1381021530,
|
30
|
+
"trial_end": 1381280730,
|
31
|
+
"canceled_at": null,
|
32
|
+
"quantity": 1,
|
33
|
+
"application_fee_percent": null
|
28
34
|
}
|
29
|
-
}
|
30
|
-
"id": "evt_00000000000000",
|
31
|
-
"livemode": false,
|
32
|
-
"object": "event",
|
33
|
-
"type": "customer.subscription.trial_will_end"
|
35
|
+
}
|
34
36
|
}
|
@@ -1,47 +1,49 @@
|
|
1
1
|
{
|
2
2
|
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.updated",
|
6
|
+
"object": "event",
|
3
7
|
"data": {
|
4
8
|
"object": {
|
5
|
-
"
|
6
|
-
"canceled_at": null,
|
7
|
-
"current_period_end": 1371760581,
|
8
|
-
"current_period_start": 1371501381,
|
9
|
-
"customer": "cus_00000000000000",
|
10
|
-
"ended_at": null,
|
11
|
-
"object": "subscription",
|
9
|
+
"id": "su_00000000000000",
|
12
10
|
"plan": {
|
13
|
-
"amount": 1000,
|
14
|
-
"currency": "usd",
|
15
|
-
"id": "1_00000000000000",
|
16
11
|
"interval": "month",
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
12
|
+
"name": "Member's Club",
|
13
|
+
"amount": 100,
|
14
|
+
"currency": "usd",
|
15
|
+
"id": "fkx0AFo_00000000000000",
|
20
16
|
"object": "plan",
|
21
|
-
"
|
17
|
+
"livemode": false,
|
18
|
+
"interval_count": 1,
|
19
|
+
"trial_period_days": null
|
22
20
|
},
|
21
|
+
"object": "subscription",
|
22
|
+
"start": 1381080561,
|
23
|
+
"status": "active",
|
24
|
+
"customer": "cus_00000000000000",
|
25
|
+
"cancel_at_period_end": false,
|
26
|
+
"current_period_start": 1381080561,
|
27
|
+
"current_period_end": 1383758961,
|
28
|
+
"ended_at": null,
|
29
|
+
"trial_start": null,
|
30
|
+
"trial_end": null,
|
31
|
+
"canceled_at": null,
|
23
32
|
"quantity": 1,
|
24
|
-
"
|
25
|
-
"status": "trialing",
|
26
|
-
"trial_end": 1371760581,
|
27
|
-
"trial_start": 1371501381
|
33
|
+
"application_fee_percent": null
|
28
34
|
},
|
29
35
|
"previous_attributes": {
|
30
36
|
"plan": {
|
31
|
-
"amount": 1000,
|
32
|
-
"currency": "usd",
|
33
|
-
"id": "OLD_PLAN_ID",
|
34
37
|
"interval": "month",
|
35
|
-
"interval_count": 1,
|
36
|
-
"livemode": false,
|
37
38
|
"name": "Old plan",
|
39
|
+
"amount": 100,
|
40
|
+
"currency": "usd",
|
41
|
+
"id": "OLD_PLAN_ID",
|
38
42
|
"object": "plan",
|
39
|
-
"
|
43
|
+
"livemode": false,
|
44
|
+
"interval_count": 1,
|
45
|
+
"trial_period_days": null
|
40
46
|
}
|
41
47
|
}
|
42
|
-
}
|
43
|
-
"id": "evt_00000000000000",
|
44
|
-
"livemode": false,
|
45
|
-
"object": "event",
|
46
|
-
"type": "customer.subscription.updated"
|
48
|
+
}
|
47
49
|
}
|
@@ -1,43 +1,55 @@
|
|
1
1
|
{
|
2
2
|
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.updated",
|
6
|
+
"object": "event",
|
3
7
|
"data": {
|
4
8
|
"object": {
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"address_city": null,
|
8
|
-
"address_country": null,
|
9
|
-
"address_line1": null,
|
10
|
-
"address_line1_check": null,
|
11
|
-
"address_line2": null,
|
12
|
-
"address_state": null,
|
13
|
-
"address_zip": null,
|
14
|
-
"address_zip_check": null,
|
15
|
-
"country": "US",
|
16
|
-
"cvc_check": "pass",
|
17
|
-
"exp_month": 12,
|
18
|
-
"exp_year": 2013,
|
19
|
-
"fingerprint": "wXWJT135mEK107G8",
|
20
|
-
"last4": "4242",
|
21
|
-
"name": "1231",
|
22
|
-
"object": "card",
|
23
|
-
"type": "Visa"
|
24
|
-
},
|
25
|
-
"created": 1359947599,
|
26
|
-
"delinquent": false,
|
27
|
-
"description": null,
|
28
|
-
"discount": null,
|
29
|
-
"email": "ajoe@mailinator.com",
|
9
|
+
"object": "customer",
|
10
|
+
"created": 1375148334,
|
30
11
|
"id": "cus_00000000000000",
|
31
12
|
"livemode": false,
|
32
|
-
"
|
33
|
-
"
|
13
|
+
"description": null,
|
14
|
+
"email": "bond@mailinator.com",
|
15
|
+
"delinquent": true,
|
16
|
+
"metadata": {
|
17
|
+
},
|
18
|
+
"subscription": null,
|
19
|
+
"discount": null,
|
20
|
+
"account_balance": 0,
|
21
|
+
"cards": {
|
22
|
+
"object": "list",
|
23
|
+
"count": 1,
|
24
|
+
"url": "/v1/customers/cus_2I2AhGQOPmEFeu/cards",
|
25
|
+
"data": [
|
26
|
+
{
|
27
|
+
"id": "cc_2I2akIhmladin5",
|
28
|
+
"object": "card",
|
29
|
+
"last4": "0341",
|
30
|
+
"type": "Visa",
|
31
|
+
"exp_month": 12,
|
32
|
+
"exp_year": 2013,
|
33
|
+
"fingerprint": "fWvZEzdbEIFF8QrK",
|
34
|
+
"customer": "cus_2I2AhGQOPmEFeu",
|
35
|
+
"country": "US",
|
36
|
+
"name": "Johnny Goodman",
|
37
|
+
"address_line1": null,
|
38
|
+
"address_line2": null,
|
39
|
+
"address_city": null,
|
40
|
+
"address_state": null,
|
41
|
+
"address_zip": null,
|
42
|
+
"address_country": null,
|
43
|
+
"cvc_check": "pass",
|
44
|
+
"address_line1_check": null,
|
45
|
+
"address_zip_check": null
|
46
|
+
}
|
47
|
+
]
|
48
|
+
},
|
49
|
+
"default_card": "cc_2I2akIhmladin5"
|
34
50
|
},
|
35
51
|
"previous_attributes": {
|
36
52
|
"description": "Old description"
|
37
53
|
}
|
38
|
-
}
|
39
|
-
"id": "evt_00000000000000",
|
40
|
-
"livemode": false,
|
41
|
-
"object": "event",
|
42
|
-
"type": "customer.updated"
|
54
|
+
}
|
43
55
|
}
|
@@ -1,64 +1,65 @@
|
|
1
1
|
{
|
2
2
|
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "invoice.created",
|
6
|
+
"object": "event",
|
3
7
|
"data": {
|
4
8
|
"object": {
|
5
|
-
"
|
6
|
-
"attempt_count": 0,
|
7
|
-
"attempted": false,
|
8
|
-
"charge": null,
|
9
|
-
"closed": false,
|
10
|
-
"currency": "usd",
|
11
|
-
"customer": "cus_00000000000000",
|
12
|
-
"date": 1371501468,
|
13
|
-
"discount": null,
|
14
|
-
"ending_balance": null,
|
9
|
+
"date": 1380674206,
|
15
10
|
"id": "in_00000000000000",
|
11
|
+
"period_start": 1378082075,
|
12
|
+
"period_end": 1380674075,
|
16
13
|
"lines": {
|
17
|
-
"count": 1,
|
18
14
|
"data": [
|
19
15
|
{
|
20
|
-
"
|
21
|
-
"currency": "usd",
|
22
|
-
"description": null,
|
23
|
-
"id": "su_22Dpg5ktMdA0i6",
|
24
|
-
"livemode": true,
|
16
|
+
"id": "su_2hksGtIPylSBg2",
|
25
17
|
"object": "line_item",
|
18
|
+
"type": "subscription",
|
19
|
+
"livemode": true,
|
20
|
+
"amount": 100,
|
21
|
+
"currency": "usd",
|
22
|
+
"proration": false,
|
26
23
|
"period": {
|
27
|
-
"
|
28
|
-
"
|
24
|
+
"start": 1383759042,
|
25
|
+
"end": 1386351042
|
29
26
|
},
|
27
|
+
"quantity": 1,
|
30
28
|
"plan": {
|
31
|
-
"amount": 1000,
|
32
|
-
"currency": "usd",
|
33
|
-
"id": "1",
|
34
29
|
"interval": "month",
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
30
|
+
"name": "Member's Club",
|
31
|
+
"amount": 100,
|
32
|
+
"currency": "usd",
|
33
|
+
"id": "fkx0AFo",
|
38
34
|
"object": "plan",
|
39
|
-
"
|
35
|
+
"livemode": false,
|
36
|
+
"interval_count": 1,
|
37
|
+
"trial_period_days": null
|
40
38
|
},
|
41
|
-
"
|
42
|
-
"quantity": 1,
|
43
|
-
"type": "subscription"
|
39
|
+
"description": null
|
44
40
|
}
|
45
41
|
],
|
42
|
+
"count": 1,
|
46
43
|
"object": "list",
|
47
|
-
"url": "/v1/invoices/
|
44
|
+
"url": "/v1/invoices/in_2fzcb1D7guR4IE/lines"
|
48
45
|
},
|
49
|
-
"
|
50
|
-
"
|
46
|
+
"subtotal": 1000,
|
47
|
+
"total": 1000,
|
48
|
+
"customer": "cus_00000000000000",
|
51
49
|
"object": "invoice",
|
50
|
+
"attempted": false,
|
51
|
+
"closed": true,
|
52
52
|
"paid": true,
|
53
|
-
"
|
54
|
-
"
|
53
|
+
"livemode": false,
|
54
|
+
"attempt_count": 1,
|
55
|
+
"amount_due": 1000,
|
56
|
+
"currency": "usd",
|
55
57
|
"starting_balance": 0,
|
56
|
-
"
|
57
|
-
"
|
58
|
+
"ending_balance": 0,
|
59
|
+
"next_payment_attempt": null,
|
60
|
+
"charge": "ch_00000000000000",
|
61
|
+
"discount": null,
|
62
|
+
"application_fee": null
|
58
63
|
}
|
59
|
-
}
|
60
|
-
"id": "evt_00000000000000",
|
61
|
-
"livemode": false,
|
62
|
-
"object": "event",
|
63
|
-
"type": "invoice.created"
|
64
|
+
}
|
64
65
|
}
|
@@ -1,64 +1,65 @@
|
|
1
1
|
{
|
2
2
|
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "invoice.payment_failed",
|
6
|
+
"object": "event",
|
3
7
|
"data": {
|
4
8
|
"object": {
|
5
|
-
"
|
6
|
-
"attempt_count": 0,
|
7
|
-
"attempted": true,
|
8
|
-
"charge": null,
|
9
|
-
"closed": false,
|
10
|
-
"currency": "usd",
|
11
|
-
"customer": "cus_00000000000000",
|
12
|
-
"date": 1371501515,
|
13
|
-
"discount": null,
|
14
|
-
"ending_balance": null,
|
9
|
+
"date": 1380674206,
|
15
10
|
"id": "in_00000000000000",
|
11
|
+
"period_start": 1378082075,
|
12
|
+
"period_end": 1380674075,
|
16
13
|
"lines": {
|
17
|
-
"count": 1,
|
18
14
|
"data": [
|
19
15
|
{
|
20
|
-
"
|
21
|
-
"currency": "usd",
|
22
|
-
"description": null,
|
23
|
-
"id": "su_22DqVThf1vOC0I",
|
24
|
-
"livemode": true,
|
16
|
+
"id": "su_2hkslKrnt23NBz",
|
25
17
|
"object": "line_item",
|
18
|
+
"type": "subscription",
|
19
|
+
"livemode": true,
|
20
|
+
"amount": 100,
|
21
|
+
"currency": "usd",
|
22
|
+
"proration": false,
|
26
23
|
"period": {
|
27
|
-
"
|
28
|
-
"
|
24
|
+
"start": 1383759056,
|
25
|
+
"end": 1386351056
|
29
26
|
},
|
27
|
+
"quantity": 1,
|
30
28
|
"plan": {
|
31
|
-
"amount": 1000,
|
32
|
-
"currency": "usd",
|
33
|
-
"id": "1",
|
34
29
|
"interval": "month",
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
30
|
+
"name": "Member's Club",
|
31
|
+
"amount": 100,
|
32
|
+
"currency": "usd",
|
33
|
+
"id": "fkx0AFo",
|
38
34
|
"object": "plan",
|
39
|
-
"
|
35
|
+
"livemode": false,
|
36
|
+
"interval_count": 1,
|
37
|
+
"trial_period_days": null
|
40
38
|
},
|
41
|
-
"
|
42
|
-
"quantity": 1,
|
43
|
-
"type": "subscription"
|
39
|
+
"description": null
|
44
40
|
}
|
45
41
|
],
|
42
|
+
"count": 1,
|
46
43
|
"object": "list",
|
47
|
-
"url": "/v1/invoices/
|
44
|
+
"url": "/v1/invoices/in_2fzcb1D7guR4IE/lines"
|
48
45
|
},
|
49
|
-
"
|
50
|
-
"
|
46
|
+
"subtotal": 1000,
|
47
|
+
"total": 1000,
|
48
|
+
"customer": "cus_00000000000000",
|
51
49
|
"object": "invoice",
|
50
|
+
"attempted": true,
|
51
|
+
"closed": false,
|
52
52
|
"paid": false,
|
53
|
-
"
|
54
|
-
"
|
53
|
+
"livemode": false,
|
54
|
+
"attempt_count": 1,
|
55
|
+
"amount_due": 1000,
|
56
|
+
"currency": "usd",
|
55
57
|
"starting_balance": 0,
|
56
|
-
"
|
57
|
-
"
|
58
|
+
"ending_balance": 0,
|
59
|
+
"next_payment_attempt": null,
|
60
|
+
"charge": "ch_00000000000000",
|
61
|
+
"discount": null,
|
62
|
+
"application_fee": null
|
58
63
|
}
|
59
|
-
}
|
60
|
-
"id": "evt_00000000000000",
|
61
|
-
"livemode": false,
|
62
|
-
"object": "event",
|
63
|
-
"type": "invoice.payment_failed"
|
64
|
+
}
|
64
65
|
}
|