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,18 +1,18 @@
1
1
  {
2
- "id": "evt_00000000000000",
2
+ "id": "evt_000000000000000000000000",
3
3
  "object": "event",
4
- "api_version": "2018-02-28",
5
- "created": 1578401135,
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320029,
6
6
  "data": {
7
7
  "object": {
8
- "id": "pi_00000000000000",
8
+ "id": "pi_000000000000000000000000",
9
9
  "object": "payment_intent",
10
- "allowed_source_types": ["card", "sepa_debit"],
11
- "amount": 200,
10
+ "amount": 2000,
12
11
  "amount_capturable": 0,
13
12
  "amount_received": 0,
14
13
  "application": null,
15
14
  "application_fee_amount": null,
15
+ "automatic_payment_methods": null,
16
16
  "canceled_at": null,
17
17
  "cancellation_reason": null,
18
18
  "capture_method": "automatic",
@@ -20,9 +20,10 @@
20
20
  "object": "list",
21
21
  "data": [
22
22
  {
23
- "id": "py_00000000000000",
23
+ "id": "ch_000000000000000000000000",
24
24
  "object": "charge",
25
- "amount": 200,
25
+ "amount": 2000,
26
+ "amount_captured": 0,
26
27
  "amount_refunded": 0,
27
28
  "application": null,
28
29
  "application_fee": null,
@@ -37,89 +38,105 @@
37
38
  "postal_code": null,
38
39
  "state": null
39
40
  },
40
- "email": "john.doe@example.com",
41
- "name": "John Doe",
41
+ "email": null,
42
+ "name": null,
42
43
  "phone": null
43
44
  },
44
- "captured": true,
45
- "created": 1578401129,
46
- "currency": "eur",
47
- "customer": "cus_00000000000000",
48
- "description": null,
49
- "destination": "acct_00000000000000",
45
+ "calculated_statement_descriptor": "EXAMPLECOMPANY",
46
+ "captured": false,
47
+ "created": 1648320028,
48
+ "currency": "usd",
49
+ "customer": null,
50
+ "description": "(created by Stripe CLI)",
51
+ "destination": null,
50
52
  "dispute": null,
51
53
  "disputed": false,
52
- "failure_code": null,
53
- "failure_message": null,
54
- "fraud_details": {},
54
+ "failure_code": "card_declined",
55
+ "failure_message": "Your card was declined.",
56
+ "fraud_details": {
57
+ },
55
58
  "invoice": null,
56
59
  "livemode": false,
57
- "metadata": {},
60
+ "metadata": {
61
+ },
58
62
  "on_behalf_of": null,
59
63
  "order": null,
60
64
  "outcome": {
61
- "network_status": "approved_by_network",
62
- "reason": null,
63
- "risk_level": "not_assessed",
64
- "seller_message": "Payment complete.",
65
- "type": "authorized"
65
+ "network_status": "declined_by_network",
66
+ "reason": "generic_decline",
67
+ "risk_level": "normal",
68
+ "risk_score": 1,
69
+ "seller_message": "The bank did not return any further details with this decline.",
70
+ "type": "issuer_declined"
66
71
  },
67
72
  "paid": false,
68
- "payment_intent": "pi_00000000000000",
69
- "payment_method": "pm_00000000000000",
73
+ "payment_intent": "pi_000000000000000000000000",
74
+ "payment_method": "pm_000000000000000000000000",
70
75
  "payment_method_details": {
71
- "sepa_debit": {
72
- "bank_code": "37040044",
73
- "branch_code": null,
74
- "country": "DE",
75
- "fingerprint": "00000000000000",
76
- "last4": "3001",
77
- "mandate": "mandate_00000000000000"
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": "kMzSwhaalD1uR96R",
87
+ "funding": "credit",
88
+ "installments": null,
89
+ "last4": "0002",
90
+ "mandate": null,
91
+ "network": "visa",
92
+ "three_d_secure": null,
93
+ "wallet": null
78
94
  },
79
- "type": "sepa_debit"
95
+ "type": "card"
80
96
  },
81
97
  "receipt_email": null,
82
98
  "receipt_number": null,
83
- "receipt_url": "https://pay.stripe.com/receipts/acct_00000000000000/py_00000000000000/rcpt_00000000000000",
99
+ "receipt_url": null,
84
100
  "refunded": false,
85
101
  "refunds": {
86
102
  "object": "list",
87
- "data": [],
103
+ "data": [
104
+
105
+ ],
88
106
  "has_more": false,
89
107
  "total_count": 0,
90
- "url": "/v1/charges/py_00000000000000/refunds"
108
+ "url": "/v1/charges/ch_000000000000000000000000/refunds"
91
109
  },
92
110
  "review": null,
93
111
  "shipping": null,
94
112
  "source": null,
95
113
  "source_transfer": null,
96
- "statement_descriptor": "ACME Corp",
114
+ "statement_descriptor": null,
97
115
  "statement_descriptor_suffix": null,
98
116
  "status": "failed",
99
- "transfer_data": {
100
- "amount": null,
101
- "destination": "acct_00000000000000"
102
- },
103
- "transfer_group": "group_pi_00000000000000"
117
+ "transfer_data": null,
118
+ "transfer_group": null
104
119
  }
105
120
  ],
106
121
  "has_more": false,
107
122
  "total_count": 1,
108
- "url": "/v1/charges?payment_intent=pi_00000000000000"
123
+ "url": "/v1/charges?payment_intent=pi_000000000000000000000000"
109
124
  },
110
- "client_secret": "pi_00000000000000",
125
+ "client_secret": "pi_000000000000000000000000_secret_0000000000000000000000000",
111
126
  "confirmation_method": "automatic",
112
- "created": 1578401129,
113
- "currency": "eur",
114
- "customer": "cus_00000000000000",
115
- "description": null,
127
+ "created": 1648320028,
128
+ "currency": "usd",
129
+ "customer": null,
130
+ "description": "(created by Stripe CLI)",
116
131
  "invoice": null,
117
132
  "last_payment_error": {
118
- "code": "payment_intent_payment_attempt_failed",
119
- "doc_url": "https://stripe.com/docs/error-codes/payment-intent-payment-attempt-failed",
120
- "message": "The payment failed.",
133
+ "charge": "ch_000000000000000000000000",
134
+ "code": "card_declined",
135
+ "decline_code": "generic_decline",
136
+ "doc_url": "https://stripe.com/docs/error-codes/card-declined",
137
+ "message": "Your card was declined.",
121
138
  "payment_method": {
122
- "id": "pm_00000000000000",
139
+ "id": "pm_000000000000000000000000",
123
140
  "object": "payment_method",
124
141
  "billing_details": {
125
142
  "address": {
@@ -130,57 +147,79 @@
130
147
  "postal_code": null,
131
148
  "state": null
132
149
  },
133
- "email": "john.doe@example.com",
134
- "name": "John Doe",
150
+ "email": null,
151
+ "name": null,
135
152
  "phone": null
136
153
  },
137
- "created": 1578400666,
138
- "customer": "cus_00000000000000",
154
+ "card": {
155
+ "brand": "visa",
156
+ "checks": {
157
+ "address_line1_check": null,
158
+ "address_postal_code_check": null,
159
+ "cvc_check": null
160
+ },
161
+ "country": "US",
162
+ "exp_month": 3,
163
+ "exp_year": 2023,
164
+ "fingerprint": "kMzSwhaalD1uR96R",
165
+ "funding": "credit",
166
+ "generated_from": null,
167
+ "last4": "0002",
168
+ "networks": {
169
+ "available": [
170
+ "visa"
171
+ ],
172
+ "preferred": null
173
+ },
174
+ "three_d_secure_usage": {
175
+ "supported": true
176
+ },
177
+ "wallet": null
178
+ },
179
+ "created": 1648320028,
180
+ "customer": null,
139
181
  "livemode": false,
140
- "metadata": {},
141
- "sepa_debit": {
142
- "bank_code": "37040044",
143
- "branch_code": "",
144
- "country": "DE",
145
- "fingerprint": "00000000000000",
146
- "last4": "3001"
182
+ "metadata": {
147
183
  },
148
- "type": "sepa_debit"
184
+ "type": "card"
149
185
  },
150
- "type": "invalid_request_error"
186
+ "type": "card_error"
151
187
  },
152
188
  "livemode": false,
153
- "metadata": {},
189
+ "metadata": {
190
+ },
154
191
  "next_action": null,
155
- "next_source_action": null,
156
192
  "on_behalf_of": null,
157
193
  "payment_method": null,
158
194
  "payment_method_options": {
159
195
  "card": {
160
196
  "installments": null,
197
+ "mandate_options": null,
198
+ "network": null,
161
199
  "request_three_d_secure": "automatic"
162
200
  }
163
201
  },
164
- "payment_method_types": ["card", "sepa_debit"],
202
+ "payment_method_types": [
203
+ "card"
204
+ ],
205
+ "processing": null,
165
206
  "receipt_email": null,
166
207
  "review": null,
167
208
  "setup_future_usage": null,
168
209
  "shipping": null,
169
210
  "source": null,
170
- "statement_descriptor": "ACME Corp",
211
+ "statement_descriptor": null,
171
212
  "statement_descriptor_suffix": null,
172
- "status": "requires_source",
173
- "transfer_data": {
174
- "destination": "acct_00000000000000"
175
- },
213
+ "status": "requires_payment_method",
214
+ "transfer_data": null,
176
215
  "transfer_group": null
177
216
  }
178
217
  },
179
218
  "livemode": false,
180
- "pending_webhooks": 3,
219
+ "pending_webhooks": 2,
181
220
  "request": {
182
- "id": null,
183
- "idempotency_key": null
221
+ "id": "req_00000000000000",
222
+ "idempotency_key": "57ddc22f-1d42-446f-8f91-85cf0d32084a"
184
223
  },
185
224
  "type": "payment_intent.payment_failed"
186
- }
225
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "id": "evt_00000000000000",
3
+ "object": "event",
4
+ "api_version": "2018-02-28",
5
+ "created": 1578499109,
6
+ "data": {
7
+ "object": {
8
+ "id": "pi_00000000000000",
9
+ "object": "payment_intent",
10
+ "allowed_source_types": ["card", "sepa_debit"],
11
+ "amount": 900,
12
+ "amount_capturable": 0,
13
+ "amount_received": 0,
14
+ "application": null,
15
+ "application_fee_amount": null,
16
+ "canceled_at": null,
17
+ "cancellation_reason": null,
18
+ "capture_method": "automatic",
19
+ "charges": {
20
+ "object": "list",
21
+ "data": [
22
+ {
23
+ "id": "ch_00000000000000",
24
+ "object": "charge",
25
+ "amount": 900,
26
+ "amount_refunded": 0,
27
+ "application": null,
28
+ "application_fee": null,
29
+ "application_fee_amount": null,
30
+ "balance_transaction": "txn_00000000000000",
31
+ "billing_details": {
32
+ "address": {
33
+ "city": null,
34
+ "country": "DE",
35
+ "line1": null,
36
+ "line2": null,
37
+ "postal_code": null,
38
+ "state": null
39
+ },
40
+ "email": null,
41
+ "name": null,
42
+ "phone": null
43
+ },
44
+ "captured": true,
45
+ "created": 1578499109,
46
+ "currency": "eur",
47
+ "customer": "cus_00000000000000",
48
+ "description": null,
49
+ "destination": "acct_00000000000000",
50
+ "dispute": null,
51
+ "disputed": false,
52
+ "failure_code": null,
53
+ "failure_message": null,
54
+ "fraud_details": {},
55
+ "invoice": null,
56
+ "livemode": false,
57
+ "metadata": {},
58
+ "on_behalf_of": null,
59
+ "order": null,
60
+ "outcome": {
61
+ "network_status": "approved_by_network",
62
+ "reason": null,
63
+ "risk_level": "normal",
64
+ "risk_score": 40,
65
+ "seller_message": "Payment complete.",
66
+ "type": "authorized"
67
+ },
68
+ "paid": false,
69
+ "payment_intent": "pi_00000000000000",
70
+ "payment_method": "pm_00000000000000",
71
+ "payment_method_details": {
72
+ "card": {
73
+ "brand": "visa",
74
+ "checks": {
75
+ "address_line1_check": null,
76
+ "address_postal_code_check": null,
77
+ "cvc_check": null
78
+ },
79
+ "country": "US",
80
+ "exp_month": 4,
81
+ "exp_year": 2024,
82
+ "fingerprint": "00000000000000",
83
+ "funding": "credit",
84
+ "installments": null,
85
+ "last4": "4242",
86
+ "network": "visa",
87
+ "three_d_secure": null,
88
+ "wallet": null
89
+ },
90
+ "type": "card"
91
+ },
92
+ "receipt_email": null,
93
+ "receipt_number": null,
94
+ "receipt_url": "https://pay.stripe.com/receipts/acct_00000000000000/ch_00000000000000/rcpt_00000000000000",
95
+ "refunded": false,
96
+ "refunds": {
97
+ "object": "list",
98
+ "data": [],
99
+ "has_more": false,
100
+ "total_count": 0,
101
+ "url": "/v1/charges/ch_00000000000000/refunds"
102
+ },
103
+ "review": null,
104
+ "shipping": null,
105
+ "source": null,
106
+ "source_transfer": null,
107
+ "statement_descriptor": "ACME Corp",
108
+ "statement_descriptor_suffix": null,
109
+ "status": "succeeded",
110
+ "transfer": "tr_00000000000000",
111
+ "transfer_data": {
112
+ "amount": null,
113
+ "destination": "acct_00000000000000"
114
+ },
115
+ "transfer_group": "group_pi_00000000000000"
116
+ }
117
+ ],
118
+ "has_more": false,
119
+ "total_count": 1,
120
+ "url": "/v1/charges?payment_intent=pi_00000000000000"
121
+ },
122
+ "client_secret": "pi_00000000000000",
123
+ "confirmation_method": "automatic",
124
+ "created": 1578499108,
125
+ "currency": "eur",
126
+ "customer": "cus_00000000000000",
127
+ "description": null,
128
+ "invoice": null,
129
+ "last_payment_error": null,
130
+ "livemode": false,
131
+ "metadata": {},
132
+ "next_action": null,
133
+ "next_source_action": null,
134
+ "on_behalf_of": null,
135
+ "payment_method": "pm_00000000000000",
136
+ "payment_method_options": {
137
+ "card": {
138
+ "installments": null,
139
+ "request_three_d_secure": "automatic"
140
+ }
141
+ },
142
+ "payment_method_types": ["card", "sepa_debit"],
143
+ "receipt_email": null,
144
+ "review": null,
145
+ "setup_future_usage": null,
146
+ "shipping": null,
147
+ "source": null,
148
+ "statement_descriptor": "ACME Corp",
149
+ "statement_descriptor_suffix": null,
150
+ "status": "processing",
151
+ "transfer_data": null,
152
+ "transfer_group": null
153
+ }
154
+ },
155
+ "livemode": false,
156
+ "pending_webhooks": 2,
157
+ "request": {
158
+ "id": "req_00000000000000",
159
+ "idempotency_key": null
160
+ },
161
+ "type": "payment_intent.processing"
162
+ }
@@ -0,0 +1,191 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320004,
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
+ "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": 1648320002,
48
+ "currency": "usd",
49
+ "customer": "cus_00000000000000",
50
+ "description": "Payment for Invoice",
51
+ "destination": null,
52
+ "dispute": null,
53
+ "disputed": false,
54
+ "failure_code": "authentication_required",
55
+ "failure_message": "Your card was declined. This transaction requires authentication.",
56
+ "fraud_details": {
57
+ },
58
+ "invoice": "in_000000000000000000000000",
59
+ "livemode": false,
60
+ "metadata": {
61
+ },
62
+ "on_behalf_of": null,
63
+ "order": null,
64
+ "outcome": {
65
+ "network_status": "declined_by_network",
66
+ "reason": "authentication_required",
67
+ "risk_level": "normal",
68
+ "risk_score": 15,
69
+ "seller_message": "The bank returned the decline code `authentication_required`.",
70
+ "type": "issuer_declined"
71
+ },
72
+ "paid": false,
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": "pass"
82
+ },
83
+ "country": "IE",
84
+ "exp_month": 7,
85
+ "exp_year": 2025,
86
+ "fingerprint": "R0zFsMh6EQNC0f1H",
87
+ "funding": "credit",
88
+ "installments": null,
89
+ "last4": "3220",
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": null,
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": "failed",
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": "automatic",
127
+ "created": 1648320001,
128
+ "currency": "usd",
129
+ "customer": "cus_00000000000000",
130
+ "description": "Payment for Invoice",
131
+ "invoice": "in_000000000000000000000000",
132
+ "last_payment_error": null,
133
+ "livemode": false,
134
+ "metadata": {
135
+ },
136
+ "next_action": {
137
+ "type": "use_stripe_sdk",
138
+ "use_stripe_sdk": {
139
+ "type": "stripe_3ds2_fingerprint",
140
+ "merchant": "acct_0000000000000000",
141
+ "three_d_secure_2_source": "src_000000000000000000000000",
142
+ "directory_server_name": "visa",
143
+ "server_transaction_id": "b973c110-2ca1-46fa-8bce-dc18259d145f",
144
+ "three_ds_method_url": "",
145
+ "three_ds_optimizations": "k",
146
+ "directory_server_encryption": {
147
+ "directory_server_id": "A000000003",
148
+ "algorithm": "RSA",
149
+ "certificate": "-----BEGIN CERTIFICATE-----\nMIIGAzCCA+ugAwIBAgIQDaAlB1IbPwgx5esGu9tLIjANBgkqhkiG9w0BAQsFADB2\nMQswCQYDVQQGEwJVUzENMAsGA1UECgwEVklTQTEvMC0GA1UECwwmVmlzYSBJbnRl\ncm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xJzAlBgNVBAMMHlZpc2EgZUNv\nbW1lcmNlIElzc3VpbmcgQ0EgLSBHMjAeFw0yMTA4MjMxNTMyMzNaFw0yNDA4MjIx\nNTMyMzNaMIGhMRgwFgYDVQQHDA9IaWdobGFuZHMgUmFuY2gxETAPBgNVBAgMCENv\nbG9yYWRvMQswCQYDVQQGEwJVUzENMAsGA1UECgwEVklTQTEvM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16c94DrFYX0jmrWLeU4a/TCZQLFIsCAwEAAaNCMEAwHQYDVR0O\nBBYEFEtNpg77oBHorQvi8PMKAC+sixb7MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P\nAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQC5BU9qQSZYPcgCp2x0Juq59kMm\nXuBly094DaEnPqvtCgwwAirkv8x8/QSOxiWWiu+nveyuR+j6Gz/fJaV4u+J5QEDy\ncfk605Mw3HIcJOeZvDgk1eyOmQwUP6Z/BdQTNJmZ92Z8dcG5yWCxLBrqPH7ro3Ss\njhYq9duIJU7jfizCJCN4W8tp0D2pWBe1/CYNswP4GMs5jQ5+ZQKN/L5JFdwVTu7X\nPt8b5zfgbmmQpVmUn0oFwm3OI++Z6gEpNmW5bd/2oUIZoG96Qff2fauVMAYiWQvN\nnL3y1gkRguTOSMVUCCiGfdvwu5ygowillvV2nHb7+YibQ9N5Z2spP0o9Zlfzoat2\n7WFpyK47TiUdu/4toarLKGZP+hbA/F4xlnM/8EfZkE1DeTTI0lhN3O8yEsHrtRl1\nOuQZ/IexHO8UGU6jvn4TWo10HYeXzrGckL7oIXfGTrjPzfY62T5HDW/BAEZS+9Tk\nijz25YM0fPPz7IdlEG+k4q4YwZ82j73Y9kDEM5423mrWorq/Bq7I5Y8v0LTY9GWH\nYrpElYf0WdOXAbsfwQiT6qnRio+p82VyqlY8Jt6VVA6CDy/iHKwcj1ELEnDQfVv9\nhedoxmnQ6xe/nK8czclu9hQJRv5Lh9gk9Q8DKK2nmgzZ8SSQ+lr3mSSeY8JOMRlE\n+RKdOQIChWthTJKh7w==\n-----END CERTIFICATE-----\n"
153
+ ]
154
+ },
155
+ "one_click_authn": null
156
+ }
157
+ },
158
+ "on_behalf_of": null,
159
+ "payment_method": "pm_000000000000000000000000",
160
+ "payment_method_options": {
161
+ "card": {
162
+ "installments": null,
163
+ "mandate_options": null,
164
+ "network": null,
165
+ "request_three_d_secure": "automatic"
166
+ }
167
+ },
168
+ "payment_method_types": [
169
+ "card"
170
+ ],
171
+ "processing": null,
172
+ "receipt_email": null,
173
+ "review": null,
174
+ "setup_future_usage": "off_session",
175
+ "shipping": null,
176
+ "source": null,
177
+ "statement_descriptor": null,
178
+ "statement_descriptor_suffix": null,
179
+ "status": "requires_action",
180
+ "transfer_data": null,
181
+ "transfer_group": null
182
+ }
183
+ },
184
+ "livemode": false,
185
+ "pending_webhooks": 2,
186
+ "request": {
187
+ "id": "req_00000000000000",
188
+ "idempotency_key": "4e03370d-8b01-4847-9891-0092e480e875"
189
+ },
190
+ "type": "payment_intent.requires_action"
191
+ }