Skip to content

Commit

Permalink
Upgrade to Stripe 7 & API version 2022-08-01
Browse files Browse the repository at this point in the history
* Update stripe API version

* Update docs and version
  • Loading branch information
excid3 authored Aug 4, 2022
1 parent 5460d7f commit d0367f5
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem "appraisal"
gem "overcommit"

gem "braintree", ">= 2.92.0"
gem "stripe", "~> 6.5"
gem "stripe", "~> 7.0"
gem "paddle_pay", "~> 0.2.0"

gem "receipts"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT
PATH
remote: .
specs:
pay (4.2.1)
pay (5.0.0)
rails (>= 6.0.0)

GEM
Expand Down Expand Up @@ -222,7 +222,7 @@ GEM
rubocop-performance (= 1.14.3)
standardrb (1.0.1)
standard
stripe (6.5.0)
stripe (7.0.0)
strscan (3.0.4)
thor (1.2.1)
timeout (0.3.0)
Expand Down Expand Up @@ -273,7 +273,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
standard
standardrb
stripe (~> 6.5)
stripe (~> 7.0)
turbolinks
vcr
web-console
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Want to see how Pay works? Check out our video getting started guide.

Our supported payment processors are:

- Stripe ([SCA Compatible](https://stripe.com/docs/strong-customer-authentication) using API version `2020-08-27`)
- Stripe ([SCA Compatible](https://stripe.com/docs/strong-customer-authentication) using API version `2022-08-01`)
- Paddle (SCA Compatible & supports PayPal)
- Braintree (supports PayPal)
- [Fake Processor](docs/fake_processor/1_overview.md) (used for generic trials without cards, free subscriptions, testing, etc)
Expand Down
2 changes: 1 addition & 1 deletion docs/1_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add these lines to your application's Gemfile:
gem "pay", "~> 4.0"

# To use Stripe, also include:
gem "stripe", "~> 6.0"
gem "stripe", "~> 7.0"

# To use Braintree + PayPal, also include:
gem "braintree", "~> 4.7"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "byebug"
gem "appraisal"
gem "overcommit"
gem "braintree", ">= 2.92.0"
gem "stripe", "~> 6.5"
gem "stripe", "~> 7.0"
gem "paddle_pay", "~> 0.2.0"
gem "receipts"
gem "prawn", git: "https://github.com/prawnpdf/prawn.git"
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/rails_6.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT
PATH
remote: ..
specs:
pay (4.2.1)
pay (5.0.0)
rails (>= 6.0.0)

GEM
Expand Down Expand Up @@ -213,7 +213,7 @@ GEM
rubocop-performance (= 1.14.3)
standardrb (1.0.1)
standard
stripe (6.5.0)
stripe (7.0.0)
thor (1.2.1)
thread_safe (0.3.6)
timeout (0.3.0)
Expand Down Expand Up @@ -268,7 +268,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
standard
standardrb
stripe (~> 6.5)
stripe (~> 7.0)
turbolinks
vcr
web-console
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "byebug"
gem "appraisal"
gem "overcommit"
gem "braintree", ">= 2.92.0"
gem "stripe", "~> 6.5"
gem "stripe", "~> 7.0"
gem "paddle_pay", "~> 0.2.0"
gem "receipts"
gem "prawn", git: "https://github.com/prawnpdf/prawn.git"
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/rails_6_1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT
PATH
remote: ..
specs:
pay (4.2.1)
pay (5.0.0)
rails (>= 6.0.0)

GEM
Expand Down Expand Up @@ -217,7 +217,7 @@ GEM
rubocop-performance (= 1.14.3)
standardrb (1.0.1)
standard
stripe (6.5.0)
stripe (7.0.0)
thor (1.2.1)
timeout (0.3.0)
ttfunk (1.7.0)
Expand Down Expand Up @@ -271,7 +271,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
standard
standardrb
stripe (~> 6.5)
stripe (~> 7.0)
turbolinks
vcr
web-console
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "byebug"
gem "appraisal"
gem "overcommit"
gem "braintree", ">= 2.92.0"
gem "stripe", "~> 6.5"
gem "stripe", "~> 7.0"
gem "paddle_pay", "~> 0.2.0"
gem "receipts"
gem "prawn", git: "https://github.com/prawnpdf/prawn.git"
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/rails_7.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT
PATH
remote: ..
specs:
pay (4.2.1)
pay (5.0.0)
rails (>= 6.0.0)

GEM
Expand Down Expand Up @@ -224,7 +224,7 @@ GEM
rubocop-performance (= 1.14.3)
standardrb (1.0.1)
standard
stripe (6.5.0)
stripe (7.0.0)
strscan (3.0.4)
thor (1.2.1)
timeout (0.3.0)
Expand Down Expand Up @@ -279,7 +279,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
standard
standardrb
stripe (~> 6.5)
stripe (~> 7.0)
turbolinks
vcr
web-console
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_master.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "byebug"
gem "appraisal"
gem "overcommit"
gem "braintree", ">= 2.92.0"
gem "stripe", "~> 6.5"
gem "stripe", "~> 7.0"
gem "paddle_pay", "~> 0.2.0"
gem "receipts"
gem "prawn", git: "https://github.com/prawnpdf/prawn.git"
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/rails_master.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ GIT
PATH
remote: ..
specs:
pay (4.2.1)
pay (5.0.0)
rails (>= 6.0.0)

GEM
Expand Down Expand Up @@ -233,7 +233,7 @@ GEM
rubocop-performance (= 1.14.3)
standardrb (1.0.1)
standard
stripe (6.5.0)
stripe (7.0.0)
strscan (3.0.4)
thor (1.2.1)
timeout (0.3.0)
Expand Down Expand Up @@ -288,7 +288,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
standard
standardrb
stripe (~> 6.5)
stripe (~> 7.0)
turbolinks
vcr
web-console
Expand Down
4 changes: 2 additions & 2 deletions lib/pay/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ module Webhooks
def self.enabled?
return false unless Pay.enabled_processors.include?(:stripe) && defined?(::Stripe)

Pay::Engine.version_matches?(required: "~> 6", current: ::Stripe::VERSION) || (raise "[Pay] stripe gem must be version ~> 6")
Pay::Engine.version_matches?(required: "~> 7", current: ::Stripe::VERSION) || (raise "[Pay] stripe gem must be version ~> 7")
end

def self.setup
::Stripe.api_key = private_key
::Stripe.api_version = "2020-08-27"
::Stripe.api_version = "2022-08-02"

# Used by Stripe to identify Pay for support
::Stripe.set_app_info("PayRails", partner_id: "pp_partner_IqhY0UExnJYLxg", version: Pay::VERSION, url: "https://github.com/pay-rails/pay")
Expand Down
2 changes: 1 addition & 1 deletion lib/pay/stripe/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def cancel(**options)
# cancel_now!(prorate: true)
# cancel_now!(invoice_now: true)
def cancel_now!(**options)
@stripe_subscription = ::Stripe::Subscription.delete(processor_id, options.merge(expand_options), stripe_options)
@stripe_subscription = ::Stripe::Subscription.cancel(processor_id, options.merge(expand_options), stripe_options)
pay_subscription.update(ends_at: Time.current, status: :canceled)
rescue ::Stripe::StripeError => e
raise Pay::Stripe::Error, e
Expand Down
2 changes: 1 addition & 1 deletion lib/pay/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Pay
VERSION = "4.2.1"
VERSION = "5.0.0"
end

0 comments on commit d0367f5

Please sign in to comment.