stripe_model_callbacks 0.1.0 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -1
  3. data/app/models/stripe_model_callbacks/application_record.rb +17 -0
  4. data/app/services/stripe_model_callbacks/account/external_account/updated_service.rb +1 -1
  5. data/app/services/stripe_model_callbacks/attributes_assigner_service.rb +1 -1
  6. data/app/services/stripe_model_callbacks/base_service.rb +35 -3
  7. data/app/services/stripe_model_callbacks/charge/dispute_updated_service.rb +1 -1
  8. data/app/services/stripe_model_callbacks/charge/updated_service.rb +1 -1
  9. data/app/services/stripe_model_callbacks/configure_service.rb +52 -24
  10. data/app/services/stripe_model_callbacks/coupon/sync_all.rb +9 -0
  11. data/app/services/stripe_model_callbacks/coupon/updated_service.rb +1 -1
  12. data/app/services/stripe_model_callbacks/customer/bank_account/deleted_service.rb +1 -1
  13. data/app/services/stripe_model_callbacks/customer/deleted_service.rb +1 -1
  14. data/app/services/stripe_model_callbacks/customer/discount_updated_service.rb +1 -1
  15. data/app/services/stripe_model_callbacks/customer/source_updated_service.rb +1 -1
  16. data/app/services/stripe_model_callbacks/customer/subscription/updated_service.rb +1 -1
  17. data/app/services/stripe_model_callbacks/customer/updated_service.rb +1 -1
  18. data/app/services/stripe_model_callbacks/event_mocker_service.rb +1 -1
  19. data/app/services/stripe_model_callbacks/invoice/updated_service.rb +1 -1
  20. data/app/services/stripe_model_callbacks/invoice_item/updated_service.rb +1 -1
  21. data/app/services/stripe_model_callbacks/notifier_service.rb +1 -1
  22. data/app/services/stripe_model_callbacks/order/updated_service.rb +1 -1
  23. data/app/services/stripe_model_callbacks/payout/updated_service.rb +1 -1
  24. data/app/services/stripe_model_callbacks/plan/sync_all.rb +9 -0
  25. data/app/services/stripe_model_callbacks/plan/updated_service.rb +1 -1
  26. data/app/services/stripe_model_callbacks/price/updated_service.rb +14 -0
  27. data/app/services/stripe_model_callbacks/product/updated_service.rb +1 -1
  28. data/app/services/stripe_model_callbacks/recipient/updated_service.rb +1 -1
  29. data/app/services/stripe_model_callbacks/refund/updated_service.rb +1 -1
  30. data/app/services/stripe_model_callbacks/review/updated_service.rb +1 -1
  31. data/app/services/stripe_model_callbacks/sku/updated_service.rb +1 -1
  32. data/app/services/stripe_model_callbacks/source/updated_service.rb +1 -1
  33. data/app/services/stripe_model_callbacks/subscription/state_checker_service.rb +2 -2
  34. data/app/services/stripe_model_callbacks/subscription_schedule/updated_service.rb +46 -0
  35. data/app/services/stripe_model_callbacks/sync_everything.rb +8 -0
  36. data/app/services/stripe_model_callbacks/sync_from_stripe.rb +29 -0
  37. data/app/services/stripe_model_callbacks/tax_rate/updated_service.rb +27 -0
  38. data/app/services/stripe_model_callbacks/transfer/updated_service.rb +1 -1
  39. data/db/migrate/20200317160513_add_auto_advance_and_billing_reason_to_stripe_invoices.rb +6 -0
  40. data/db/migrate/20200317160602_add_status_and_status_transitions_to_stripe_invoices.rb +10 -0
  41. data/db/migrate/20200317180115_add_product_type_to_products.rb +5 -0
  42. data/db/migrate/20200317181224_rename_stripe_invoices_application_fee_to_application_fee_amount.rb +6 -0
  43. data/db/migrate/20200320105158_make_stripe_invoices_forgive_optional.rb +5 -0
  44. data/db/migrate/20200320114859_make_stripe_invoice_closed_optional.rb +5 -0
  45. data/db/migrate/20200323143634_add_amount_paid_and_remaining_and_invoice_url_and_pdf.rb +11 -0
  46. data/db/migrate/20200331074940_add_unit_label_to_stripe_products.rb +5 -0
  47. data/db/migrate/20200331075241_add_metered_info_to_stripe_plans.rb +9 -0
  48. data/db/migrate/20200513131105_create_stripe_subscription_schedules.rb +31 -0
  49. data/db/migrate/20200513131120_create_stripe_subscription_schedule_phases.rb +21 -0
  50. data/db/migrate/20200513131640_create_stripe_subscription_schedule_phase_plans.rb +13 -0
  51. data/db/migrate/20200514132247_add_stripe_id_uniq_to_stripe_invoices.rb +8 -0
  52. data/db/migrate/20200520152604_change_stripe_subscription_schedule_phase_id_to_bigint.rb +27 -0
  53. data/db/migrate/20200529144649_add_latest_invoice_id_to_stripe_subscription.rb +5 -0
  54. data/db/migrate/20201223173035_rename_stripe_subscriptions_start_to_start_date.rb +5 -0
  55. data/db/migrate/20201223202117_create_stripe_tax_rates.rb +15 -0
  56. data/db/migrate/20201224120534_create_stripe_subscription_default_tax_rates.rb +9 -0
  57. data/db/migrate/20201224122058_create_stripe_prices.rb +26 -0
  58. data/db/migrate/20201224123838_add_stripe_price_to_stripe_subscription_items.rb +6 -0
  59. data/db/migrate/20211121155313_change_invoice_billing_to_nullable.rb +5 -0
  60. data/db/migrate/20211121155732_rename_invoices_billing_to_deprecated_billing.rb +5 -0
  61. data/lib/stripe_model_callbacks/configuration.rb +1 -1
  62. data/lib/stripe_model_callbacks/factories/stripe_bank_accounts.rb +5 -0
  63. data/lib/stripe_model_callbacks/factories/stripe_cards.rb +7 -0
  64. data/lib/stripe_model_callbacks/factories/stripe_charges.rb +11 -0
  65. data/lib/stripe_model_callbacks/factories/stripe_coupons.rb +21 -0
  66. data/lib/stripe_model_callbacks/factories/stripe_customers.rb +17 -0
  67. data/lib/stripe_model_callbacks/factories/stripe_discounts.rb +6 -0
  68. data/lib/stripe_model_callbacks/factories/stripe_disputes.rb +7 -0
  69. data/lib/stripe_model_callbacks/factories/stripe_invoice_items.rb +11 -0
  70. data/lib/stripe_model_callbacks/factories/stripe_invoices.rb +16 -0
  71. data/lib/stripe_model_callbacks/factories/stripe_order_items.rb +8 -0
  72. data/lib/stripe_model_callbacks/factories/stripe_orders.rb +9 -0
  73. data/lib/stripe_model_callbacks/factories/stripe_payouts.rb +5 -0
  74. data/lib/stripe_model_callbacks/factories/stripe_plans.rb +30 -0
  75. data/lib/stripe_model_callbacks/factories/stripe_prices.rb +3 -0
  76. data/lib/stripe_model_callbacks/factories/stripe_products.rb +18 -0
  77. data/lib/stripe_model_callbacks/factories/stripe_recipients.rb +5 -0
  78. data/lib/stripe_model_callbacks/factories/stripe_refunds.rb +9 -0
  79. data/lib/stripe_model_callbacks/factories/stripe_reviews.rb +6 -0
  80. data/lib/stripe_model_callbacks/factories/stripe_skus.rb +7 -0
  81. data/lib/stripe_model_callbacks/factories/stripe_sources.rb +8 -0
  82. data/lib/stripe_model_callbacks/factories/stripe_subscription_default_tax_rates.rb +6 -0
  83. data/lib/stripe_model_callbacks/factories/stripe_subscription_items.rb +19 -0
  84. data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule.rb.rb +5 -0
  85. data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule_phase_plan.rb +5 -0
  86. data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule_phases.rb +5 -0
  87. data/lib/stripe_model_callbacks/factories/stripe_subscriptions.rb +40 -0
  88. data/lib/stripe_model_callbacks/factories/stripe_tax_rates.rb +5 -0
  89. data/lib/stripe_model_callbacks/factories/stripe_transfers.rb +8 -0
  90. data/lib/stripe_model_callbacks/factory_bot_definitions.rb +1 -1
  91. data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.created.json +29 -0
  92. data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.deleted.json +29 -0
  93. data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.updated.json +31 -0
  94. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.closed.json +65 -0
  95. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.created.json +65 -0
  96. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.funds_reinstated.json +65 -0
  97. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.funds_withdrawn.json +65 -0
  98. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.updated.json +96 -0
  99. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.refund.updated.json +28 -0
  100. data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.refunded.json +98 -0
  101. data/lib/stripe_model_callbacks/fixtures/stripe_events/coupon/coupon.created.json +29 -0
  102. data/lib/stripe_model_callbacks/fixtures/stripe_events/coupon/coupon.deleted.json +29 -0
  103. data/lib/stripe_model_callbacks/fixtures/stripe_events/coupon/coupon.updated.json +31 -0
  104. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.bank_account.deleted.json +29 -0
  105. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.created.json +36 -0
  106. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.deleted.json +47 -0
  107. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.discount.created.json +36 -0
  108. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.discount.deleted.json +36 -0
  109. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.discount.updated.json +55 -0
  110. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.created.card.json +80 -0
  111. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.created.json +53 -0
  112. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.deleted.json +53 -0
  113. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.expiring.json +53 -0
  114. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.updated.json +56 -0
  115. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.2020-12-24.json +112 -0
  116. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.json +84 -0
  117. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.deleted.json +83 -0
  118. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.trial_will_end.json +88 -0
  119. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.updated.json +100 -0
  120. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.updated.json +50 -0
  121. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.created.json +135 -0
  122. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.payment_failed.json +100 -0
  123. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.payment_succeeded.json +207 -0
  124. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.sent.json +100 -0
  125. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.upcoming.json +100 -0
  126. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.updated.json +105 -0
  127. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.voided.json +152 -0
  128. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoiceitem/invoiceitem.created.json +34 -0
  129. data/lib/stripe_model_callbacks/fixtures/stripe_events/order/order.created.json +72 -0
  130. data/lib/stripe_model_callbacks/fixtures/stripe_events/order/order.updated.json +74 -0
  131. data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.canceled.json +35 -0
  132. data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.created.json +35 -0
  133. data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.failed.json +35 -0
  134. data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.paid.json +35 -0
  135. data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.updated.json +37 -0
  136. data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.created.json +32 -0
  137. data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.deleted.json +27 -0
  138. data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.updated.json +30 -0
  139. data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.created.json +37 -0
  140. data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.deleted.json +37 -0
  141. data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.updated.json +40 -0
  142. data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.created.json +49 -0
  143. data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.deleted.json +48 -0
  144. data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.updated.json +50 -0
  145. data/lib/stripe_model_callbacks/fixtures/stripe_events/recipient/recipient.created.json +37 -0
  146. data/lib/stripe_model_callbacks/fixtures/stripe_events/recipient/recipient.deleted.json +37 -0
  147. data/lib/stripe_model_callbacks/fixtures/stripe_events/recipient/recipient.updated.json +39 -0
  148. data/lib/stripe_model_callbacks/fixtures/stripe_events/review/review.closed.json +21 -0
  149. data/lib/stripe_model_callbacks/fixtures/stripe_events/review/review.opened.json +21 -0
  150. data/lib/stripe_model_callbacks/fixtures/stripe_events/sku/sku.created.json +36 -0
  151. data/lib/stripe_model_callbacks/fixtures/stripe_events/sku/sku.deleted.json +36 -0
  152. data/lib/stripe_model_callbacks/fixtures/stripe_events/sku/sku.updated.json +38 -0
  153. data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.canceled.json +53 -0
  154. data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.chargeable.json +53 -0
  155. data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.failed.json +53 -0
  156. data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.mandate_notification.json +53 -0
  157. data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.transaction_created.json +21 -0
  158. data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.canceled.json +81 -0
  159. data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.created.json +77 -0
  160. data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.updated.json +87 -0
  161. data/lib/stripe_model_callbacks/fixtures/stripe_events/tax_rate/tax_rate.created.json +26 -0
  162. data/lib/stripe_model_callbacks/fixtures/stripe_events/tax_rate/tax_rate.updated.json +29 -0
  163. data/lib/stripe_model_callbacks/fixtures/stripe_events/transfer/transfer.created.json +41 -0
  164. data/lib/stripe_model_callbacks/fixtures/stripe_events/transfer/transfer.reversed.json +40 -0
  165. data/lib/stripe_model_callbacks/fixtures/stripe_events/transfer/transfer.updated.json +44 -0
  166. data/lib/stripe_model_callbacks/models/stripe_bank_account.rb +1 -0
  167. data/lib/stripe_model_callbacks/models/stripe_card.rb +2 -1
  168. data/lib/stripe_model_callbacks/models/stripe_charge.rb +3 -0
  169. data/lib/stripe_model_callbacks/models/stripe_coupon.rb +1 -0
  170. data/lib/stripe_model_callbacks/models/stripe_customer.rb +4 -2
  171. data/lib/stripe_model_callbacks/models/stripe_discount.rb +10 -3
  172. data/lib/stripe_model_callbacks/models/stripe_dispute.rb +1 -0
  173. data/lib/stripe_model_callbacks/models/stripe_invoice.rb +62 -7
  174. data/lib/stripe_model_callbacks/models/stripe_invoice_item.rb +2 -0
  175. data/lib/stripe_model_callbacks/models/stripe_order.rb +1 -0
  176. data/lib/stripe_model_callbacks/models/stripe_order_item.rb +1 -0
  177. data/lib/stripe_model_callbacks/models/stripe_payout.rb +2 -1
  178. data/lib/stripe_model_callbacks/models/stripe_plan.rb +4 -1
  179. data/lib/stripe_model_callbacks/models/stripe_price.rb +27 -0
  180. data/lib/stripe_model_callbacks/models/stripe_product.rb +17 -7
  181. data/lib/stripe_model_callbacks/models/stripe_recipient.rb +1 -0
  182. data/lib/stripe_model_callbacks/models/stripe_refund.rb +1 -0
  183. data/lib/stripe_model_callbacks/models/stripe_review.rb +1 -0
  184. data/lib/stripe_model_callbacks/models/stripe_sku.rb +13 -6
  185. data/lib/stripe_model_callbacks/models/stripe_source.rb +4 -2
  186. data/lib/stripe_model_callbacks/models/stripe_subscription.rb +56 -6
  187. data/lib/stripe_model_callbacks/models/stripe_subscription_default_tax_rate.rb +4 -0
  188. data/lib/stripe_model_callbacks/models/stripe_subscription_item.rb +19 -1
  189. data/lib/stripe_model_callbacks/models/stripe_subscription_schedule.rb +94 -0
  190. data/lib/stripe_model_callbacks/models/stripe_subscription_schedule_phase.rb +67 -0
  191. data/lib/stripe_model_callbacks/models/stripe_subscription_schedule_phase_plan.rb +37 -0
  192. data/lib/stripe_model_callbacks/models/stripe_tax_rate.rb +22 -0
  193. data/lib/stripe_model_callbacks/models/stripe_transfer.rb +1 -0
  194. data/lib/stripe_model_callbacks/version.rb +1 -1
  195. data/lib/stripe_model_callbacks.rb +1 -0
  196. metadata +163 -11
@@ -0,0 +1,6 @@
1
+ FactoryBot.define do
2
+ factory :stripe_subscription_default_tax_rate do
3
+ stripe_subscription
4
+ stripe_tax_rate
5
+ end
6
+ end
@@ -0,0 +1,19 @@
1
+ FactoryBot.define do
2
+ factory :stripe_subscription_item do
3
+ sequence(:stripe_id) { |n| "stripe-subscription-item-#{n}" }
4
+ stripe_subscription
5
+ stripe_plan
6
+ quantity { 1 }
7
+
8
+ trait :with_stripe_mock do
9
+ after :build do |item|
10
+ mock_item = Stripe::SubscriptionItem.create(
11
+ subscription: item.stripe_subscription.stripe_id,
12
+ plan: item.stripe_plan.stripe_id,
13
+ quantity: item.quantity
14
+ )
15
+ item.assign_from_stripe(mock_item)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :stripe_subscription_schedule do
3
+ sequence(:stripe_id) { |n| "stripe-subscription-schedule-#{n}" }
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :stripe_subscription_schedule_phase_plan do
3
+ stripe_subscription_schedule_phase
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :stripe_subscription_schedule_phase do
3
+ stripe_subscription_schedule
4
+ end
5
+ end
@@ -0,0 +1,40 @@
1
+ FactoryBot.define do
2
+ factory :stripe_subscription do
3
+ sequence(:stripe_id) { |n| "stripe-subscription-#{n}" }
4
+ billing { "charge_automatically" }
5
+ cancel_at_period_end { false }
6
+ created { Time.zone.now.beginning_of_month }
7
+ current_period_start { Time.zone.now.beginning_of_month }
8
+ current_period_end { Time.zone.now.end_of_month }
9
+ stripe_customer
10
+ livemode { false }
11
+ stripe_plan
12
+ start_date { 1.month.ago.beginning_of_month }
13
+
14
+ trait :active do
15
+ status { "active" }
16
+ end
17
+
18
+ trait :cancel_at_period_end do
19
+ cancel_at_period_end { true }
20
+ end
21
+
22
+ trait :with_stripe_mock do
23
+ association :stripe_customer, factory: [:stripe_customer, :with_stripe_mock]
24
+ association :stripe_plan, factory: [:stripe_plan, :with_stripe_mock]
25
+
26
+ after :create do |stripe_subscription|
27
+ cancel_at_period_end = stripe_subscription.cancel_at_period_end?
28
+
29
+ mock_subscription = Stripe::Subscription.create(
30
+ customer: stripe_subscription.stripe_customer.stripe_id,
31
+ plan: stripe_subscription.stripe_plan.stripe_id
32
+ )
33
+ stripe_subscription.assign_from_stripe(mock_subscription)
34
+ stripe_subscription.save!
35
+
36
+ stripe_subscription.cancel!(at_period_end: true) if cancel_at_period_end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :stripe_tax_rate do
3
+ sequence(:stripe_id) { |n| "stripe-tax-rate-#{n}" }
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :stripe_transfer do
3
+ sequence(:stripe_id) { |n| "stripe-transfer-#{n}" }
4
+ amount { Money.new(10_000, "USD") }
5
+ amount_reversed { Money.new(0, "USD") }
6
+ currency { "usd" }
7
+ end
8
+ end
@@ -1,4 +1,4 @@
1
- factories_path = File.realpath("#{File.dirname(__FILE__)}/../../spec/factories")
1
+ factories_path = File.realpath("#{File.dirname(__FILE__)}/factories")
2
2
 
3
3
  Dir.foreach(factories_path) do |file|
4
4
  next unless /\A(.+)\.rb\Z/.match?(file)
@@ -0,0 +1,29 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "account.external_account.created",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-02-05",
10
+ "data": {
11
+ "object": {
12
+ "id": "ba_00000000000000",
13
+ "object": "bank_account",
14
+ "account": "acct_00000000000000",
15
+ "account_holder_name": "Jane Austen",
16
+ "account_holder_type": "individual",
17
+ "bank_name": "STRIPE TEST BANK",
18
+ "country": "US",
19
+ "currency": "dkk",
20
+ "default_for_currency": false,
21
+ "fingerprint": "8hxBTDA6RPbX37IN",
22
+ "last4": "6789",
23
+ "metadata": {
24
+ },
25
+ "routing_number": "110000000",
26
+ "status": "new"
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "account.external_account.deleted",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-02-05",
10
+ "data": {
11
+ "object": {
12
+ "id": "ba_00000000000000",
13
+ "object": "bank_account",
14
+ "account": "acct_00000000000000",
15
+ "account_holder_name": "Jane Austen",
16
+ "account_holder_type": "individual",
17
+ "bank_name": "STRIPE TEST BANK",
18
+ "country": "US",
19
+ "currency": "dkk",
20
+ "default_for_currency": false,
21
+ "fingerprint": "8hxBTDA6RPbX37IN",
22
+ "last4": "6789",
23
+ "metadata": {
24
+ },
25
+ "routing_number": "110000000",
26
+ "status": "new"
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "account.external_account.updated",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-02-05",
10
+ "data": {
11
+ "object": {
12
+ "id": "ba_00000000000000",
13
+ "object": "bank_account",
14
+ "account": "acct_00000000000000",
15
+ "account_holder_name": "Jane Austen",
16
+ "account_holder_type": "individual",
17
+ "bank_name": "STRIPE TEST BANK",
18
+ "country": "US",
19
+ "currency": "dkk",
20
+ "default_for_currency": false,
21
+ "fingerprint": "8hxBTDA6RPbX37IN",
22
+ "last4": "6789",
23
+ "metadata": {
24
+ },
25
+ "routing_number": "110000000",
26
+ "status": "new"
27
+ },
28
+ "previous_attributes": {
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "charge.dispute.closed",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-01-23",
10
+ "data": {
11
+ "object": {
12
+ "id": "dp_00000000000000",
13
+ "object": "dispute",
14
+ "amount": 1000,
15
+ "balance_transaction": "txn_00000000000000",
16
+ "balance_transactions": [
17
+
18
+ ],
19
+ "charge": "ch_00000000000000",
20
+ "created": 1517922714,
21
+ "currency": "usd",
22
+ "evidence": {
23
+ "access_activity_log": null,
24
+ "billing_address": null,
25
+ "cancellation_policy": null,
26
+ "cancellation_policy_disclosure": null,
27
+ "cancellation_rebuttal": null,
28
+ "customer_communication": null,
29
+ "customer_email_address": null,
30
+ "customer_name": null,
31
+ "customer_purchase_ip": null,
32
+ "customer_signature": null,
33
+ "duplicate_charge_documentation": null,
34
+ "duplicate_charge_explanation": null,
35
+ "duplicate_charge_id": null,
36
+ "product_description": null,
37
+ "receipt": null,
38
+ "refund_policy": null,
39
+ "refund_policy_disclosure": null,
40
+ "refund_refusal_explanation": null,
41
+ "service_date": null,
42
+ "service_documentation": null,
43
+ "shipping_address": null,
44
+ "shipping_carrier": null,
45
+ "shipping_date": null,
46
+ "shipping_documentation": null,
47
+ "shipping_tracking_number": null,
48
+ "uncategorized_file": null,
49
+ "uncategorized_text": "Here is some evidence"
50
+ },
51
+ "evidence_details": {
52
+ "due_by": 1519603199,
53
+ "has_evidence": false,
54
+ "past_due": false,
55
+ "submission_count": 0
56
+ },
57
+ "is_charge_refundable": false,
58
+ "livemode": false,
59
+ "metadata": {
60
+ },
61
+ "reason": "general",
62
+ "status": "won"
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "charge.dispute.created",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-01-23",
10
+ "data": {
11
+ "object": {
12
+ "id": "dp_00000000000000",
13
+ "object": "dispute",
14
+ "amount": 1000,
15
+ "balance_transaction": "txn_00000000000000",
16
+ "balance_transactions": [
17
+
18
+ ],
19
+ "charge": "ch_00000000000000",
20
+ "created": 1517922679,
21
+ "currency": "usd",
22
+ "evidence": {
23
+ "access_activity_log": null,
24
+ "billing_address": null,
25
+ "cancellation_policy": null,
26
+ "cancellation_policy_disclosure": null,
27
+ "cancellation_rebuttal": null,
28
+ "customer_communication": null,
29
+ "customer_email_address": null,
30
+ "customer_name": null,
31
+ "customer_purchase_ip": null,
32
+ "customer_signature": null,
33
+ "duplicate_charge_documentation": null,
34
+ "duplicate_charge_explanation": null,
35
+ "duplicate_charge_id": null,
36
+ "product_description": null,
37
+ "receipt": null,
38
+ "refund_policy": null,
39
+ "refund_policy_disclosure": null,
40
+ "refund_refusal_explanation": null,
41
+ "service_date": null,
42
+ "service_documentation": null,
43
+ "shipping_address": null,
44
+ "shipping_carrier": null,
45
+ "shipping_date": null,
46
+ "shipping_documentation": null,
47
+ "shipping_tracking_number": null,
48
+ "uncategorized_file": null,
49
+ "uncategorized_text": null
50
+ },
51
+ "evidence_details": {
52
+ "due_by": 1519603199,
53
+ "has_evidence": false,
54
+ "past_due": false,
55
+ "submission_count": 0
56
+ },
57
+ "is_charge_refundable": false,
58
+ "livemode": false,
59
+ "metadata": {
60
+ },
61
+ "reason": "general",
62
+ "status": "needs_response"
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "charge.dispute.funds_reinstated",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-01-23",
10
+ "data": {
11
+ "object": {
12
+ "id": "dp_00000000000000",
13
+ "object": "dispute",
14
+ "amount": 1000,
15
+ "balance_transaction": "txn_00000000000000",
16
+ "balance_transactions": [
17
+
18
+ ],
19
+ "charge": "ch_00000000000000",
20
+ "created": 1517922729,
21
+ "currency": "usd",
22
+ "evidence": {
23
+ "access_activity_log": null,
24
+ "billing_address": null,
25
+ "cancellation_policy": null,
26
+ "cancellation_policy_disclosure": null,
27
+ "cancellation_rebuttal": null,
28
+ "customer_communication": null,
29
+ "customer_email_address": null,
30
+ "customer_name": null,
31
+ "customer_purchase_ip": null,
32
+ "customer_signature": null,
33
+ "duplicate_charge_documentation": null,
34
+ "duplicate_charge_explanation": null,
35
+ "duplicate_charge_id": null,
36
+ "product_description": null,
37
+ "receipt": null,
38
+ "refund_policy": null,
39
+ "refund_policy_disclosure": null,
40
+ "refund_refusal_explanation": null,
41
+ "service_date": null,
42
+ "service_documentation": null,
43
+ "shipping_address": null,
44
+ "shipping_carrier": null,
45
+ "shipping_date": null,
46
+ "shipping_documentation": null,
47
+ "shipping_tracking_number": null,
48
+ "uncategorized_file": null,
49
+ "uncategorized_text": null
50
+ },
51
+ "evidence_details": {
52
+ "due_by": 1519603199,
53
+ "has_evidence": false,
54
+ "past_due": false,
55
+ "submission_count": 0
56
+ },
57
+ "is_charge_refundable": false,
58
+ "livemode": false,
59
+ "metadata": {
60
+ },
61
+ "reason": "general",
62
+ "status": "needs_response"
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "charge.dispute.funds_withdrawn",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-01-23",
10
+ "data": {
11
+ "object": {
12
+ "id": "dp_00000000000000",
13
+ "object": "dispute",
14
+ "amount": 1000,
15
+ "balance_transaction": "txn_00000000000000",
16
+ "balance_transactions": [
17
+
18
+ ],
19
+ "charge": "ch_00000000000000",
20
+ "created": 1517922760,
21
+ "currency": "usd",
22
+ "evidence": {
23
+ "access_activity_log": null,
24
+ "billing_address": null,
25
+ "cancellation_policy": null,
26
+ "cancellation_policy_disclosure": null,
27
+ "cancellation_rebuttal": null,
28
+ "customer_communication": null,
29
+ "customer_email_address": null,
30
+ "customer_name": null,
31
+ "customer_purchase_ip": null,
32
+ "customer_signature": null,
33
+ "duplicate_charge_documentation": null,
34
+ "duplicate_charge_explanation": null,
35
+ "duplicate_charge_id": null,
36
+ "product_description": null,
37
+ "receipt": null,
38
+ "refund_policy": null,
39
+ "refund_policy_disclosure": null,
40
+ "refund_refusal_explanation": null,
41
+ "service_date": null,
42
+ "service_documentation": null,
43
+ "shipping_address": null,
44
+ "shipping_carrier": null,
45
+ "shipping_date": null,
46
+ "shipping_documentation": null,
47
+ "shipping_tracking_number": null,
48
+ "uncategorized_file": null,
49
+ "uncategorized_text": null
50
+ },
51
+ "evidence_details": {
52
+ "due_by": 1519603199,
53
+ "has_evidence": false,
54
+ "past_due": false,
55
+ "submission_count": 0
56
+ },
57
+ "is_charge_refundable": false,
58
+ "livemode": false,
59
+ "metadata": {
60
+ },
61
+ "reason": "general",
62
+ "status": "needs_response"
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "charge.dispute.updated",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-01-23",
10
+ "data": {
11
+ "object": {
12
+ "id": "dp_00000000000000",
13
+ "object": "dispute",
14
+ "amount": 1000,
15
+ "balance_transaction": "txn_00000000000000",
16
+ "balance_transactions": [
17
+
18
+ ],
19
+ "charge": "ch_00000000000000",
20
+ "created": 1517922776,
21
+ "currency": "usd",
22
+ "evidence": {
23
+ "access_activity_log": null,
24
+ "billing_address": null,
25
+ "cancellation_policy": null,
26
+ "cancellation_policy_disclosure": null,
27
+ "cancellation_rebuttal": null,
28
+ "customer_communication": null,
29
+ "customer_email_address": null,
30
+ "customer_name": null,
31
+ "customer_purchase_ip": null,
32
+ "customer_signature": null,
33
+ "duplicate_charge_documentation": null,
34
+ "duplicate_charge_explanation": null,
35
+ "duplicate_charge_id": null,
36
+ "product_description": null,
37
+ "receipt": null,
38
+ "refund_policy": null,
39
+ "refund_policy_disclosure": null,
40
+ "refund_refusal_explanation": null,
41
+ "service_date": null,
42
+ "service_documentation": null,
43
+ "shipping_address": null,
44
+ "shipping_carrier": null,
45
+ "shipping_date": null,
46
+ "shipping_documentation": null,
47
+ "shipping_tracking_number": null,
48
+ "uncategorized_file": null,
49
+ "uncategorized_text": "Here is some evidence"
50
+ },
51
+ "evidence_details": {
52
+ "due_by": 1519603199,
53
+ "has_evidence": false,
54
+ "past_due": false,
55
+ "submission_count": 0
56
+ },
57
+ "is_charge_refundable": false,
58
+ "livemode": false,
59
+ "metadata": {
60
+ },
61
+ "reason": "general",
62
+ "status": "under_review"
63
+ },
64
+ "previous_attributes": {
65
+ "evidence": {
66
+ "access_activity_log": null,
67
+ "billing_address": null,
68
+ "cancellation_policy": null,
69
+ "cancellation_policy_disclosure": null,
70
+ "cancellation_rebuttal": null,
71
+ "customer_communication": null,
72
+ "customer_email_address": null,
73
+ "customer_name": null,
74
+ "customer_purchase_ip": null,
75
+ "customer_signature": null,
76
+ "duplicate_charge_documentation": null,
77
+ "duplicate_charge_explanation": null,
78
+ "duplicate_charge_id": null,
79
+ "product_description": null,
80
+ "receipt": null,
81
+ "refund_policy": null,
82
+ "refund_policy_disclosure": null,
83
+ "refund_refusal_explanation": null,
84
+ "service_date": null,
85
+ "service_documentation": null,
86
+ "shipping_address": null,
87
+ "shipping_carrier": null,
88
+ "shipping_date": null,
89
+ "shipping_documentation": null,
90
+ "shipping_tracking_number": null,
91
+ "uncategorized_file": null,
92
+ "uncategorized_text": "Old uncategorized text"
93
+ }
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "charge.refund.updated",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-01-23",
10
+ "data": {
11
+ "object": {
12
+ "id": "re_00000000000000",
13
+ "object": "refund",
14
+ "amount": 100,
15
+ "balance_transaction": null,
16
+ "charge": "ch_00000000000000",
17
+ "created": 1517848627,
18
+ "currency": "usd",
19
+ "metadata": {
20
+ },
21
+ "reason": null,
22
+ "receipt_number": null,
23
+ "status": "succeeded"
24
+ },
25
+ "previous_attributes": {
26
+ }
27
+ }
28
+ }