mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-03-21 12:29:03 +01:00
[bug] Unable to access the invoices section if the stripe key was not set or incorrect
This commit is contained in:
parent
58803dbc02
commit
5eae1c74a8
@ -1,6 +1,7 @@
|
||||
# Changelog Fab-manager
|
||||
|
||||
- Ability to run the upgrade without interactions
|
||||
- Fix a bug: Unable to access the invoices section if no stripe key was set or incorrect
|
||||
|
||||
## v4.5.0 2020 June 30
|
||||
|
||||
|
@ -60,10 +60,12 @@ class API::PaymentsController < API::ApiController
|
||||
authorize :payment
|
||||
|
||||
key = Setting.get('stripe_secret_key')
|
||||
render json: { status: false } and return unless key
|
||||
render json: { status: false } and return unless key&.present?
|
||||
|
||||
charges = Stripe::Charge.list({ limit: 1 }, { api_key: key })
|
||||
render json: { status: charges.data.length.positive? }
|
||||
rescue Stripe::AuthenticationError
|
||||
render json: { status: false }
|
||||
end
|
||||
|
||||
private
|
||||
|
Loading…
x
Reference in New Issue
Block a user