-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested attributes with dynamic_jsonp_keys #79
Comments
That config option manipulates the GET query string for the cache. I think the fix you're looking for would be in the cache key generation here: https://github.com/oesmith/puffing-billy/blob/master/lib/billy/cache.rb#L80. Seems like you want to remove keys from the request body before using the body to generate the cache key. Want to take a stab at adding a new config option for that? |
Actually, all of these parameters are in the URL. The gem uses Faraday for the requests, so I'm guessing putting the parameters in the URL is part of Faraday's implementation. Is this unusual? If so, is it too unusual to justify adding support for removing nested keys? |
@michaelrkn, whoa, Balanced Payments sends credit card details in the GET query string? That violates nearly every rule about when to use a GET. I haven't seen nested GET params in a very long time and have reservations about helping enable Balanced Payments' poor architecture if that's indeed the case. |
Because the balanced.js library uses JSONP, it creates an async
So, yes, it is performing a GET request, but that's because it's using JSONP. Honestly, I didn't actually understand how JSONP until doing a bit of research just now, but this seems to be the standard way to make requests with JSONP. |
@michaelrkn, is this still an issue? I see that the related issue in your repo was closed in June. |
We switched from Balanced to Stripe and no longer need to ignore nested keys. I have no idea if Puffing Billy supports this now, but my feelings won't be hurt if you decide this isn't important and close the issue :) |
I'll close it for now until another Balanced user runs into the same issue. |
I'm using the Balanced Payments API in a project. A typical request has parameters that look like this (converted to JSON for readability):
Because all of the keys are nested within the "data" key, using
dynamic_jsonp_keys
is very blunt - I have to either ignore everything or nothing. It would be nice to be able to specify nested keys to ignore, e.g.:or something along those lines. I'm not exactly sure what the right interface would be.
The relevant code is at https://github.com/oesmith/puffing-billy/blob/master/lib/billy/cache.rb#L99.
The text was updated successfully, but these errors were encountered: