Repository navigation
Conversation
* Require the paddle gem ~> 3 for Paddle Billing and Paddle Classic. Paddle 3 requires Ruby 3.3+, matching the Rubies CI tests * Add ostruct to the dev Gemfile. braintree requires it without depending on it, and paddle 3 no longer installs it * Rescue Paddle::ErrorGenerator (Billing) and Paddle::Classic::Error (Classic). Pay rescued Paddle::Error, which the gem doesn't raise for API failures, so raw gem errors escaped instead of Pay's error classes * Re-record the Paddle Billing cassettes against a new sandbox account
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.
Upgrades the paddle gem to 3.0 and fixes Pay's Paddle error handling, which has never caught the gem's API errors.
Paddle 3
paddle ~> 3. Paddle 3 requires Ruby 3.3+, the same Rubies CI tests; 3.2 and older are end of life.ostruct. braintree requires it without depending on it, so the dev Gemfile now includesostruct. The CHANGELOG tells apps to do the same if they rely on it.Error handling fix
Pay rescued
::Paddle::Error, which the gem never raises for API failures:Paddle::Errors::*, which inherit fromPaddle::ErrorGeneratorPaddle::Classic::ErrorSo apps got the raw gem errors instead of the documented
Pay::PaddleBilling::Error/Pay::PaddleClassic::Error. All 16 rescues now catch the right classes. Paddle 3 raises on every non-2xx response, so this would have shown up more often. There's a new test for each integration (both fail without the fix), and one existing test that asserted the raw error now expects the wrapped one.Re-recorded cassettes
The 3 Paddle Billing cassettes (from 2023) are re-recorded with paddle 3 against a new sandbox account. The fixture subscription and the swap test's price now point at objects in that account. The charge test now asserts any wrapped Paddle API error rather than a specific 403, since the status code depends on the account.
Testing
Full suite passes on the main bundle and every appraisal (Rails 7.0, 7.1, 7.2, 8.0, 8.1, main): 594 runs, 0 failures.
standardrbis clean.