Module: Veritrans::Config
Overview
hold constants configuration define in server merchant
Constant Summary collapse
- SERVER_HOST =
server Veritrans - defined in gem - no change!
'https://payments.veritrans.co.id'- REQUEST_KEY_URL =
Request Key Url - use in #get_keys - defined in gem - no change!
"/web1/commodityRegist.action"- TOKENS_URL =
Request Key Url - use in #get_keys - defined in gem - no change!
"/vtdirect/v1/tokens"- CHARGES_URL =
Charges Url - use in #get_keys - defined in gem - no change!
"/vtdirect/v1/charges"- VOID_URL =
Void Url - use in #get_keys - defined in gem - no change!
"/vtdirect/v1/void"- PAYMENT_REDIRECT_URL =
Payment Redirect Url - defined in gem - no change!
"/web1/deviceCheck.action"- CUSTOMER_SPECIFICATION_FLAG =
:nodoc:
'0'- SETTLEMENT_TYPE_CARD =
Default Settlement method:
"01"- CARD_CAPTURE_FLAG =
Flag: Sales and Sales Credit, 0: only 1 credit. If not specified, 0
"1"
Class Method Summary collapse
Class Method Details
.included(mod) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/veritrans/config.rb', line 39 def Config.included(mod) class <<self template = { 'merchant_id' => nil, 'merchant_hash_key' => nil, 'finish_payment_return_url' => nil, 'unfinish_payment_return_url' => nil, 'error_payment_return_url' => nil, 'server_key' => nil, 'server_host' => nil, 'charges_url' => nil, 'token_url' => nil } @@config_env = ::Object.const_defined?(:Rails) ? Rails.env : "development" @@config = File.exists?("./config/veritrans.yml") ? YAML.load_file("./config/veritrans.yml") : {} @@config['development'] = {} if !@@config['development'] @@config['production' ] = {} if !@@config['production'] @@config['development'] = template.clone.merge(@@config['development']) @@config['production'] = template.clone.merge(@@config['production']) #@@config['production' ].merge!(template) end mod.instance_eval <<CODE def self.config_env=(env) @@config_env = env end def self.config @@config[@@config_env] end CODE end |