Skip to content

Merge upstream changes - #1

Open
jaxn wants to merge 229 commits into
ResaleAI:masterfrom
stripe-ruby-mock:master
Open

Merge upstream changes#1
jaxn wants to merge 229 commits into
ResaleAI:masterfrom
stripe-ruby-mock:master

Conversation

@jaxn

@jaxn jaxn commented Dec 29, 2023

Copy link
Copy Markdown
Member

No description provided.

coorasse and others added 30 commits March 18, 2020 10:43
* Does not link refunds through charges like I would expect because
  creation of payment intents do not seem to create and/or link charges
`Stripe::Charge.create` and `Stripe::Refund.create` will throw
`NoMethodError: undefined method `receipt_url'`.

Add `receipt_url` to charge and refund mock data to fix this error
Add :off_session, :trial_from_plan, and :expand params to allowed params in subscription
Fix ruby 2.7 deprecation warnings
Support Stripe Connect by adding stripe_account header namespace for customers
This only throws an error if both customer and subscription aren't present,
which is more consistent with the real API.
Properly set the status of a trialing subscription
Add allowed params to subscriptions
Remove unnecessary check on customer's currency
lfittl and others added 30 commits February 17, 2025 18:44
* add missing mock production attributes

* try to fix github action

* try to fix github action

* fix mock product test

* fix github action

* try to use setup-ruby@v1
Actions uses only supported ruby versions
to Ruby 3.4.0

Co-authored-by: lucas-cp-pessoa <lucas.pessoa@centralreach.com>
* Add support for Stripe version 13

* Support all v13 stripe versions

* Add compatibility with new version of Stripe

* Trigger Build

* Add support for Stripe version 13

- Add Compat module for checking Stripe gem version
- Add Appraisals gem for testing
- Update Client and Instance code to handle both version 12
 and 13 of Stripe
- Update specs

* Add object key to discount

* Refactor compatibility module

Make method name more intuitive

* Add client_instance method

* Update GitHub action to run specs against multiple stripe versions

(cherry picked from commit 41cf163)

* Update gemfile lock

Run bundle exec appraisal update

(cherry picked from commit 6063282)

* Add dependency update instructions to README

(cherry picked from commit a83642d)
* Disabled cack for first run after merge #931

* force execute bundle install
## What

Makes it possible to set cancellation_details when marking a
subscription for cancellation
https://docs.stripe.com/api/subscriptions/update#update_subscription-cancellation_details
* stripe_validator_spec.rb was loaded twice: once by RSpec
  (matching *_spec.rb pattern via load) and once by spec_helper
  (via require in Dir glob), causing a shared example group
  redefinition warning.
* Rename to stripe_validator.rb since it is a shared context,
  not a spec file.
* Stripe v6 uses Subscription#delete, v7+ uses #cancel.
* Add cancel_subscription and cancel_subscription_by_id
  helpers that delegate to the correct method.
* Invoice.create_preview was added in Stripe v11.
* Tests now check for method availability and skip
  gracefully on older versions.
* Stripe v6 requires a positional argument for
  Invoice.upcoming; passing {} works across all versions.
* Add appraisal gemfiles for Stripe 6-11
* Add gemfiles for testing against Stripe SDK v6 through v11
  to verify backward compatibility.
* Add lockfiles for Stripe 6-11 gemfiles
* Add Stripe 6-11 to CI test matrix
* Full Ruby matrix (3.1, 3.2, 3.3) for Stripe 12-13.
* Single Ruby 3.3 for Stripe 6-11 backward compat checks.
* Use full matrix for Stripe 6-11 CI test combinations
The require was added in c34c4e8 (2013) but was apparently never used.

Removing it silences the Ruby 3.4 bundled-gem deprecation warning
("ostruct was loaded from the standard library, but will no longer be
part of the default gems") without needing to add ostruct as a
dependency.
* test: Deflake time related tests

(cherry picked from commit 1c0e057)

* Deflake subscription current_period_start filter spec

"filters out subscriptions based on their current_period" created two
subscriptions and then asserted that filtering by
subscription1.current_period_start returned both of them. That only holds
if both Subscription.create calls happen within the same wall-clock second;
if the clock ticks between them then the test fails.

---------

Co-authored-by: strawhatduckk <strawhatduck@wallwisher.com>
The DRb server needs to be running once client-side, but it
holds no state and so doesn't need to be restarted. The same service
is process-wide and can be used to talk with multiple backend DRb servers.

`DRb.start_service` replaces the `primary_server` each time it is called,
orphaning the previous one as it does so. This leads to fd leaks if
`StripeMock.start_client` and `StripeMock.stop_client` are called repeatedly,
such as when running the test suite.

An alternative approach would be to stop the service during `stop_client`,
but this would interfere with any other code in the same process that's
using the DRb.
* Declare logger as an explicit dependency

logger is a dependency of stripe, but it was removed from
the default gems in ruby 4 and only added explicitly to stripe in v19.

* Add Ruby 4.0 to the CI test matrix
Elsewhere in the code the symbol key `:status` is used, and this
mismatch is flagged up as a warning when using ruby 4.0
PR #958 added the Gemfiles for Stripe v6-11, but didn't add the
configuration. This means that these Gemfiles won't be updated
when running `bundle exec appraisal update`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.