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.
- checksums.yaml +4 -4
- data/README.md +22 -1
- data/app/models/stripe_model_callbacks/application_record.rb +17 -0
- data/app/services/stripe_model_callbacks/account/external_account/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/attributes_assigner_service.rb +1 -1
- data/app/services/stripe_model_callbacks/base_service.rb +35 -3
- data/app/services/stripe_model_callbacks/charge/dispute_updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/charge/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/configure_service.rb +52 -24
- data/app/services/stripe_model_callbacks/coupon/sync_all.rb +9 -0
- data/app/services/stripe_model_callbacks/coupon/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/customer/bank_account/deleted_service.rb +1 -1
- data/app/services/stripe_model_callbacks/customer/deleted_service.rb +1 -1
- data/app/services/stripe_model_callbacks/customer/discount_updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/customer/source_updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/customer/subscription/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/customer/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/event_mocker_service.rb +1 -1
- data/app/services/stripe_model_callbacks/invoice/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/invoice_item/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/notifier_service.rb +1 -1
- data/app/services/stripe_model_callbacks/order/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/payout/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/plan/sync_all.rb +9 -0
- data/app/services/stripe_model_callbacks/plan/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/price/updated_service.rb +14 -0
- data/app/services/stripe_model_callbacks/product/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/recipient/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/refund/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/review/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/sku/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/source/updated_service.rb +1 -1
- data/app/services/stripe_model_callbacks/subscription/state_checker_service.rb +2 -2
- data/app/services/stripe_model_callbacks/subscription_schedule/updated_service.rb +46 -0
- data/app/services/stripe_model_callbacks/sync_everything.rb +8 -0
- data/app/services/stripe_model_callbacks/sync_from_stripe.rb +29 -0
- data/app/services/stripe_model_callbacks/tax_rate/updated_service.rb +27 -0
- data/app/services/stripe_model_callbacks/transfer/updated_service.rb +1 -1
- data/db/migrate/20200317160513_add_auto_advance_and_billing_reason_to_stripe_invoices.rb +6 -0
- data/db/migrate/20200317160602_add_status_and_status_transitions_to_stripe_invoices.rb +10 -0
- data/db/migrate/20200317180115_add_product_type_to_products.rb +5 -0
- data/db/migrate/20200317181224_rename_stripe_invoices_application_fee_to_application_fee_amount.rb +6 -0
- data/db/migrate/20200320105158_make_stripe_invoices_forgive_optional.rb +5 -0
- data/db/migrate/20200320114859_make_stripe_invoice_closed_optional.rb +5 -0
- data/db/migrate/20200323143634_add_amount_paid_and_remaining_and_invoice_url_and_pdf.rb +11 -0
- data/db/migrate/20200331074940_add_unit_label_to_stripe_products.rb +5 -0
- data/db/migrate/20200331075241_add_metered_info_to_stripe_plans.rb +9 -0
- data/db/migrate/20200513131105_create_stripe_subscription_schedules.rb +31 -0
- data/db/migrate/20200513131120_create_stripe_subscription_schedule_phases.rb +21 -0
- data/db/migrate/20200513131640_create_stripe_subscription_schedule_phase_plans.rb +13 -0
- data/db/migrate/20200514132247_add_stripe_id_uniq_to_stripe_invoices.rb +8 -0
- data/db/migrate/20200520152604_change_stripe_subscription_schedule_phase_id_to_bigint.rb +27 -0
- data/db/migrate/20200529144649_add_latest_invoice_id_to_stripe_subscription.rb +5 -0
- data/db/migrate/20201223173035_rename_stripe_subscriptions_start_to_start_date.rb +5 -0
- data/db/migrate/20201223202117_create_stripe_tax_rates.rb +15 -0
- data/db/migrate/20201224120534_create_stripe_subscription_default_tax_rates.rb +9 -0
- data/db/migrate/20201224122058_create_stripe_prices.rb +26 -0
- data/db/migrate/20201224123838_add_stripe_price_to_stripe_subscription_items.rb +6 -0
- data/db/migrate/20211121155313_change_invoice_billing_to_nullable.rb +5 -0
- data/db/migrate/20211121155732_rename_invoices_billing_to_deprecated_billing.rb +5 -0
- data/lib/stripe_model_callbacks/configuration.rb +1 -1
- data/lib/stripe_model_callbacks/factories/stripe_bank_accounts.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_cards.rb +7 -0
- data/lib/stripe_model_callbacks/factories/stripe_charges.rb +11 -0
- data/lib/stripe_model_callbacks/factories/stripe_coupons.rb +21 -0
- data/lib/stripe_model_callbacks/factories/stripe_customers.rb +17 -0
- data/lib/stripe_model_callbacks/factories/stripe_discounts.rb +6 -0
- data/lib/stripe_model_callbacks/factories/stripe_disputes.rb +7 -0
- data/lib/stripe_model_callbacks/factories/stripe_invoice_items.rb +11 -0
- data/lib/stripe_model_callbacks/factories/stripe_invoices.rb +16 -0
- data/lib/stripe_model_callbacks/factories/stripe_order_items.rb +8 -0
- data/lib/stripe_model_callbacks/factories/stripe_orders.rb +9 -0
- data/lib/stripe_model_callbacks/factories/stripe_payouts.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_plans.rb +30 -0
- data/lib/stripe_model_callbacks/factories/stripe_prices.rb +3 -0
- data/lib/stripe_model_callbacks/factories/stripe_products.rb +18 -0
- data/lib/stripe_model_callbacks/factories/stripe_recipients.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_refunds.rb +9 -0
- data/lib/stripe_model_callbacks/factories/stripe_reviews.rb +6 -0
- data/lib/stripe_model_callbacks/factories/stripe_skus.rb +7 -0
- data/lib/stripe_model_callbacks/factories/stripe_sources.rb +8 -0
- data/lib/stripe_model_callbacks/factories/stripe_subscription_default_tax_rates.rb +6 -0
- data/lib/stripe_model_callbacks/factories/stripe_subscription_items.rb +19 -0
- data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule.rb.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule_phase_plan.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule_phases.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_subscriptions.rb +40 -0
- data/lib/stripe_model_callbacks/factories/stripe_tax_rates.rb +5 -0
- data/lib/stripe_model_callbacks/factories/stripe_transfers.rb +8 -0
- data/lib/stripe_model_callbacks/factory_bot_definitions.rb +1 -1
- data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.created.json +29 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.deleted.json +29 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.updated.json +31 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.closed.json +65 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.created.json +65 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.funds_reinstated.json +65 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.funds_withdrawn.json +65 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.updated.json +96 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.refund.updated.json +28 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.refunded.json +98 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/coupon/coupon.created.json +29 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/coupon/coupon.deleted.json +29 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/coupon/coupon.updated.json +31 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.bank_account.deleted.json +29 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.created.json +36 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.deleted.json +47 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.discount.created.json +36 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.discount.deleted.json +36 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.discount.updated.json +55 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.created.card.json +80 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.created.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.deleted.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.expiring.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.source.updated.json +56 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.2020-12-24.json +112 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.json +84 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.deleted.json +83 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.trial_will_end.json +88 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.updated.json +100 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.updated.json +50 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.created.json +135 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.payment_failed.json +100 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.payment_succeeded.json +207 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.sent.json +100 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.upcoming.json +100 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.updated.json +105 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.voided.json +152 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/invoiceitem/invoiceitem.created.json +34 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/order/order.created.json +72 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/order/order.updated.json +74 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.canceled.json +35 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.created.json +35 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.failed.json +35 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.paid.json +35 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/payout/payout.updated.json +37 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.created.json +32 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.deleted.json +27 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.updated.json +30 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.created.json +37 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.deleted.json +37 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.updated.json +40 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.created.json +49 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.deleted.json +48 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.updated.json +50 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/recipient/recipient.created.json +37 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/recipient/recipient.deleted.json +37 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/recipient/recipient.updated.json +39 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/review/review.closed.json +21 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/review/review.opened.json +21 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/sku/sku.created.json +36 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/sku/sku.deleted.json +36 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/sku/sku.updated.json +38 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.canceled.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.chargeable.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.failed.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.mandate_notification.json +53 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/source/source.transaction_created.json +21 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.canceled.json +81 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.created.json +77 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.updated.json +87 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/tax_rate/tax_rate.created.json +26 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/tax_rate/tax_rate.updated.json +29 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/transfer/transfer.created.json +41 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/transfer/transfer.reversed.json +40 -0
- data/lib/stripe_model_callbacks/fixtures/stripe_events/transfer/transfer.updated.json +44 -0
- data/lib/stripe_model_callbacks/models/stripe_bank_account.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_card.rb +2 -1
- data/lib/stripe_model_callbacks/models/stripe_charge.rb +3 -0
- data/lib/stripe_model_callbacks/models/stripe_coupon.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_customer.rb +4 -2
- data/lib/stripe_model_callbacks/models/stripe_discount.rb +10 -3
- data/lib/stripe_model_callbacks/models/stripe_dispute.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_invoice.rb +62 -7
- data/lib/stripe_model_callbacks/models/stripe_invoice_item.rb +2 -0
- data/lib/stripe_model_callbacks/models/stripe_order.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_order_item.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_payout.rb +2 -1
- data/lib/stripe_model_callbacks/models/stripe_plan.rb +4 -1
- data/lib/stripe_model_callbacks/models/stripe_price.rb +27 -0
- data/lib/stripe_model_callbacks/models/stripe_product.rb +17 -7
- data/lib/stripe_model_callbacks/models/stripe_recipient.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_refund.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_review.rb +1 -0
- data/lib/stripe_model_callbacks/models/stripe_sku.rb +13 -6
- data/lib/stripe_model_callbacks/models/stripe_source.rb +4 -2
- data/lib/stripe_model_callbacks/models/stripe_subscription.rb +56 -6
- data/lib/stripe_model_callbacks/models/stripe_subscription_default_tax_rate.rb +4 -0
- data/lib/stripe_model_callbacks/models/stripe_subscription_item.rb +19 -1
- data/lib/stripe_model_callbacks/models/stripe_subscription_schedule.rb +94 -0
- data/lib/stripe_model_callbacks/models/stripe_subscription_schedule_phase.rb +67 -0
- data/lib/stripe_model_callbacks/models/stripe_subscription_schedule_phase_plan.rb +37 -0
- data/lib/stripe_model_callbacks/models/stripe_tax_rate.rb +22 -0
- data/lib/stripe_model_callbacks/models/stripe_transfer.rb +1 -0
- data/lib/stripe_model_callbacks/version.rb +1 -1
- data/lib/stripe_model_callbacks.rb +1 -0
- metadata +163 -11
@@ -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,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
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.created.json
ADDED
@@ -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
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.deleted.json
ADDED
@@ -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
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/account/account.external_account.updated.json
ADDED
@@ -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
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.funds_reinstated.json
ADDED
@@ -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
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/charge/charge.dispute.funds_withdrawn.json
ADDED
@@ -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
|
+
}
|