class MidtransApi::Configure

Attributes

api_version[R]
client_key[RW]
notification_url[RW]
sandbox_mode[RW]
server_key[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/midtrans_api/configure.rb, line 11
def initialize(options = {})
  @client_key       = options[:client_key]
  @server_key       = options[:server_key]
  @notification_url = options[:notification_url] || nil
  @sandbox_mode     = options[:sandbox] || false
  @api_version      = :v2
end

Public Instance Methods

api_url() click to toggle source
# File lib/midtrans_api/configure.rb, line 19
def api_url
  return MidtransApi::API_SANDBOX_URL if sandbox_mode

  MidtransApi::API_PRODUCTION_URL
end