Repository navigation
feat: add Invoices#download_link and query params on Subscriptions#get - #13
Merged
Merged
Conversation
gastonrey
marked this pull request as ready for review
October 6, 2026 10:53
fedorgorshkov-fact
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Customer Portal needs a browser-openable link to an invoice or credit-note PDF for Hyperline-billed companies, like the
download_urlChargebee returns.GET /v2/invoices/{id}/downloadanswers with a 302 to a signed, short-lived S3 URL, butInvoices#downloadfollows the redirect and returns the bytes. Separately,Subscriptions#getaccepted no query params, so callers embedded?include_live_billing=truein the id.What
Invoices#download_link(id, **params)callsGET /v2/invoices/{id}/downloadwithout following the redirect and returns aHyperline::DownloadLink(url,expires_at).expires_atis computed fromX-Amz-Date+X-Amz-Expires(UTC).refund.urlis nil and callers fall back todownload.Subscriptions#get(id, **params)sends params as the query string, e.g.include_live_billing: true.get(id)sends exactly the same request as before.Verification
bundle exec rspec: 150 examples, 0 failures, also under a non-UTCTZ.rubocop: no offenses.download_linkreturned the signed S3 URL, valid for 60 minutes, for an invoice and for a credit note.get(id, include_live_billing: true)returnedlive_billing.## [Unreleased]in the CHANGELOG.