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,56 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.source.updated",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-01-23",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "src_00000000000000",
|
13
|
+
"object": "source",
|
14
|
+
"amount": null,
|
15
|
+
"client_secret": "src_client_secret_CGQ1vsxpatHxAyu1kS06C67y",
|
16
|
+
"created": 1517772593,
|
17
|
+
"currency": "usd",
|
18
|
+
"flow": "receiver",
|
19
|
+
"livemode": false,
|
20
|
+
"metadata": {
|
21
|
+
},
|
22
|
+
"owner": {
|
23
|
+
"address": null,
|
24
|
+
"email": "jenny.rosen@example.com",
|
25
|
+
"name": null,
|
26
|
+
"phone": null,
|
27
|
+
"verified_address": null,
|
28
|
+
"verified_email": null,
|
29
|
+
"verified_name": null,
|
30
|
+
"verified_phone": null
|
31
|
+
},
|
32
|
+
"receiver": {
|
33
|
+
"address": "121042882-38381234567890123",
|
34
|
+
"amount_charged": 0,
|
35
|
+
"amount_received": 0,
|
36
|
+
"amount_returned": 0,
|
37
|
+
"refund_attributes_method": "email",
|
38
|
+
"refund_attributes_status": "missing"
|
39
|
+
},
|
40
|
+
"statement_descriptor": null,
|
41
|
+
"status": "pending",
|
42
|
+
"type": "ach_credit_transfer",
|
43
|
+
"usage": "reusable",
|
44
|
+
"ach_credit_transfer": {
|
45
|
+
"account_number": "test_52796e3294dc",
|
46
|
+
"routing_number": "110000000",
|
47
|
+
"fingerprint": "ecpwEzmBOSMOqQTL",
|
48
|
+
"bank_name": "TEST BANK",
|
49
|
+
"swift_code": "TSTEZ122"
|
50
|
+
}
|
51
|
+
},
|
52
|
+
"previous_attributes": {
|
53
|
+
"exp_year": "2013"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.created",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-02-06",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "sub_00000000000000",
|
13
|
+
"object": "subscription",
|
14
|
+
"application_fee_percent": null,
|
15
|
+
"billing": "charge_automatically",
|
16
|
+
"billing_cycle_anchor": 1517764446,
|
17
|
+
"billing_thresholds": null,
|
18
|
+
"cancel_at": null,
|
19
|
+
"cancel_at_period_end": false,
|
20
|
+
"canceled_at": 1517764476,
|
21
|
+
"collection_method": "charge_automatically",
|
22
|
+
"created": 1517764446,
|
23
|
+
"current_period_end": 1520183646,
|
24
|
+
"current_period_start": 1517764446,
|
25
|
+
"customer": "cus_00000000000000",
|
26
|
+
"days_until_due": null,
|
27
|
+
"default_payment_method": null,
|
28
|
+
"default_source": null,
|
29
|
+
"default_tax_rates": [
|
30
|
+
{
|
31
|
+
"id": "txr_1I1qD2AT5SYrvIfd69tAvJe2",
|
32
|
+
"object": "tax_rate",
|
33
|
+
"active": true,
|
34
|
+
"created": 1608802452,
|
35
|
+
"description": null,
|
36
|
+
"display_name": "VAT DK",
|
37
|
+
"inclusive": false,
|
38
|
+
"jurisdiction": null,
|
39
|
+
"livemode": false,
|
40
|
+
"metadata": {},
|
41
|
+
"percentage": 25.0
|
42
|
+
}
|
43
|
+
],
|
44
|
+
"discount": null,
|
45
|
+
"ended_at": 1517764476,
|
46
|
+
"invoice_customer_balance_settings": {
|
47
|
+
"consume_applied_balance_on_void": true
|
48
|
+
},
|
49
|
+
"items": {
|
50
|
+
"object": "list",
|
51
|
+
"data": [
|
52
|
+
{
|
53
|
+
"id": "si_00000000000000",
|
54
|
+
"object": "subscription_item",
|
55
|
+
"billing_thresholds": null,
|
56
|
+
"created": 1517764446,
|
57
|
+
"metadata": {
|
58
|
+
},
|
59
|
+
"price": {
|
60
|
+
"id": "large_00000000000000",
|
61
|
+
"object": "price",
|
62
|
+
"active": true,
|
63
|
+
"billing_scheme": "per_unit",
|
64
|
+
"created": 1517762943,
|
65
|
+
"currency": "dkk",
|
66
|
+
"livemode": false,
|
67
|
+
"lookup_key": null,
|
68
|
+
"metadata": {
|
69
|
+
},
|
70
|
+
"nickname": null,
|
71
|
+
"product": "prod_00000000000000",
|
72
|
+
"recurring": {
|
73
|
+
"aggregate_usage": null,
|
74
|
+
"interval": "month",
|
75
|
+
"interval_count": 1,
|
76
|
+
"usage_type": "licensed"
|
77
|
+
},
|
78
|
+
"tiers_mode": null,
|
79
|
+
"transform_quantity": null,
|
80
|
+
"type": "recurring",
|
81
|
+
"unit_amount": 10000,
|
82
|
+
"unit_amount_decimal": "10000"
|
83
|
+
},
|
84
|
+
"quantity": 1,
|
85
|
+
"subscription": "sub_00000000000000",
|
86
|
+
"tax_rates": [
|
87
|
+
]
|
88
|
+
}
|
89
|
+
],
|
90
|
+
"has_more": false,
|
91
|
+
"url": "/v1/subscription_items?subscription=sub_CGNpFmtIMKpiIN"
|
92
|
+
},
|
93
|
+
"latest_invoice": "in_1GoYq1J3a8kmO8fmMn28KIy2",
|
94
|
+
"livemode": false,
|
95
|
+
"metadata": {
|
96
|
+
},
|
97
|
+
"next_pending_invoice_item_invoice": null,
|
98
|
+
"pause_collection": null,
|
99
|
+
"pending_invoice_item_interval": null,
|
100
|
+
"pending_setup_intent": null,
|
101
|
+
"pending_update": null,
|
102
|
+
"schedule": null,
|
103
|
+
"start": 1517764446,
|
104
|
+
"start_date": 1517764446,
|
105
|
+
"status": "canceled",
|
106
|
+
"tax_percent": null,
|
107
|
+
"transfer_data": null,
|
108
|
+
"trial_end": null,
|
109
|
+
"trial_start": null
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.json
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.created",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-01-23",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "sub_CGPXJjUMVXBLSx",
|
13
|
+
"object": "subscription",
|
14
|
+
"application_fee_percent": null,
|
15
|
+
"billing": "charge_automatically",
|
16
|
+
"cancel_at_period_end": false,
|
17
|
+
"canceled_at": null,
|
18
|
+
"created": 1517770770,
|
19
|
+
"current_period_end": 1520189970,
|
20
|
+
"current_period_start": 1517770770,
|
21
|
+
"customer": "cus_00000000000000",
|
22
|
+
"days_until_due": null,
|
23
|
+
"discount": null,
|
24
|
+
"ended_at": null,
|
25
|
+
"items": {
|
26
|
+
"object": "list",
|
27
|
+
"data": [
|
28
|
+
{
|
29
|
+
"id": "si_CGPX2RZhm2pE0o",
|
30
|
+
"object": "subscription_item",
|
31
|
+
"created": 1517770770,
|
32
|
+
"metadata": {
|
33
|
+
},
|
34
|
+
"plan": {
|
35
|
+
"id": "silver-express-898",
|
36
|
+
"object": "plan",
|
37
|
+
"amount": 999,
|
38
|
+
"created": 1506381458,
|
39
|
+
"currency": "usd",
|
40
|
+
"interval": "month",
|
41
|
+
"interval_count": 1,
|
42
|
+
"livemode": false,
|
43
|
+
"metadata": {
|
44
|
+
},
|
45
|
+
"name": "Silver Express",
|
46
|
+
"statement_descriptor": null,
|
47
|
+
"trial_period_days": null
|
48
|
+
},
|
49
|
+
"quantity": 1,
|
50
|
+
"subscription": "sub_CGPXJjUMVXBLSx"
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"has_more": false,
|
54
|
+
"total_count": 1,
|
55
|
+
"url": "/v1/subscription_items?subscription=sub_CGPXJjUMVXBLSx"
|
56
|
+
},
|
57
|
+
"latest_invoice": "in_1GoYq1J3a8kmO8fmMn28KIy2",
|
58
|
+
"livemode": false,
|
59
|
+
"metadata": {
|
60
|
+
},
|
61
|
+
"plan": {
|
62
|
+
"id": "silver-express-898",
|
63
|
+
"object": "plan",
|
64
|
+
"amount": 999,
|
65
|
+
"created": 1506381458,
|
66
|
+
"currency": "usd",
|
67
|
+
"interval": "month",
|
68
|
+
"interval_count": 1,
|
69
|
+
"livemode": false,
|
70
|
+
"metadata": {
|
71
|
+
},
|
72
|
+
"name": "Silver Express",
|
73
|
+
"statement_descriptor": null,
|
74
|
+
"trial_period_days": null
|
75
|
+
},
|
76
|
+
"quantity": 1,
|
77
|
+
"start": 1517770770,
|
78
|
+
"status": "active",
|
79
|
+
"tax_percent": null,
|
80
|
+
"trial_end": null,
|
81
|
+
"trial_start": null
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.deleted.json
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.deleted",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-01-23",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "sub_00000000000000",
|
13
|
+
"object": "subscription",
|
14
|
+
"application_fee_percent": null,
|
15
|
+
"billing": "charge_automatically",
|
16
|
+
"cancel_at_period_end": false,
|
17
|
+
"canceled_at": null,
|
18
|
+
"created": 1517771609,
|
19
|
+
"current_period_end": 1520190809,
|
20
|
+
"current_period_start": 1517771609,
|
21
|
+
"customer": "cus_00000000000000",
|
22
|
+
"days_until_due": null,
|
23
|
+
"discount": null,
|
24
|
+
"ended_at": 1517769949,
|
25
|
+
"items": {
|
26
|
+
"object": "list",
|
27
|
+
"data": [
|
28
|
+
{
|
29
|
+
"id": "si_CGPlDRAW5ZPZKJ",
|
30
|
+
"object": "subscription_item",
|
31
|
+
"created": 1517771609,
|
32
|
+
"metadata": {
|
33
|
+
},
|
34
|
+
"plan": {
|
35
|
+
"id": "silver-express-898",
|
36
|
+
"object": "plan",
|
37
|
+
"amount": 999,
|
38
|
+
"created": 1506381458,
|
39
|
+
"currency": "usd",
|
40
|
+
"interval": "month",
|
41
|
+
"interval_count": 1,
|
42
|
+
"livemode": false,
|
43
|
+
"metadata": {
|
44
|
+
},
|
45
|
+
"name": "Silver Express",
|
46
|
+
"statement_descriptor": null,
|
47
|
+
"trial_period_days": null
|
48
|
+
},
|
49
|
+
"quantity": 1,
|
50
|
+
"subscription": "sub_00000000000000"
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"has_more": false,
|
54
|
+
"total_count": 1,
|
55
|
+
"url": "/v1/subscription_items?subscription=sub_CGPlqkdRaAAkq4"
|
56
|
+
},
|
57
|
+
"livemode": false,
|
58
|
+
"metadata": {
|
59
|
+
},
|
60
|
+
"plan": {
|
61
|
+
"id": "silver-express-898",
|
62
|
+
"object": "plan",
|
63
|
+
"amount": 999,
|
64
|
+
"created": 1506381458,
|
65
|
+
"currency": "usd",
|
66
|
+
"interval": "month",
|
67
|
+
"interval_count": 1,
|
68
|
+
"livemode": false,
|
69
|
+
"metadata": {
|
70
|
+
},
|
71
|
+
"name": "Silver Express",
|
72
|
+
"statement_descriptor": null,
|
73
|
+
"trial_period_days": null
|
74
|
+
},
|
75
|
+
"quantity": 1,
|
76
|
+
"start": 1517771609,
|
77
|
+
"status": "canceled",
|
78
|
+
"tax_percent": null,
|
79
|
+
"trial_end": null,
|
80
|
+
"trial_start": null
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.trial_will_end",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-01-23",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "sub_00000000000000",
|
13
|
+
"object": "subscription",
|
14
|
+
"application_fee_percent": null,
|
15
|
+
"billing": "charge_automatically",
|
16
|
+
"billing_cycle_anchor": 1517919079,
|
17
|
+
"cancel_at_period_end": false,
|
18
|
+
"canceled_at": null,
|
19
|
+
"created": 1517919079,
|
20
|
+
"current_period_end": 1520338279,
|
21
|
+
"current_period_start": 1517919079,
|
22
|
+
"customer": "cus_00000000000000",
|
23
|
+
"days_until_due": null,
|
24
|
+
"discount": null,
|
25
|
+
"ended_at": null,
|
26
|
+
"items": {
|
27
|
+
"object": "list",
|
28
|
+
"data": [
|
29
|
+
{
|
30
|
+
"id": "si_CH3O9lDxhthMZ7",
|
31
|
+
"object": "subscription_item",
|
32
|
+
"created": 1517919080,
|
33
|
+
"metadata": {
|
34
|
+
},
|
35
|
+
"plan": {
|
36
|
+
"id": "silver-express-898",
|
37
|
+
"object": "plan",
|
38
|
+
"amount": 999,
|
39
|
+
"created": 1506381458,
|
40
|
+
"currency": "usd",
|
41
|
+
"interval": "month",
|
42
|
+
"interval_count": 1,
|
43
|
+
"livemode": false,
|
44
|
+
"metadata": {
|
45
|
+
},
|
46
|
+
"nickname": null,
|
47
|
+
"product": "prod_BT1t06tZ3jBCHi",
|
48
|
+
"trial_period_days": null,
|
49
|
+
"statement_descriptor": null,
|
50
|
+
"name": "Silver Express"
|
51
|
+
},
|
52
|
+
"quantity": 1,
|
53
|
+
"subscription": "sub_CH3OnHOjKJvwcS"
|
54
|
+
}
|
55
|
+
],
|
56
|
+
"has_more": false,
|
57
|
+
"total_count": 1,
|
58
|
+
"url": "/v1/subscription_items?subscription=sub_CH3OnHOjKJvwcS"
|
59
|
+
},
|
60
|
+
"livemode": false,
|
61
|
+
"metadata": {
|
62
|
+
},
|
63
|
+
"plan": {
|
64
|
+
"id": "silver-express-898_00000000000000",
|
65
|
+
"object": "plan",
|
66
|
+
"amount": 999,
|
67
|
+
"created": 1506381458,
|
68
|
+
"currency": "usd",
|
69
|
+
"interval": "month",
|
70
|
+
"interval_count": 1,
|
71
|
+
"livemode": false,
|
72
|
+
"metadata": {
|
73
|
+
},
|
74
|
+
"nickname": null,
|
75
|
+
"product": "prod_00000000000000",
|
76
|
+
"trial_period_days": null,
|
77
|
+
"statement_descriptor": null,
|
78
|
+
"name": "Silver Express"
|
79
|
+
},
|
80
|
+
"quantity": 1,
|
81
|
+
"start": 1517919079,
|
82
|
+
"status": "trialing",
|
83
|
+
"tax_percent": null,
|
84
|
+
"trial_end": 1518176751,
|
85
|
+
"trial_start": 1517917551
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.updated.json
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.subscription.updated",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-01-23",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "sub_CGPu5KqP1TORKF",
|
13
|
+
"object": "subscription",
|
14
|
+
"application_fee_percent": null,
|
15
|
+
"billing": "charge_automatically",
|
16
|
+
"cancel_at_period_end": false,
|
17
|
+
"canceled_at": null,
|
18
|
+
"created": 1517772172,
|
19
|
+
"current_period_end": 1520191372,
|
20
|
+
"current_period_start": 1517772172,
|
21
|
+
"customer": "cus_00000000000000",
|
22
|
+
"days_until_due": null,
|
23
|
+
"discount": null,
|
24
|
+
"ended_at": null,
|
25
|
+
"items": {
|
26
|
+
"object": "list",
|
27
|
+
"data": [
|
28
|
+
{
|
29
|
+
"id": "si_CGPuxYgJ7bx2UW",
|
30
|
+
"object": "subscription_item",
|
31
|
+
"created": 1517772173,
|
32
|
+
"metadata": {
|
33
|
+
},
|
34
|
+
"plan": {
|
35
|
+
"id": "silver-express-898",
|
36
|
+
"object": "plan",
|
37
|
+
"amount": 999,
|
38
|
+
"created": 1506381458,
|
39
|
+
"currency": "usd",
|
40
|
+
"interval": "month",
|
41
|
+
"interval_count": 1,
|
42
|
+
"livemode": false,
|
43
|
+
"metadata": {
|
44
|
+
},
|
45
|
+
"name": "Silver Express",
|
46
|
+
"statement_descriptor": null,
|
47
|
+
"trial_period_days": null
|
48
|
+
},
|
49
|
+
"quantity": 1,
|
50
|
+
"subscription": "sub_CGPu5KqP1TORKF"
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"has_more": false,
|
54
|
+
"total_count": 1,
|
55
|
+
"url": "/v1/subscription_items?subscription=sub_CGPu5KqP1TORKF"
|
56
|
+
},
|
57
|
+
"livemode": false,
|
58
|
+
"metadata": {
|
59
|
+
},
|
60
|
+
"plan": {
|
61
|
+
"id": "silver-express-898",
|
62
|
+
"object": "plan",
|
63
|
+
"amount": 999,
|
64
|
+
"created": 1506381458,
|
65
|
+
"currency": "usd",
|
66
|
+
"interval": "month",
|
67
|
+
"interval_count": 1,
|
68
|
+
"livemode": false,
|
69
|
+
"metadata": {
|
70
|
+
},
|
71
|
+
"name": "Silver Express",
|
72
|
+
"statement_descriptor": null,
|
73
|
+
"trial_period_days": null
|
74
|
+
},
|
75
|
+
"quantity": 1,
|
76
|
+
"start_date": 1517772172,
|
77
|
+
"status": "active",
|
78
|
+
"tax_percent": null,
|
79
|
+
"trial_end": null,
|
80
|
+
"trial_start": null
|
81
|
+
},
|
82
|
+
"previous_attributes": {
|
83
|
+
"plan": {
|
84
|
+
"id": "OLD_PLAN_ID",
|
85
|
+
"object": "plan",
|
86
|
+
"amount": 2000,
|
87
|
+
"created": 1517772172,
|
88
|
+
"currency": "usd",
|
89
|
+
"interval": "month",
|
90
|
+
"interval_count": 1,
|
91
|
+
"livemode": false,
|
92
|
+
"metadata": {
|
93
|
+
},
|
94
|
+
"name": "Old plan",
|
95
|
+
"statement_descriptor": null,
|
96
|
+
"trial_period_days": null
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "customer.updated",
|
6
|
+
"object": "event",
|
7
|
+
"request": null,
|
8
|
+
"pending_webhooks": 1,
|
9
|
+
"api_version": "2018-01-23",
|
10
|
+
"data": {
|
11
|
+
"object": {
|
12
|
+
"id": "cus_00000000000000",
|
13
|
+
"object": "customer",
|
14
|
+
"account_balance": 0,
|
15
|
+
"created": 1517772278,
|
16
|
+
"currency": "usd",
|
17
|
+
"default_source": "card_000000000",
|
18
|
+
"delinquent": false,
|
19
|
+
"description": null,
|
20
|
+
"discount": null,
|
21
|
+
"email": "test@example.com",
|
22
|
+
"invoice_prefix": "c41d443e39",
|
23
|
+
"livemode": false,
|
24
|
+
"metadata": {
|
25
|
+
},
|
26
|
+
"shipping": null,
|
27
|
+
"sources": {
|
28
|
+
"object": "list",
|
29
|
+
"data": [
|
30
|
+
|
31
|
+
],
|
32
|
+
"has_more": false,
|
33
|
+
"total_count": 0,
|
34
|
+
"url": "/v1/customers/cus_CGPwWSwhmCPTTc/sources"
|
35
|
+
},
|
36
|
+
"subscriptions": {
|
37
|
+
"object": "list",
|
38
|
+
"data": [
|
39
|
+
|
40
|
+
],
|
41
|
+
"has_more": false,
|
42
|
+
"total_count": 0,
|
43
|
+
"url": "/v1/customers/cus_CGPwWSwhmCPTTc/subscriptions"
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"previous_attributes": {
|
47
|
+
"description": "Old description"
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|