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:
parent
136159a2b5
commit
a38fe0b43c
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user