1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-21 12:29:03 +01:00

fix raising errors from lib

This commit is contained in:
Sylvain 2021-05-28 09:10:34 +02:00
parent 136159a2b5
commit a38fe0b43c
3 changed files with 5 additions and 5 deletions

View File

@ -27,10 +27,10 @@ class PayZen::Client
}
res = Net::HTTP.post(uri, payload.to_json, headers)
raise PayzenError unless res.is_a?(Net::HTTPSuccess)
raise ::PayzenError unless res.is_a?(Net::HTTPSuccess)
json = JSON.parse(res.body)
raise PayzenError(json['answer']['errorMessage']) if json['status'] == 'ERROR'
raise ::PayzenError, json['answer']['errorMessage'] if json['status'] == 'ERROR'
json
end

View File

@ -76,7 +76,7 @@ class PayZen::Helper
supported_hash_algorithm = ['sha256_hmac']
# check if the hash algorithm is supported
raise PayzenError("hash algorithm not supported: #{algorithm}. Update your SDK") unless supported_hash_algorithm.include? algorithm
raise ::PayzenError, "hash algorithm not supported: #{algorithm}. Update your SDK" unless supported_hash_algorithm.include? algorithm
# if key is not defined, we use kr-hash-key parameter to choose it
if key.nil?
@ -85,7 +85,7 @@ class PayZen::Helper
elsif hash_key == 'password'
key = Setting.get('payzen_password')
else
raise PayzenError('invalid hash-key parameter')
raise ::PayzenError, 'invalid hash-key parameter'
end
end

View File

@ -74,7 +74,7 @@ class Stripe::Service < Payment::Service
def create_or_update_product(klass, id)
StripeWorker.perform_async(:create_or_update_stp_product, klass, id)
rescue Stripe::InvalidRequestError => e
raise PaymentGatewayError(e)
raise ::PaymentGatewayError, e
end
def stripe_amount(amount)