sessions parsing

This commit is contained in:
ntr
2019-06-19 22:04:25 +10:00
parent 27864aa9fc
commit a43f0d309e
13 changed files with 568 additions and 134 deletions
@@ -0,0 +1,64 @@
{
"id": "evt_1Emw4mGf8y65MteUNt6J2zlN",
"object": "event",
"api_version": "2019-05-16",
"created": 1560921076,
"data": {
"object": {
"id": "cs_test_0FldEAQpyiya1xFLtZpPuEaWQ8OGnMMsotlnwrWCk8jXrAeeMtVruHwB",
"object": "checkout.session",
"billing_address_collection": null,
"cancel_url": "http://localhost:40080/payments/cancel",
"client_reference_id": "ff3bbecb-e744-4674-b411-a11d6832a5ac",
"customer": "cus_FHV47hm01bNBpG",
"customer_email": null,
"display_items": [
{
"amount": 500,
"currency": "aud",
"quantity": 1,
"sku": {
"id": "sku_FHUfNEhWQaVDaT",
"object": "sku",
"active": true,
"attributes": {
"name": "20 bits"
},
"created": 1560919564,
"currency": "aud",
"image": null,
"inventory": {
"quantity": null,
"type": "infinite",
"value": null
},
"livemode": false,
"metadata": {
},
"package_dimensions": null,
"price": 500,
"product": "prod_FHUfY9DFwl0pPl",
"updated": 1560919796
},
"type": "sku"
}
],
"livemode": false,
"locale": null,
"payment_intent": "pi_1Emw4WGf8y65MteUBrVOy4ME",
"payment_method_types": [
"card"
],
"submit_type": null,
"subscription": null,
"success_url": "http://localhost:40080/payments/success"
}
},
"livemode": false,
"pending_webhooks": 3,
"request": {
"id": null,
"idempotency_key": null
},
"type": "checkout.session.completed"
}
@@ -0,0 +1,63 @@
{
"id": "evt_1EmH4cGf8y65MteUj9qhzJzD",
"object": "event",
"api_version": "2019-05-16",
"created": 1560763462,
"data": {
"object": {
"id": "cs_test_RH4RVfajVXRAcruFssXLthaDnfVBJGiPumUfMzPdj5DixpieRl645hkQ",
"object": "checkout.session",
"billing_address_collection": null,
"cancel_url": "http://localhost:40080/payments/cancel",
"client_reference_id": "ff3bbecb-e744-4674-b411-a11d6832a5ac",
"customer": "cus_FGoioD9GGtTXlW",
"customer_email": null,
"display_items": [
{
"amount": 1000,
"currency": "aud",
"plan": {
"id": "plan_FGmRwawcOJJ7Nv",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_FGmRFYmB700pM5",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"type": "plan"
}
],
"livemode": false,
"locale": null,
"payment_intent": null,
"payment_method_types": [
"card"
],
"submit_type": null,
"subscription": "sub_FGoiRaWHZUF01V",
"success_url": "http://localhost:40080/payments/success"
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": null,
"idempotency_key": null
},
"type": "checkout.session.completed"
}
@@ -0,0 +1,43 @@
{
"created": 1326853478,
"livemode": false,
"id": "evt_00000000000000",
"type": "checkout.session.completed",
"object": "event",
"request": null,
"pending_webhooks": 1,
"api_version": "2019-05-16",
"data": {
"object": {
"id": "cs_00000000000000",
"object": "checkout.session",
"billing_address_collection": null,
"cancel_url": "https://example.com/cancel",
"client_reference_id": null,
"customer": null,
"customer_email": null,
"display_items": [
{
"amount": 1500,
"currency": "usd",
"custom": {
"description": "Comfortable cotton t-shirt",
"images": null,
"name": "T-shirt"
},
"quantity": 2,
"type": "custom"
}
],
"livemode": false,
"locale": null,
"payment_intent": "pi_00000000000000",
"payment_method_types": [
"card"
],
"submit_type": null,
"subscription": null,
"success_url": "https://example.com/success"
}
}
}
@@ -0,0 +1,109 @@
{
"created": 1326853478,
"livemode": false,
"id": "evt_00000000000000",
"type": "customer.subscription.created",
"object": "event",
"request": null,
"pending_webhooks": 1,
"api_version": "2019-05-16",
"data": {
"object": {
"id": "sub_00000000000000",
"object": "subscription",
"application_fee_percent": null,
"billing": "charge_automatically",
"billing_cycle_anchor": 1560755136,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"collection_method": "charge_automatically",
"created": 1560755136,
"current_period_end": 1563347136,
"current_period_start": 1560755136,
"customer": "cus_00000000000000",
"days_until_due": null,
"default_payment_method": "pm_1EmEuIGf8y65MteU7aM67eNH",
"default_source": null,
"default_tax_rates": [
],
"discount": null,
"ended_at": null,
"items": {
"object": "list",
"data": [
{
"id": "si_00000000000000",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1560755136,
"metadata": {
},
"plan": {
"id": "plan_00000000000000",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_00000000000000",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"subscription": "sub_00000000000000"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_FGmToAWeV09Z35"
},
"latest_invoice": "in_1EmEuKGf8y65MteUxapoByyd",
"livemode": false,
"metadata": {
},
"plan": {
"id": "plan_00000000000000",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_00000000000000",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"schedule": null,
"start": 1560755136,
"start_date": 1560755136,
"status": "active",
"tax_percent": null,
"trial_end": null,
"trial_start": null
}
}
}
@@ -0,0 +1,134 @@
{
"created": 1326853478,
"livemode": false,
"id": "evt_00000000000000",
"type": "customer.subscription.updated",
"object": "event",
"request": null,
"pending_webhooks": 1,
"api_version": "2019-05-16",
"data": {
"object": {
"id": "sub_00000000000000",
"object": "subscription",
"application_fee_percent": null,
"billing": "charge_automatically",
"billing_cycle_anchor": 1560755136,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"collection_method": "charge_automatically",
"created": 1560755136,
"current_period_end": 1563347136,
"current_period_start": 1560755136,
"customer": "cus_00000000000000",
"days_until_due": null,
"default_payment_method": "pm_1EmEuIGf8y65MteU7aM67eNH",
"default_source": null,
"default_tax_rates": [
],
"discount": null,
"ended_at": null,
"items": {
"object": "list",
"data": [
{
"id": "si_00000000000000",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1560755136,
"metadata": {
},
"plan": {
"id": "plan_00000000000000",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_00000000000000",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"subscription": "sub_00000000000000"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_FGmToAWeV09Z35"
},
"latest_invoice": "in_1EmEuKGf8y65MteUxapoByyd",
"livemode": false,
"metadata": {
},
"plan": {
"id": "plan_00000000000000",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_00000000000000",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"schedule": null,
"start": 1560755136,
"start_date": 1560755136,
"status": "active",
"tax_percent": null,
"trial_end": null,
"trial_start": null
},
"previous_attributes": {
"plan": {
"id": "OLD_00000000000000",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_00000000000000",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed",
"name": "Old plan"
}
}
}
}
-101
View File
@@ -1,101 +0,0 @@
{
"object": {
"id": "sub_FGmgBxTVX2xM7H",
"object": "subscription",
"application_fee_percent": null,
"billing": "charge_automatically",
"billing_cycle_anchor": 1560755931,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"collection_method": "charge_automatically",
"created": 1560755931,
"current_period_end": 1563347931,
"current_period_start": 1560755931,
"customer": "cus_FGmgIHDimD5Tei",
"days_until_due": null,
"default_payment_method": "pm_1EmF78Gf8y65MteUQBHQU1po",
"default_source": null,
"default_tax_rates": [
],
"discount": null,
"ended_at": null,
"items": {
"object": "list",
"data": [
{
"id": "si_FGmg6F7DZAyU2Y",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1560755932,
"metadata": {
},
"plan": {
"id": "plan_FGmRwawcOJJ7Nv",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_FGmRFYmB700pM5",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"subscription": "sub_FGmgBxTVX2xM7H",
"tax_rates": [
]
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_FGmgBxTVX2xM7H"
},
"latest_invoice": "in_1EmF7AGf8y65MteUvH8MCela",
"livemode": false,
"metadata": {
},
"plan": {
"id": "plan_FGmRwawcOJJ7Nv",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"billing_scheme": "per_unit",
"created": 1560755040,
"currency": "aud",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"nickname": "basic",
"product": "prod_FGmRFYmB700pM5",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"schedule": null,
"start": 1560755931,
"start_date": 1560755931,
"status": "active",
"tax_percent": null,
"trial_end": null,
"trial_start": null
}
}