chargify / chargify_api_ares

A Chargify API wrapper for Ruby using ActiveResource
http://chargify.com
MIT License
161 stars 96 forks source link

Define dummy modules #101

Closed kylewelsby closed 3 years ago

kylewelsby commented 9 years ago

I cache responses from Chargify to improve performance. I sometimes will get a odd response that is unexpected when one cached part is out of sync with another cached part.

undefined class/module Chargify::Subscription::CreditCard

I believe these classes get defined from AcriveResource when the call is successful, would it be advantageous to have these modules pre-defined to avoid these undefined issues?

Raw cached data

#<ActiveSupport::Cache::Entry:0x007ff8049d8f60 @compressed=false, @expires_in=21600.0, @created_at=1422946568.7772682, @value="\x04\bo:\eChargify::Subscription\b:\x10@attributesC:-ActiveSupport::HashWithIndifferentAccess{#I\"\x11activated_at\x06:\x06EFIu:\tTime\r\x96\xC1\x1C\xC0\x00\x00\xC0)\x06:\tzoneI\"\bUTC\x06;\bTI\"\x15balance_in_cents\x06;\bFi\x00I\"\x1Ccancel_at_end_of_period\x06;\bFTI\"\x10canceled_at\x06;\bF0I\"\x19cancellation_message\x06;\bF0I\"\x0Fcreated_at\x06;\bFIu;\t\r\x96\xC1\x1C\xC0\x00\x00\xB0)\x06;\nI\"\bUTC\x06;\bTI\"\ecurrent_period_ends_at\x06;\bFIu;\t\r\x96\xC5\x1C\xC0\x00\x00\xB0)\x06;\nI\"\bUTC\x06;\bTI\"\x0Fexpires_at\x06;\bF0I\"\aid\x06;\bFi\x03'XrI\"\x17next_assessment_at\x06;\bFIu;\t\r\x96\xC5\x1C\xC0\x00\x00\xB0)\x06;\nI\"\bUTC\x06;\bTI\"\x1Epayment_collection_method\x06;\bFI\"\x0Eautomatic\x06;\bTI\"\rsnap_day\x06;\bF0I\"\nstate\x06;\bFI\"\vactive\x06;\bTI\"\x13trial_ended_at\x06;\bF0I\"\x15trial_started_at\x06;\bF0I\"\x0Fupdated_at\x06;\bFIu;\t\r\x96\xC1\x1C\xC0\x00\x00@E\x06;\nI\"\bUTC\x06;\bTI\"\x1Ecurrent_period_started_at\x06;\bFIu;\t\r\x96\xC1\x1C\xC0\x00\x00\xB0)\x06;\nI\"\bUTC\x06;\bTI\"\x13previous_state\x06;\bFI\"\vactive\x06;\bTI\"\x16signup_payment_id\x06;\bFi\x04\x91y\xD9\x04I\"\x13signup_revenue\x06;\bFI\"\n99.00\x06;\bTI\"\x16delayed_cancel_at\x06;\bFIu;\t\r\x96\xC5\x1C\xC0\x00\x00\xB0)\x06;\nI\"\bUTC\x06;\bTI\"\x10coupon_code\x06;\bF0I\"\etotal_revenue_in_cents\x06;\bFi\x02\xAC&I\"\eproduct_price_in_cents\x06;\bFi\x02\xAC&I\"\eproduct_version_number\x06;\bFi\x06I\"\x11payment_type\x06;\bFI\"\x10credit_card\x06;\bTI\"\x12referral_code\x06;\bF0I\"\rcustomer\x06;\bFo:\x17Chargify::Customer\b;\x06C;\a{\x18I\"\faddress\x06;\bF0I\"\x0Eaddress_2\x06;\bF0I\"\tcity\x06;\bF0I\"\fcountry\x06;\bFI\"\aUS\x06;\bTI\"\x0Fcreated_at\x06;\bFIu;\t\r\x96\xC1\x1C\xC0\x00\x00`)\x06;\nI\"\bUTC\x06;\bTI\"\nemail\x06;\bFI\"\x15test@example.com\x06;\bTI\"\x0Ffirst_name\x06;\bFI\"\ttest\x06;\bTI\"\aid\x06;\bFi\x03],pI\"\x0Elast_name\x06;\bFI\"\ttest\x06;\bTI\"\x11organization\x06;\bF0I\"\nphone\x06;\bF0I\"\x1Fportal_customer_created_at\x06;\bF0I\"#portal_invite_last_accepted_at\x06;\bF0I\"\x1Fportal_invite_last_sent_at\x06;\bF0I\"\x0Ereference\x06;\bFI\"\a28\x06;\bTI\"\nstate\x06;\bF0I\"\x0Fupdated_at\x06;\bFIu;\t\r\x96\xC1\x1C\xC0\x00\x00`)\x06;\nI\"\bUTC\x06;\bTI\"\rverified\x06;\bFFI\"\bzip\x06;\bFI\"\vM4 123\x06;\bT:\x14@prefix_options{\x00:\x0F@persistedFI\"\fproduct\x06;\bFo:\x16Chargify::Product\b;\x06C;\a{\x1EI\"\x14accounting_code\x06;\bF0I\"\x10archived_at\x06;\bF0I\"\x0Fcreated_at\x06;\bFIu;\t\rT`\x1C\xC0\x00\x00@\xB8\x06;\nI\"\bUTC\x06;\bTI\"\x10description\x06;\bF0I\"\x18expiration_interval\x06;\bF0I\"\x1Dexpiration_interval_unit\x06;\bFI\"\nnever\x06;\bTI\"\vhandle\x06;\bFI\"\x1099usd-novat\x06;\bTI\"\aid\x06;\bFi\x03\xCB\xDB2I\"\x1Cinitial_charge_in_cents\x06;\bF0I\"\rinterval\x06;\bFi\x06I\"\x12interval_unit\x06;\bFI\"\nmonth\x06;\bTI\"\tname\x06;\bFI\"\x18Monthly 99USD NoVAT\x06;\bTI\"\x13price_in_cents\x06;\bFi\x02\xAC&I\"\x18request_credit_card\x06;\bFTI\"\x18require_credit_card\x06;\bFTI\"\x12return_params\x06;\bF0I\"\x0Freturn_url\x06;\bF0I\"\ftaxable\x06;\bFFI\"\x13trial_interval\x06;\bF0I\"\x18trial_interval_unit\x06;\bFI\"\nmonth\x06;\bTI\"\x19trial_price_in_cents\x06;\bF0I\"\x16update_return_url\x06;\bF0I\"\x0Fupdated_at\x06;\bFIu;\t\rk\xAE\x1C\xC0\x00\x00\xA0(\x06;\nI\"\bUTC\x06;\bTI\"\x13product_family\x06;\bFo:\x1CChargify::ProductFamily\b;\x06C;\a{\nI\"\x14accounting_code\x06;\bF0I\"\x10description\x06;\bF0I\"\vhandle\x06;\bFI\"\ttest\x06;\bTI\"\aid\x06;\bFi\x03vp\x05I\"\tname\x06;\bFI\"\x10EasyScraper\x06;\bT;\f{\x00;\rFI\"\x18public_signup_pages\x06;\bF[\x00;\f{\x00;\rFI\"\x10credit_card\x06;\bFo:'Chargify::Subscription::CreditCard\b;\x06C;\a{\x17I\"\x14billing_address\x06;\bF0I\"\x16billing_address_2\x06;\bF0I\"\x11billing_city\x06;\bF0I\"\x14billing_country\x06;\bF0I\"\x12billing_state\x06;\bF0I\"\x10billing_zip\x06;\bF0I\"\x0Ecard_type\x06;\bFI\"\tvisa\x06;\bTI\"\x12current_vault\x06;\bFI\"\nbogus\x06;\bTI\"\x10customer_id\x06;\bFi\x03],pI\"\x19customer_vault_token\x06;\bF0I\"\x15expiration_month\x06;\bFi\x06I\"\x14expiration_year\x06;\bFi\x02\xE1\aI\"\x0Ffirst_name\x06;\bFI\"\ttest\x06;\bTI\"\aid\x06;\bFi\x03p\xBDJI\"\x0Elast_name\x06;\bFI\"\ttest\x06;\bTI\"\x17masked_card_number\x06;\bFI\"\x18XXXX-XXXX-XXXX-1111\x06;\bTI\"\x10vault_token\x06;\bFI\"\x154111111111111111\x06;\bTI\"\x11payment_type\x06;\bFI\"\x10credit_card\x06;\bT;\f{\x00;\rF;\f{\x00;\rT">
kylewelsby commented 3 years ago

closing stale issue