Packages

## ECPay 綠界 Payment Gateway Integration for Elixir The purpose of this library is to provide API integration with the ECPay (綠界科技) payment gateway provided by the Taiwan-based Green World FinTech Service Co., Ltd. (綠界科技股份有限公司).

Current section

Files

Jump to
ecpay lib config.ex
Raw

lib/config.ex

defmodule ECPay.Config do
@config_vars [:merchant_id, :hash_key, :hash_iv, :return_url]
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