stripe-ruby-mock 3.1.0.rc3 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec_tests.yml +38 -0
  3. data/.rspec +2 -1
  4. data/CHANGELOG.md +36 -0
  5. data/Gemfile +0 -5
  6. data/README.md +6 -4
  7. data/lib/stripe_mock/api/client.rb +1 -1
  8. data/lib/stripe_mock/api/webhooks.rb +65 -26
  9. data/lib/stripe_mock/data.rb +80 -11
  10. data/lib/stripe_mock/instance.rb +7 -3
  11. data/lib/stripe_mock/request_handlers/accounts.rb +17 -6
  12. data/lib/stripe_mock/request_handlers/charges.rb +25 -1
  13. data/lib/stripe_mock/request_handlers/checkout_session.rb +158 -1
  14. data/lib/stripe_mock/request_handlers/customers.rb +12 -1
  15. data/lib/stripe_mock/request_handlers/events.rb +30 -3
  16. data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +1 -0
  17. data/lib/stripe_mock/request_handlers/helpers/search_helpers.rb +67 -0
  18. data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +28 -9
  19. data/lib/stripe_mock/request_handlers/invoices.rb +16 -2
  20. data/lib/stripe_mock/request_handlers/payment_intents.rb +23 -3
  21. data/lib/stripe_mock/request_handlers/payment_methods.rb +5 -1
  22. data/lib/stripe_mock/request_handlers/prices.rb +31 -4
  23. data/lib/stripe_mock/request_handlers/products.rb +14 -5
  24. data/lib/stripe_mock/request_handlers/promotion_codes.rb +43 -0
  25. data/lib/stripe_mock/request_handlers/refunds.rb +13 -2
  26. data/lib/stripe_mock/request_handlers/setup_intents.rb +16 -9
  27. data/lib/stripe_mock/request_handlers/subscriptions.rb +103 -5
  28. data/lib/stripe_mock/request_handlers/transfers.rb +12 -1
  29. data/lib/stripe_mock/request_handlers/validators/param_validators.rb +5 -4
  30. data/lib/stripe_mock/test_strategies/base.rb +51 -24
  31. data/lib/stripe_mock/version.rb +1 -1
  32. data/lib/stripe_mock/webhook_fixtures/account.updated.json +1 -1
  33. data/lib/stripe_mock/webhook_fixtures/balance.available.json +26 -20
  34. data/lib/stripe_mock/webhook_fixtures/charge.captured.json +143 -0
  35. data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +63 -16
  36. data/lib/stripe_mock/webhook_fixtures/charge.failed.json +49 -120
  37. data/lib/stripe_mock/webhook_fixtures/charge.refund.updated.json +35 -0
  38. data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +145 -50
  39. data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +114 -43
  40. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.json +79 -0
  41. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.payment_mode.json +53 -0
  42. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.setup_mode.json +45 -0
  43. data/lib/stripe_mock/webhook_fixtures/customer.created.json +37 -46
  44. data/lib/stripe_mock/webhook_fixtures/customer.deleted.json +36 -32
  45. data/lib/stripe_mock/webhook_fixtures/customer.source.created.json +31 -22
  46. data/lib/stripe_mock/webhook_fixtures/customer.source.updated.json +36 -25
  47. data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +135 -47
  48. data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +134 -45
  49. data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +135 -56
  50. data/lib/stripe_mock/webhook_fixtures/customer.updated.json +38 -47
  51. data/lib/stripe_mock/webhook_fixtures/invoice.created.json +176 -49
  52. data/lib/stripe_mock/webhook_fixtures/invoice.finalized.json +171 -0
  53. data/lib/stripe_mock/webhook_fixtures/invoice.paid.json +171 -0
  54. data/lib/stripe_mock/webhook_fixtures/invoice.payment_action_required.json +171 -0
  55. data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +149 -83
  56. data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +149 -90
  57. data/lib/stripe_mock/webhook_fixtures/invoice.upcoming.json +70 -0
  58. data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +178 -50
  59. data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +87 -13
  60. data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +88 -14
  61. data/lib/stripe_mock/webhook_fixtures/mandate.updated.json +34 -0
  62. data/lib/stripe_mock/webhook_fixtures/payment_intent.amount_capturable_updated.json +170 -0
  63. data/lib/stripe_mock/webhook_fixtures/payment_intent.canceled.json +73 -0
  64. data/lib/stripe_mock/webhook_fixtures/payment_intent.created.json +86 -0
  65. data/lib/stripe_mock/webhook_fixtures/payment_intent.payment_failed.json +118 -79
  66. data/lib/stripe_mock/webhook_fixtures/payment_intent.processing.json +162 -0
  67. data/lib/stripe_mock/webhook_fixtures/payment_intent.requires_action.json +191 -0
  68. data/lib/stripe_mock/webhook_fixtures/payment_intent.succeeded.json +85 -53
  69. data/lib/stripe_mock/webhook_fixtures/payment_link.created.json +47 -0
  70. data/lib/stripe_mock/webhook_fixtures/payment_link.updated.json +50 -0
  71. data/lib/stripe_mock/webhook_fixtures/payment_method.attached.json +63 -0
  72. data/lib/stripe_mock/webhook_fixtures/payment_method.detached.json +62 -0
  73. data/lib/stripe_mock/webhook_fixtures/payout.created.json +40 -0
  74. data/lib/stripe_mock/webhook_fixtures/payout.paid.json +40 -0
  75. data/lib/stripe_mock/webhook_fixtures/payout.updated.json +46 -0
  76. data/lib/stripe_mock/webhook_fixtures/plan.created.json +30 -13
  77. data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +30 -13
  78. data/lib/stripe_mock/webhook_fixtures/plan.updated.json +34 -14
  79. data/lib/stripe_mock/webhook_fixtures/price.created.json +42 -0
  80. data/lib/stripe_mock/webhook_fixtures/price.deleted.json +42 -0
  81. data/lib/stripe_mock/webhook_fixtures/price.updated.json +48 -0
  82. data/lib/stripe_mock/webhook_fixtures/product.created.json +19 -13
  83. data/lib/stripe_mock/webhook_fixtures/product.deleted.json +20 -14
  84. data/lib/stripe_mock/webhook_fixtures/product.updated.json +24 -15
  85. data/lib/stripe_mock/webhook_fixtures/quote.accepted.json +92 -0
  86. data/lib/stripe_mock/webhook_fixtures/quote.canceled.json +92 -0
  87. data/lib/stripe_mock/webhook_fixtures/quote.created.json +92 -0
  88. data/lib/stripe_mock/webhook_fixtures/quote.finalized.json +92 -0
  89. data/lib/stripe_mock/webhook_fixtures/setup_intent.canceled.json +46 -0
  90. data/lib/stripe_mock/webhook_fixtures/setup_intent.created.json +51 -0
  91. data/lib/stripe_mock/webhook_fixtures/setup_intent.setup_failed.json +100 -0
  92. data/lib/stripe_mock/webhook_fixtures/setup_intent.succeeded.json +46 -0
  93. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.canceled.json +119 -0
  94. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.created.json +114 -0
  95. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.released.json +111 -0
  96. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.updated.json +125 -0
  97. data/lib/stripe_mock/webhook_fixtures/tax_rate.created.json +32 -0
  98. data/lib/stripe_mock/webhook_fixtures/tax_rate.updated.json +37 -0
  99. data/lib/stripe_mock.rb +4 -1
  100. data/spec/instance_spec.rb +3 -1
  101. data/spec/integration_examples/completing_checkout_sessions_example.rb +37 -0
  102. data/spec/readme_spec.rb +1 -1
  103. data/spec/shared_stripe_examples/account_examples.rb +9 -1
  104. data/spec/shared_stripe_examples/bank_token_examples.rb +5 -7
  105. data/spec/shared_stripe_examples/charge_examples.rb +97 -0
  106. data/spec/shared_stripe_examples/checkout_session_examples.rb +99 -0
  107. data/spec/shared_stripe_examples/customer_examples.rb +56 -0
  108. data/spec/shared_stripe_examples/invoice_examples.rb +107 -1
  109. data/spec/shared_stripe_examples/payment_intent_examples.rb +136 -0
  110. data/spec/shared_stripe_examples/payment_method_examples.rb +32 -27
  111. data/spec/shared_stripe_examples/price_examples.rb +111 -2
  112. data/spec/shared_stripe_examples/product_examples.rb +68 -0
  113. data/spec/shared_stripe_examples/promotion_code_examples.rb +68 -0
  114. data/spec/shared_stripe_examples/refund_examples.rb +13 -0
  115. data/spec/shared_stripe_examples/setup_intent_examples.rb +17 -0
  116. data/spec/shared_stripe_examples/subscription_examples.rb +276 -6
  117. data/spec/shared_stripe_examples/transfer_examples.rb +10 -1
  118. data/spec/shared_stripe_examples/webhook_event_examples.rb +51 -5
  119. data/spec/spec_helper.rb +1 -1
  120. data/spec/support/stripe_examples.rb +3 -1
  121. data/stripe-ruby-mock.gemspec +3 -4
  122. metadata +59 -29
  123. data/.travis.yml +0 -25
  124. data/lib/stripe_mock/request_handlers/checkout.rb +0 -15
  125. data/spec/shared_stripe_examples/checkout_examples.rb +0 -47
@@ -1,21 +1,95 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "invoiceitem.created",
2
+ "id": "evt_000000000000000000000000",
6
3
  "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320097,
7
6
  "data": {
8
7
  "object": {
8
+ "id": "ii_000000000000000000000000",
9
9
  "object": "invoiceitem",
10
- "id": "ii_00000000000000",
11
- "date": 1372126711,
12
- "amount": 2500,
13
- "livemode": false,
14
- "proration": false,
10
+ "amount": -1500,
15
11
  "currency": "usd",
16
12
  "customer": "cus_00000000000000",
17
- "description": "Plan: Veteran's Club Signup Fee Plan Id: 4",
18
- "invoice": "in_00000000000000"
13
+ "date": 1648320097,
14
+ "description": "Unused time on myproduct after 26 Mar 2022",
15
+ "discountable": false,
16
+ "discounts": [
17
+
18
+ ],
19
+ "invoice": null,
20
+ "livemode": false,
21
+ "metadata": {
22
+ },
23
+ "period": {
24
+ "end": 1650998496,
25
+ "start": 1648320097
26
+ },
27
+ "plan": {
28
+ "id": "price_000000000000000000000000",
29
+ "object": "plan",
30
+ "active": true,
31
+ "aggregate_usage": null,
32
+ "amount": 1500,
33
+ "amount_decimal": "1500",
34
+ "billing_scheme": "per_unit",
35
+ "created": 1648320095,
36
+ "currency": "usd",
37
+ "interval": "month",
38
+ "interval_count": 1,
39
+ "livemode": false,
40
+ "metadata": {
41
+ },
42
+ "nickname": null,
43
+ "product": "prod_00000000000000",
44
+ "tiers_mode": null,
45
+ "transform_usage": null,
46
+ "trial_period_days": null,
47
+ "usage_type": "licensed"
48
+ },
49
+ "price": {
50
+ "id": "price_000000000000000000000000",
51
+ "object": "price",
52
+ "active": true,
53
+ "billing_scheme": "per_unit",
54
+ "created": 1648320095,
55
+ "currency": "usd",
56
+ "livemode": false,
57
+ "lookup_key": null,
58
+ "metadata": {
59
+ },
60
+ "nickname": null,
61
+ "product": "prod_00000000000000",
62
+ "recurring": {
63
+ "aggregate_usage": null,
64
+ "interval": "month",
65
+ "interval_count": 1,
66
+ "trial_period_days": null,
67
+ "usage_type": "licensed"
68
+ },
69
+ "tax_behavior": "unspecified",
70
+ "tiers_mode": null,
71
+ "transform_quantity": null,
72
+ "type": "recurring",
73
+ "unit_amount": 1500,
74
+ "unit_amount_decimal": "1500"
75
+ },
76
+ "proration": true,
77
+ "quantity": 1,
78
+ "subscription": "sub_000000000000000000000000",
79
+ "subscription_item": "si_00000000000000",
80
+ "tax_rates": [
81
+
82
+ ],
83
+ "test_clock": null,
84
+ "unit_amount": -1500,
85
+ "unit_amount_decimal": "-1500"
19
86
  }
20
- }
21
- }
87
+ },
88
+ "livemode": false,
89
+ "pending_webhooks": 2,
90
+ "request": {
91
+ "id": "req_00000000000000",
92
+ "idempotency_key": "27f56452-b979-42fb-8bc1-219db1e65979"
93
+ },
94
+ "type": "invoiceitem.created"
95
+ }
@@ -1,24 +1,98 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "invoiceitem.updated",
2
+ "id": "evt_000000000000000000000000",
6
3
  "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320097,
7
6
  "data": {
8
7
  "object": {
8
+ "id": "ii_000000000000000000000000",
9
9
  "object": "invoiceitem",
10
- "id": "ii_00000000000000",
11
- "date": 1372126711,
12
- "amount": 2500,
13
- "livemode": false,
14
- "proration": false,
10
+ "amount": -1500,
15
11
  "currency": "usd",
16
12
  "customer": "cus_00000000000000",
17
- "description": "Plan: Veteran's Club Signup Fee Plan Id: 4",
18
- "invoice": "in_00000000000000"
13
+ "date": 1648320097,
14
+ "description": "Unused time on myproduct after 26 Mar 2022",
15
+ "discountable": false,
16
+ "discounts": [
17
+
18
+ ],
19
+ "invoice": "in_000000000000000000000000",
20
+ "livemode": false,
21
+ "metadata": {
22
+ },
23
+ "period": {
24
+ "end": 1650998496,
25
+ "start": 1648320097
26
+ },
27
+ "plan": {
28
+ "id": "price_000000000000000000000000",
29
+ "object": "plan",
30
+ "active": true,
31
+ "aggregate_usage": null,
32
+ "amount": 1500,
33
+ "amount_decimal": "1500",
34
+ "billing_scheme": "per_unit",
35
+ "created": 1648320095,
36
+ "currency": "usd",
37
+ "interval": "month",
38
+ "interval_count": 1,
39
+ "livemode": false,
40
+ "metadata": {
41
+ },
42
+ "nickname": null,
43
+ "product": "prod_00000000000000",
44
+ "tiers_mode": null,
45
+ "transform_usage": null,
46
+ "trial_period_days": null,
47
+ "usage_type": "licensed"
48
+ },
49
+ "price": {
50
+ "id": "price_000000000000000000000000",
51
+ "object": "price",
52
+ "active": true,
53
+ "billing_scheme": "per_unit",
54
+ "created": 1648320095,
55
+ "currency": "usd",
56
+ "livemode": false,
57
+ "lookup_key": null,
58
+ "metadata": {
59
+ },
60
+ "nickname": null,
61
+ "product": "prod_00000000000000",
62
+ "recurring": {
63
+ "aggregate_usage": null,
64
+ "interval": "month",
65
+ "interval_count": 1,
66
+ "trial_period_days": null,
67
+ "usage_type": "licensed"
68
+ },
69
+ "tax_behavior": "unspecified",
70
+ "tiers_mode": null,
71
+ "transform_quantity": null,
72
+ "type": "recurring",
73
+ "unit_amount": 1500,
74
+ "unit_amount_decimal": "1500"
75
+ },
76
+ "proration": true,
77
+ "quantity": 1,
78
+ "subscription": "sub_000000000000000000000000",
79
+ "subscription_item": "si_00000000000000",
80
+ "tax_rates": [
81
+
82
+ ],
83
+ "test_clock": null,
84
+ "unit_amount": -1500,
85
+ "unit_amount_decimal": "-1500"
19
86
  },
20
87
  "previous_attributes": {
21
- "amount": 2121
88
+ "invoice": null
22
89
  }
23
- }
24
- }
90
+ },
91
+ "livemode": false,
92
+ "pending_webhooks": 2,
93
+ "request": {
94
+ "id": "req_00000000000000",
95
+ "idempotency_key": "27f56452-b979-42fb-8bc1-219db1e65979"
96
+ },
97
+ "type": "invoiceitem.updated"
98
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "mandate.updated",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "id": "mandate_000000000000000000000000",
10
+ "object": "mandate",
11
+ "customer_acceptance": {
12
+ "accepted_at": 1326853478,
13
+ "online": {
14
+ "ip_address": "0.0.0.0",
15
+ "user_agent": "UserAgent"
16
+ },
17
+ "type": "online"
18
+ },
19
+ "livemode": false,
20
+ "multi_use": {},
21
+ "payment_method": "pm_000000000000000000000000",
22
+ "payment_method_details": {},
23
+ "status": "active",
24
+ "type": "multi_use"
25
+ },
26
+ "previous_attributes": {
27
+ "payment_method_details": {
28
+ "bacs_debit": {
29
+ "network_status": "pending"
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,170 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320022,
6
+ "data": {
7
+ "object": {
8
+ "id": "pi_000000000000000000000000",
9
+ "object": "payment_intent",
10
+ "amount": 2000,
11
+ "amount_capturable": 2000,
12
+ "amount_received": 0,
13
+ "application": null,
14
+ "application_fee_amount": null,
15
+ "automatic_payment_methods": null,
16
+ "canceled_at": null,
17
+ "cancellation_reason": null,
18
+ "capture_method": "manual",
19
+ "charges": {
20
+ "object": "list",
21
+ "data": [
22
+ {
23
+ "id": "ch_000000000000000000000000",
24
+ "object": "charge",
25
+ "amount": 2000,
26
+ "amount_captured": 0,
27
+ "amount_refunded": 0,
28
+ "application": null,
29
+ "application_fee": null,
30
+ "application_fee_amount": null,
31
+ "balance_transaction": null,
32
+ "billing_details": {
33
+ "address": {
34
+ "city": null,
35
+ "country": null,
36
+ "line1": null,
37
+ "line2": null,
38
+ "postal_code": null,
39
+ "state": null
40
+ },
41
+ "email": null,
42
+ "name": null,
43
+ "phone": null
44
+ },
45
+ "calculated_statement_descriptor": "EXAMPLECOMPANY",
46
+ "captured": false,
47
+ "created": 1648320022,
48
+ "currency": "usd",
49
+ "customer": null,
50
+ "description": "(created by Stripe CLI)",
51
+ "destination": null,
52
+ "dispute": null,
53
+ "disputed": false,
54
+ "failure_code": null,
55
+ "failure_message": null,
56
+ "fraud_details": {
57
+ },
58
+ "invoice": null,
59
+ "livemode": false,
60
+ "metadata": {
61
+ },
62
+ "on_behalf_of": null,
63
+ "order": null,
64
+ "outcome": {
65
+ "network_status": "approved_by_network",
66
+ "reason": null,
67
+ "risk_level": "normal",
68
+ "risk_score": 2,
69
+ "seller_message": "Payment complete.",
70
+ "type": "authorized"
71
+ },
72
+ "paid": true,
73
+ "payment_intent": "pi_000000000000000000000000",
74
+ "payment_method": "pm_000000000000000000000000",
75
+ "payment_method_details": {
76
+ "card": {
77
+ "brand": "visa",
78
+ "checks": {
79
+ "address_line1_check": null,
80
+ "address_postal_code_check": null,
81
+ "cvc_check": null
82
+ },
83
+ "country": "US",
84
+ "exp_month": 3,
85
+ "exp_year": 2023,
86
+ "fingerprint": "ZoVSX2dK5igWt2SB",
87
+ "funding": "credit",
88
+ "installments": null,
89
+ "last4": "4242",
90
+ "mandate": null,
91
+ "network": "visa",
92
+ "three_d_secure": null,
93
+ "wallet": null
94
+ },
95
+ "type": "card"
96
+ },
97
+ "receipt_email": null,
98
+ "receipt_number": null,
99
+ "receipt_url": "https://pay.stripe.com/receipts/acct_0000000000000000/ch_000000000000000000000000/rcpt_0000000000000000000000000000000",
100
+ "refunded": false,
101
+ "refunds": {
102
+ "object": "list",
103
+ "data": [
104
+
105
+ ],
106
+ "has_more": false,
107
+ "total_count": 0,
108
+ "url": "/v1/charges/ch_000000000000000000000000/refunds"
109
+ },
110
+ "review": null,
111
+ "shipping": null,
112
+ "source": null,
113
+ "source_transfer": null,
114
+ "statement_descriptor": null,
115
+ "statement_descriptor_suffix": null,
116
+ "status": "succeeded",
117
+ "transfer_data": null,
118
+ "transfer_group": null
119
+ }
120
+ ],
121
+ "has_more": false,
122
+ "total_count": 1,
123
+ "url": "/v1/charges?payment_intent=pi_000000000000000000000000"
124
+ },
125
+ "client_secret": "pi_000000000000000000000000_secret_0000000000000000000000000",
126
+ "confirmation_method": "manual",
127
+ "created": 1648320022,
128
+ "currency": "usd",
129
+ "customer": null,
130
+ "description": "(created by Stripe CLI)",
131
+ "invoice": null,
132
+ "last_payment_error": null,
133
+ "livemode": false,
134
+ "metadata": {
135
+ },
136
+ "next_action": null,
137
+ "on_behalf_of": null,
138
+ "payment_method": "pm_000000000000000000000000",
139
+ "payment_method_options": {
140
+ "card": {
141
+ "installments": null,
142
+ "mandate_options": null,
143
+ "network": null,
144
+ "request_three_d_secure": "automatic"
145
+ }
146
+ },
147
+ "payment_method_types": [
148
+ "card"
149
+ ],
150
+ "processing": null,
151
+ "receipt_email": null,
152
+ "review": null,
153
+ "setup_future_usage": null,
154
+ "shipping": null,
155
+ "source": null,
156
+ "statement_descriptor": null,
157
+ "statement_descriptor_suffix": null,
158
+ "status": "requires_capture",
159
+ "transfer_data": null,
160
+ "transfer_group": null
161
+ }
162
+ },
163
+ "livemode": false,
164
+ "pending_webhooks": 2,
165
+ "request": {
166
+ "id": "req_00000000000000",
167
+ "idempotency_key": "b7b0532f-40b9-4008-8b6c-62b902c370cd"
168
+ },
169
+ "type": "payment_intent.amount_capturable_updated"
170
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320024,
6
+ "data": {
7
+ "object": {
8
+ "id": "pi_000000000000000000000000",
9
+ "object": "payment_intent",
10
+ "amount": 2000,
11
+ "amount_capturable": 0,
12
+ "amount_received": 0,
13
+ "application": null,
14
+ "application_fee_amount": null,
15
+ "automatic_payment_methods": null,
16
+ "canceled_at": 1648320024,
17
+ "cancellation_reason": "requested_by_customer",
18
+ "capture_method": "automatic",
19
+ "charges": {
20
+ "object": "list",
21
+ "data": [
22
+
23
+ ],
24
+ "has_more": false,
25
+ "total_count": 0,
26
+ "url": "/v1/charges?payment_intent=pi_000000000000000000000000"
27
+ },
28
+ "client_secret": "pi_000000000000000000000000_secret_0000000000000000000000000",
29
+ "confirmation_method": "automatic",
30
+ "created": 1648320024,
31
+ "currency": "usd",
32
+ "customer": null,
33
+ "description": "(created by Stripe CLI)",
34
+ "invoice": null,
35
+ "last_payment_error": null,
36
+ "livemode": false,
37
+ "metadata": {
38
+ },
39
+ "next_action": null,
40
+ "on_behalf_of": null,
41
+ "payment_method": null,
42
+ "payment_method_options": {
43
+ "card": {
44
+ "installments": null,
45
+ "mandate_options": null,
46
+ "network": null,
47
+ "request_three_d_secure": "automatic"
48
+ }
49
+ },
50
+ "payment_method_types": [
51
+ "card"
52
+ ],
53
+ "processing": null,
54
+ "receipt_email": null,
55
+ "review": null,
56
+ "setup_future_usage": null,
57
+ "shipping": null,
58
+ "source": null,
59
+ "statement_descriptor": null,
60
+ "statement_descriptor_suffix": null,
61
+ "status": "canceled",
62
+ "transfer_data": null,
63
+ "transfer_group": null
64
+ }
65
+ },
66
+ "livemode": false,
67
+ "pending_webhooks": 2,
68
+ "request": {
69
+ "id": "req_00000000000000",
70
+ "idempotency_key": "696d09f4-dbea-44e6-8c70-39430b961361"
71
+ },
72
+ "type": "payment_intent.canceled"
73
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320032,
6
+ "data": {
7
+ "object": {
8
+ "id": "pi_000000000000000000000000",
9
+ "object": "payment_intent",
10
+ "amount": 2000,
11
+ "amount_capturable": 0,
12
+ "amount_received": 0,
13
+ "application": null,
14
+ "application_fee_amount": null,
15
+ "automatic_payment_methods": null,
16
+ "canceled_at": null,
17
+ "cancellation_reason": null,
18
+ "capture_method": "automatic",
19
+ "charges": {
20
+ "object": "list",
21
+ "data": [
22
+
23
+ ],
24
+ "has_more": false,
25
+ "total_count": 0,
26
+ "url": "/v1/charges?payment_intent=pi_000000000000000000000000"
27
+ },
28
+ "client_secret": "pi_000000000000000000000000_secret_0000000000000000000000000",
29
+ "confirmation_method": "automatic",
30
+ "created": 1648320032,
31
+ "currency": "usd",
32
+ "customer": null,
33
+ "description": "(created by Stripe CLI)",
34
+ "invoice": null,
35
+ "last_payment_error": null,
36
+ "livemode": false,
37
+ "metadata": {
38
+ },
39
+ "next_action": null,
40
+ "on_behalf_of": null,
41
+ "payment_method": null,
42
+ "payment_method_options": {
43
+ "card": {
44
+ "installments": null,
45
+ "mandate_options": null,
46
+ "network": null,
47
+ "request_three_d_secure": "automatic"
48
+ }
49
+ },
50
+ "payment_method_types": [
51
+ "card"
52
+ ],
53
+ "processing": null,
54
+ "receipt_email": null,
55
+ "review": null,
56
+ "setup_future_usage": null,
57
+ "shipping": {
58
+ "address": {
59
+ "city": "San Francisco",
60
+ "country": "US",
61
+ "line1": "510 Townsend St",
62
+ "line2": null,
63
+ "postal_code": "94103",
64
+ "state": "CA"
65
+ },
66
+ "carrier": null,
67
+ "name": "Jenny Rosen",
68
+ "phone": null,
69
+ "tracking_number": null
70
+ },
71
+ "source": null,
72
+ "statement_descriptor": null,
73
+ "statement_descriptor_suffix": null,
74
+ "status": "requires_payment_method",
75
+ "transfer_data": null,
76
+ "transfer_group": null
77
+ }
78
+ },
79
+ "livemode": false,
80
+ "pending_webhooks": 2,
81
+ "request": {
82
+ "id": "req_00000000000000",
83
+ "idempotency_key": "7143a956-2f40-407a-b312-43038ae76c86"
84
+ },
85
+ "type": "payment_intent.created"
86
+ }