Skip to content

Commit

Permalink
Add Stripe max_network_retries default to automatically retry API req…
Browse files Browse the repository at this point in the history
…uests
  • Loading branch information
excid3 committed Apr 15, 2022
1 parent 2f6b687 commit d7c9291
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ end
* `paddle_pay ~> 0.2`
* `receipts ~> 2`

* Stripe.max_network_retries is now set to 2 by default. - @excid3
This adds idempotency keys automatically to each request so that they can be safely retried.
* Stripe Subscriptons can now be paused and resumed - @excid3
* Replace `update_email!` with `update_customer!` - @excid3
* Add options for `cancel_now!` to support `invoice_now` and `prorate` flags for Stripe - @excid3
Expand Down
5 changes: 5 additions & 0 deletions lib/pay/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def self.setup

# 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")

# Automatically retry requests that fail
# This automatically includes idempotency keys in the request to guarantee that retires are safe
# https://github.com/stripe/stripe-ruby#configuring-automatic-retries
::Stripe.max_network_retries = 2
end

def self.public_key
Expand Down

0 comments on commit d7c9291

Please sign in to comment.