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,22 +1,69 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "charge.dispute.created",
2
+ "id": "evt_000000000000000000000000",
6
3
  "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648319940,
7
6
  "data": {
8
7
  "object": {
9
- "charge": "ch_00000000000000",
10
- "amount": 1000,
11
- "created": 1381080223,
12
- "status": "needs_response",
13
- "livemode": false,
14
- "currency": "usd",
8
+ "id": "dp_000000000000000000000000",
15
9
  "object": "dispute",
16
- "reason": "general",
17
- "balance_transaction": "txn_00000000000000",
18
- "evidence_due_by": 1382745599,
19
- "evidence": null
10
+ "amount": 100,
11
+ "balance_transaction": null,
12
+ "balance_transactions": [
13
+
14
+ ],
15
+ "charge": "ch_000000000000000000000000",
16
+ "created": 1648319940,
17
+ "currency": "usd",
18
+ "evidence": {
19
+ "access_activity_log": null,
20
+ "billing_address": null,
21
+ "cancellation_policy": null,
22
+ "cancellation_policy_disclosure": null,
23
+ "cancellation_rebuttal": null,
24
+ "customer_communication": null,
25
+ "customer_email_address": null,
26
+ "customer_name": null,
27
+ "customer_purchase_ip": null,
28
+ "customer_signature": null,
29
+ "duplicate_charge_documentation": null,
30
+ "duplicate_charge_explanation": null,
31
+ "duplicate_charge_id": null,
32
+ "product_description": null,
33
+ "receipt": null,
34
+ "refund_policy": null,
35
+ "refund_policy_disclosure": null,
36
+ "refund_refusal_explanation": null,
37
+ "service_date": null,
38
+ "service_documentation": null,
39
+ "shipping_address": null,
40
+ "shipping_carrier": null,
41
+ "shipping_date": null,
42
+ "shipping_documentation": null,
43
+ "shipping_tracking_number": null,
44
+ "uncategorized_file": null,
45
+ "uncategorized_text": null
46
+ },
47
+ "evidence_details": {
48
+ "due_by": 1649116799,
49
+ "has_evidence": false,
50
+ "past_due": false,
51
+ "submission_count": 0
52
+ },
53
+ "is_charge_refundable": true,
54
+ "livemode": false,
55
+ "metadata": {
56
+ },
57
+ "payment_intent": null,
58
+ "reason": "fraudulent",
59
+ "status": "warning_needs_response"
20
60
  }
21
- }
22
- }
61
+ },
62
+ "livemode": false,
63
+ "pending_webhooks": 2,
64
+ "request": {
65
+ "id": "req_00000000000000",
66
+ "idempotency_key": "fa04076c-aa1f-40b8-9191-95465afc576e"
67
+ },
68
+ "type": "charge.dispute.created"
69
+ }
@@ -1,22 +1,19 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "charge.failed",
2
+ "id": "evt_000000000000000000000000",
6
3
  "object": "event",
7
- "request": null,
8
- "pending_webhooks": 1,
9
- "api_version": "2018-02-28",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320028,
10
6
  "data": {
11
7
  "object": {
12
- "id": "ch_00000000000000",
8
+ "id": "ch_000000000000000000000000",
13
9
  "object": "charge",
14
- "amount": 100,
10
+ "amount": 2000,
11
+ "amount_captured": 0,
15
12
  "amount_refunded": 0,
16
13
  "application": null,
17
14
  "application_fee": null,
18
15
  "application_fee_amount": null,
19
- "balance_transaction": "txn_00000000000000",
16
+ "balance_transaction": null,
20
17
  "billing_details": {
21
18
  "address": {
22
19
  "city": null,
@@ -27,27 +24,39 @@
27
24
  "state": null
28
25
  },
29
26
  "email": null,
30
- "name": "Jenny Rosen",
27
+ "name": null,
31
28
  "phone": null
32
29
  },
30
+ "calculated_statement_descriptor": "EXAMPLECOMPANY",
33
31
  "captured": false,
34
- "created": 1572389205,
35
- "currency": "cad",
32
+ "created": 1648320028,
33
+ "currency": "usd",
36
34
  "customer": null,
37
- "description": "My First Test Charge (created for API docs)",
35
+ "description": "(created by Stripe CLI)",
36
+ "destination": null,
38
37
  "dispute": null,
39
- "failure_code": null,
40
- "failure_message": null,
41
- "fraud_details": {},
38
+ "disputed": false,
39
+ "failure_code": "card_declined",
40
+ "failure_message": "Your card was declined.",
41
+ "fraud_details": {
42
+ },
42
43
  "invoice": null,
43
44
  "livemode": false,
44
- "metadata": {},
45
+ "metadata": {
46
+ },
45
47
  "on_behalf_of": null,
46
48
  "order": null,
47
- "outcome": null,
49
+ "outcome": {
50
+ "network_status": "declined_by_network",
51
+ "reason": "generic_decline",
52
+ "risk_level": "normal",
53
+ "risk_score": 1,
54
+ "seller_message": "The bank did not return any further details with this decline.",
55
+ "type": "issuer_declined"
56
+ },
48
57
  "paid": false,
49
- "payment_intent": null,
50
- "payment_method": "card_00000000000000",
58
+ "payment_intent": "pi_000000000000000000000000",
59
+ "payment_method": "pm_000000000000000000000000",
51
60
  "payment_method_details": {
52
61
  "card": {
53
62
  "brand": "visa",
@@ -57,12 +66,13 @@
57
66
  "cvc_check": null
58
67
  },
59
68
  "country": "US",
60
- "exp_month": 8,
61
- "exp_year": 2019,
62
- "fingerprint": "C8aRpBae2T8GeJcn",
69
+ "exp_month": 3,
70
+ "exp_year": 2023,
71
+ "fingerprint": "kMzSwhaalD1uR96R",
63
72
  "funding": "credit",
64
73
  "installments": null,
65
- "last4": "4242",
74
+ "last4": "0002",
75
+ "mandate": null,
66
76
  "network": "visa",
67
77
  "three_d_secure": null,
68
78
  "wallet": null
@@ -71,16 +81,20 @@
71
81
  },
72
82
  "receipt_email": null,
73
83
  "receipt_number": null,
74
- "receipt_url": "https://pay.stripe.com/receipts/acct_1C0lZEHvOcc4e36o/ch_1FZ3SbHsssvOcc4e36o87NHFK7i/rcpt_G5DuglJFhskXjsEDnLzxF6ESuGQe0Qj",
84
+ "receipt_url": null,
75
85
  "refunded": false,
76
86
  "refunds": {
77
87
  "object": "list",
78
- "data": [],
88
+ "data": [
89
+
90
+ ],
79
91
  "has_more": false,
80
- "url": "/v1/charges/ch_1FZ3SbHvOcc4e36o87NHFK7i/refunds"
92
+ "total_count": 0,
93
+ "url": "/v1/charges/ch_000000000000000000000000/refunds"
81
94
  },
82
95
  "review": null,
83
96
  "shipping": null,
97
+ "source": null,
84
98
  "source_transfer": null,
85
99
  "statement_descriptor": null,
86
100
  "statement_descriptor_suffix": null,
@@ -89,96 +103,11 @@
89
103
  "transfer_group": null
90
104
  }
91
105
  },
92
- "webhook": {
93
- "created": 1326853478,
94
- "livemode": false,
95
- "id": "evt_00000000000000",
96
- "type": "charge.failed",
97
- "object": "event",
98
- "request": null,
99
- "pending_webhooks": 1,
100
- "api_version": "2018-02-28",
101
- "data": {
102
- "object": {
103
- "id": "ch_00000000000000",
104
- "object": "charge",
105
- "amount": 100,
106
- "amount_refunded": 0,
107
- "application": null,
108
- "application_fee": null,
109
- "application_fee_amount": null,
110
- "balance_transaction": "txn_00000000000000",
111
- "billing_details": {
112
- "address": {
113
- "city": null,
114
- "country": null,
115
- "line1": null,
116
- "line2": null,
117
- "postal_code": null,
118
- "state": null
119
- },
120
- "email": null,
121
- "name": "Jenny Rosen",
122
- "phone": null
123
- },
124
- "captured": false,
125
- "created": 1572389205,
126
- "currency": "cad",
127
- "customer": null,
128
- "description": "My First Test Charge (created for API docs)",
129
- "dispute": null,
130
- "failure_code": null,
131
- "failure_message": null,
132
- "fraud_details": {},
133
- "invoice": null,
134
- "livemode": false,
135
- "metadata": {},
136
- "on_behalf_of": null,
137
- "order": null,
138
- "outcome": null,
139
- "paid": false,
140
- "payment_intent": null,
141
- "payment_method": "card_00000000000000",
142
- "payment_method_details": {
143
- "card": {
144
- "brand": "visa",
145
- "checks": {
146
- "address_line1_check": null,
147
- "address_postal_code_check": null,
148
- "cvc_check": null
149
- },
150
- "country": "US",
151
- "exp_month": 8,
152
- "exp_year": 2019,
153
- "fingerprint": "C8aRpBae2T8GeJcn",
154
- "funding": "credit",
155
- "installments": null,
156
- "last4": "4242",
157
- "network": "visa",
158
- "three_d_secure": null,
159
- "wallet": null
160
- },
161
- "type": "card"
162
- },
163
- "receipt_email": null,
164
- "receipt_number": null,
165
- "receipt_url": "https://pay.stripe.com/receipts/acct_1C0lZEHvOcc4e36o/ch_1FZ3SbHvOcc4sssse36o87NHFK7i/rcpt_G5DuglJFhskXjsEDnLzxF6ESuGQe0Qj",
166
- "refunded": false,
167
- "refunds": {
168
- "object": "list",
169
- "data": [],
170
- "has_more": false,
171
- "url": "/v1/charges/ch_1FZ3SbHvOccssssss4e36o87NHFK7i/refunds"
172
- },
173
- "review": null,
174
- "shipping": null,
175
- "source_transfer": null,
176
- "statement_descriptor": null,
177
- "statement_descriptor_suffix": null,
178
- "status": "failed",
179
- "transfer_data": null,
180
- "transfer_group": null
181
- }
182
- }
183
- }
106
+ "livemode": false,
107
+ "pending_webhooks": 2,
108
+ "request": {
109
+ "id": "req_00000000000000",
110
+ "idempotency_key": "57ddc22f-1d42-446f-8f91-85cf0d32084a"
111
+ },
112
+ "type": "charge.failed"
184
113
  }
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648319945,
6
+ "data": {
7
+ "object": {
8
+ "id": "re_000000000000000000000000",
9
+ "object": "refund",
10
+ "amount": 100,
11
+ "balance_transaction": "txn_000000000000000000000000",
12
+ "charge": "ch_000000000000000000000000",
13
+ "created": 1648319945,
14
+ "currency": "usd",
15
+ "metadata": {
16
+ "order_id": "6735"
17
+ },
18
+ "payment_intent": null,
19
+ "reason": null,
20
+ "receipt_number": null,
21
+ "source_transfer_reversal": null,
22
+ "status": "succeeded",
23
+ "transfer_reversal": null
24
+ },
25
+ "previous_attributes": {
26
+ }
27
+ },
28
+ "livemode": false,
29
+ "pending_webhooks": 2,
30
+ "request": {
31
+ "id": "req_00000000000000",
32
+ "idempotency_key": "38ee50ca-b664-4611-a846-9eaed51bec07"
33
+ },
34
+ "type": "charge.refund.updated"
35
+ }
@@ -1,69 +1,164 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "charge.refunded",
2
+ "id": "evt_000000000000000000000000",
6
3
  "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648319949,
7
6
  "data": {
8
7
  "object": {
9
- "id": "ch_00000000000000",
8
+ "id": "ch_000000000000000000000000",
10
9
  "object": "charge",
11
- "created": 1380933505,
10
+ "amount": 100,
11
+ "amount_captured": 100,
12
+ "amount_refunded": 100,
13
+ "application": null,
14
+ "application_fee": null,
15
+ "application_fee_amount": null,
16
+ "balance_transaction": "txn_000000000000000000000000",
17
+ "billing_details": {
18
+ "address": {
19
+ "city": null,
20
+ "country": null,
21
+ "line1": null,
22
+ "line2": null,
23
+ "postal_code": null,
24
+ "state": null
25
+ },
26
+ "email": null,
27
+ "name": null,
28
+ "phone": null
29
+ },
30
+ "calculated_statement_descriptor": "EXAMPLECOMPANY",
31
+ "captured": true,
32
+ "created": 1648319947,
33
+ "currency": "usd",
34
+ "customer": null,
35
+ "description": "(created by Stripe CLI)",
36
+ "destination": null,
37
+ "dispute": null,
38
+ "disputed": false,
39
+ "failure_code": null,
40
+ "failure_message": null,
41
+ "fraud_details": {
42
+ },
43
+ "invoice": null,
12
44
  "livemode": false,
45
+ "metadata": {
46
+ },
47
+ "on_behalf_of": null,
48
+ "order": null,
49
+ "outcome": {
50
+ "network_status": "approved_by_network",
51
+ "reason": null,
52
+ "risk_level": "normal",
53
+ "risk_score": 52,
54
+ "seller_message": "Payment complete.",
55
+ "type": "authorized"
56
+ },
13
57
  "paid": true,
14
- "amount": 1000,
15
- "currency": "usd",
58
+ "payment_intent": null,
59
+ "payment_method": "card_000000000000000000000000",
60
+ "payment_method_details": {
61
+ "card": {
62
+ "brand": "visa",
63
+ "checks": {
64
+ "address_line1_check": null,
65
+ "address_postal_code_check": null,
66
+ "cvc_check": null
67
+ },
68
+ "country": "US",
69
+ "exp_month": 3,
70
+ "exp_year": 2023,
71
+ "fingerprint": "ZoVSX2dK5igWt2SB",
72
+ "funding": "credit",
73
+ "installments": null,
74
+ "last4": "4242",
75
+ "mandate": null,
76
+ "network": "visa",
77
+ "three_d_secure": null,
78
+ "wallet": null
79
+ },
80
+ "type": "card"
81
+ },
82
+ "receipt_email": null,
83
+ "receipt_number": null,
84
+ "receipt_url": "https://pay.stripe.com/receipts/acct_0000000000000000/ch_000000000000000000000000/rcpt_0000000000000000000000000000000",
16
85
  "refunded": true,
86
+ "refunds": {
87
+ "object": "list",
88
+ "data": [
89
+ {
90
+ "id": "re_000000000000000000000000",
91
+ "object": "refund",
92
+ "amount": 100,
93
+ "balance_transaction": "txn_000000000000000000000000",
94
+ "charge": "ch_000000000000000000000000",
95
+ "created": 1648319949,
96
+ "currency": "usd",
97
+ "metadata": {
98
+ },
99
+ "payment_intent": null,
100
+ "reason": null,
101
+ "receipt_number": null,
102
+ "source_transfer_reversal": null,
103
+ "status": "succeeded",
104
+ "transfer_reversal": null
105
+ }
106
+ ],
107
+ "has_more": false,
108
+ "total_count": 1,
109
+ "url": "/v1/charges/ch_000000000000000000000000/refunds"
110
+ },
111
+ "review": null,
112
+ "shipping": null,
17
113
  "source": {
18
- "id": "cc_00000000000000",
114
+ "id": "card_000000000000000000000000",
19
115
  "object": "card",
20
- "last4": "4242",
21
- "type": "Visa",
22
- "brand": "Visa",
23
- "funding": "credit",
24
- "exp_month": 12,
25
- "exp_year": 2013,
26
- "fingerprint": "wXWJT135mEK107G8",
27
- "customer": "cus_00000000000000",
28
- "country": "US",
29
- "name": "Actual Nothing",
116
+ "address_city": null,
117
+ "address_country": null,
30
118
  "address_line1": null,
119
+ "address_line1_check": null,
31
120
  "address_line2": null,
32
- "address_city": null,
33
121
  "address_state": null,
34
122
  "address_zip": null,
35
- "address_country": null,
123
+ "address_zip_check": null,
124
+ "brand": "Visa",
125
+ "country": "US",
126
+ "customer": null,
36
127
  "cvc_check": null,
37
- "address_line1_check": null,
38
- "address_zip_check": null
128
+ "dynamic_last4": null,
129
+ "exp_month": 3,
130
+ "exp_year": 2023,
131
+ "fingerprint": "ZoVSX2dK5igWt2SB",
132
+ "funding": "credit",
133
+ "last4": "4242",
134
+ "metadata": {
135
+ },
136
+ "name": null,
137
+ "tokenization_method": null
39
138
  },
40
- "captured": true,
139
+ "source_transfer": null,
140
+ "statement_descriptor": null,
141
+ "statement_descriptor_suffix": null,
142
+ "status": "succeeded",
143
+ "transfer_data": null,
144
+ "transfer_group": null
145
+ },
146
+ "previous_attributes": {
147
+ "amount_refunded": 0,
148
+ "refunded": false,
41
149
  "refunds": {
42
- "object": "list",
43
- "total_count": 1,
44
- "has_more": false,
45
150
  "data": [
46
- {
47
- "amount": 1000,
48
- "currency": "usd",
49
- "created": 1381080103,
50
- "object": "refund",
51
- "balance_transaction": "txn_2hkjgg43ucu7K1",
52
- "id": "re_00000000000000"
53
- }
54
- ]
55
- },
56
- "balance_transaction": "txn_00000000000000",
57
- "failure_message": null,
58
- "failure_code": null,
59
- "amount_refunded": 1000,
60
- "customer": "cus_00000000000000",
61
- "invoice": "in_00000000000000",
62
- "description": null,
63
- "dispute": null,
64
- "metadata": {
65
- },
66
- "fee": 0
151
+
152
+ ],
153
+ "total_count": 0
154
+ }
67
155
  }
68
- }
69
- }
156
+ },
157
+ "livemode": false,
158
+ "pending_webhooks": 2,
159
+ "request": {
160
+ "id": "req_00000000000000",
161
+ "idempotency_key": "86a8299a-3f47-4aec-8cb4-298bbc8bc050"
162
+ },
163
+ "type": "charge.refunded"
164
+ }