Repository navigation
feat: add customer portal endpoints, cursor pagination and webhook verification - #12
Merged
Merged
Conversation
gastonrey
marked this pull request as ready for review
October 2, 2026 13:05
FlorentinoG9
approved these changes
Oct 2, 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
Factorial's Customer Portal is being opened to Hyperline-billed companies. It needs endpoints the gem does not wrap yet, and the v1 invoice list ignores
customer_id, so filtering a customer's invoices returned other customers' documents.What
Invoices#list_v2/#get_v2onGET /v2/invoices, with aCursorCollectionfor its cursor pagination (limit,cursor,next_cursor,has_more).customer_idandsubscription_idfilter correctly here. Credit notes aretype: "refund".Invoices#downloadmoves to/v2/invoices/{id}/downloadand returns aHyperline::Download(body,content_type,filename). It follows one redirect without forwarding the API key. Breaking for callers that compared the result to a String;to_strkeeps string-like use working.Invoices#chargeacceptsidempotency_key:.Customers#get_v2,#payment_methods,#delete_payment_method,#portal.Subscriptions#preview_timeline,#simulate_updates.Integrations#create_component_token(customer_id:)for the embedded React components.Hyperline::Webhook.verify!(payload:, headers:, secret:): Svix-style HMAC-SHA256 check overid.timestamp.body,whsec_secret, 5-minute tolerance, constant-time compare. RaisesHyperline::WebhookSignatureError.Verification
bundle exec rspec: 144 examples, 0 failures.rubocop: no offenses.## [Unreleased]in the CHANGELOG.