Current section
Files
Jump to
Current section
Files
lib/config.ex
defmodule ECPay.Config do
@config_vars [:merchant_id, :hash_key, :hash_iv, :return_url, :ignored, :expiration_period]
for var <- @config_vars do
def unquote(var)() do
Application.get_env(:ecpay, unquote(var))
end
end
def staging? do
Mix.env() != :prod || Application.get_env(:ecpay, :staging)
end
def payment_url do
if staging?() do
"https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5"
else
"https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5"
end
end
end