lib/fawry/requests/charge_request.rb in fawry-1.2.1 vs lib/fawry/requests/charge_request.rb in fawry-1.3.0
- old
+ new
@@ -50,14 +50,14 @@
end
# rubocop:enable Metrics/MethodLength
# rubocop:enable Metrics/AbcSize
def fawry_merchant_code
- ENV.fetch('FAWRY_MERCHANT_CODE') { request_params[:merchant_code] }
+ Fawry.configuration.fawry_merchant_code || ENV.fetch('FAWRY_MERCHANT_CODE') { request_params[:merchant_code] }
end
def fawry_secure_key
- ENV.fetch('FAWRY_SECURE_KEY') { request_params[:fawry_secure_key] }
+ Fawry.configuration.fawry_secure_key || ENV.fetch('FAWRY_SECURE_KEY') { request_params[:fawry_secure_key] }
end
def validate_charge_params!
contract = Contracts::ChargeRequestContract.new.call(request_params)
raise InvalidFawryRequestError, contract.errors.to_h if contract.failure?