Skip to content

Instantly share code, notes, and snippets.

@Macmee
Last active December 16, 2025 23:57
Show Gist options
  • Select an option

  • Save Macmee/f18663b9d1ff1ccad750613175371bfe to your computer and use it in GitHub Desktop.

Select an option

Save Macmee/f18663b9d1ff1ccad750613175371bfe to your computer and use it in GitHub Desktop.
Ingestion route changes for Ben Dec 16 2025
/*
new changes:
1. if source starts with "PAYMENT" then we process it and the table and our mongo/pg
properties like we do already. Business as usual.
2. if source is anything else (like "APP_LAUNCH") then we won't do that. Instead, we should
continue to log everything we do now and then enumerate "debug_info" and try
POST payload: and find the expiration date furthest in the future. If it is greater then 12
hours versus our member's expiration date in the table right now, we want a LOUD alert,
probably a prod slack alert?
*/
const POST_BODY = {
"client_source": "PAYMENT", // or "PAYMENT_UNFINISHED" or "APP_LAUNCH"
"signed_info": [
{
"state": 1,
"signed_transaction_info": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0cmFuc2FjdGlvbklkIjoiMjAwMDAwMDAxMjM0NTY3Iiwib3JpZ2luYWxUcmFuc2FjdGlvbklkIjoiMTAwMDAwMDEyMzQ1Njc4IiwicHJvZHVjdElkIjoic3RhbmRhcmRfMW1fMjQuOTkiLCJwdXJjaGFzZURhdGVNcyI6MTc0OTAwMDAwMDAwMCwiZXhwaXJlc0RhdGVNcyI6MTc1MjAwMDAwMDAwMCwiaXNVaXBncmFkZWQiOmZhbHNlfQ.sig",
"signed_renewal_info": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRvUmVuZXciOnRydWUsImF1dG9SZW5ld1Byb2R1Y3RJZCI6InN0YW5kYXJkXzFtXzI0Ljk5IiwiZ3JhY2VQZXJpb2RFeHBpcmVzRGF0ZU1zIjoxNzUyNjAwMDAwMDAwfQ.sig"
},
{
"state": 0,
"signed_transaction_info": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0cmFuc2FjdGlvbklkIjoiMjAwMDAwMDAxOTg3NjU0Iiwib3JpZ2luYWxUcmFuc2FjdGlvbklkIjoiMTAwMDAwMDEyMzQ1Njc4IiwicHJvZHVjdElkIjoic3RhbmRhcmRfMW1fMjQuOTkiLCJwdXJjaGFzZURhdGVNcyI6MTc0NDAwMDAwMDAwMCwiZXhwaXJlc0RhdGVNcyI6MTc0NzAwMDAwMDAwMCwiaXNVaXBncmFkZWQiOnRydWV9.sig",
"signed_renewal_info": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRvUmVuZXciOmZhbHNlLCJleHBpcmF0aW9uSW50ZW50IjoidXNlcl9jYW5jZWxlZCJ9.sig"
}
],
"debug_metadata": [
{
"renewal_info": {
"auto_renew_status": true,
"auto_renew_product_id": "standard_1m_24.99",
"expiration_intent": null,
"grace_period_expires_date_ms": 1752600000000,
"is_in_billing_retry_period": false
},
"state": 1,
"transaction_info": {
"transaction_id": "200000001234567",
"original_transaction_id": "100000012345678",
"product_id": "standard_1m_24.99",
"purchase_date_ms": 1749000000000,
"expires_date_ms": 1752000000000,
"is_trial_period": false,
"is_in_intro_offer_period": false,
"revocation_date_ms": null,
"is_upgraded": false
}
},
{
"renewal_info": {
"auto_renew_status": false,
"auto_renew_product_id": null,
"expiration_intent": "user_canceled",
"grace_period_expires_date_ms": null,
"is_in_billing_retry_period": false
},
"state": 0,
"transaction_info": {
"transaction_id": "200000001987654",
"original_transaction_id": "100000012345678",
"product_id": "standard_1m_24.99",
"purchase_date_ms": 1744000000000,
"expires_date_ms": 1747000000000,
"is_trial_period": false,
"is_in_intro_offer_period": false,
"revocation_date_ms": null,
"is_upgraded": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment