class EZAPIClient::CreateTransactionRequest

Constants

DEFAULT_PATH
TRANS_TYPES
TRANS_TYPES_WITHOUT_ACCOUNT_NUMBER
TRANS_TYPES_WITH_ACCOUNT_NUMBER
TRANS_TYPE_CATEGORIES

Private Instance Methods

body() click to toggle source
# File lib/ezapi_client/requests/create_transaction_request.rb, line 59
def body
  attributes.slice(:username, :reference_no, :data).
    merge(password: password_token)
end
default_branch_name() click to toggle source
# File lib/ezapi_client/requests/create_transaction_request.rb, line 64
def default_branch_name
  return if trans_type != "CBA"
  return "MAKATI" if bank_code != "BDO"
  "BDO"
end
default_data() click to toggle source
# File lib/ezapi_client/requests/create_transaction_request.rb, line 74
def default_data
  message = %i[
    reference_no
    sender_lastname
    sender_firstname
    sender_middle_name
    sender_address1
    sender_address2
    sender_phone
    recipient_lastname
    recipient_firstname
    recipient_middle_name
    recipient_address1
    recipient_address2
    recipient_phone
    recipient_gender
    recipient_birthday
    trans_type
    bank_code
    branch_name
    landed_currency
    landed_amount
    message1
    message2
  ].each_with_object({}) { |attr, hash| hash[attr] = send(attr) }
  message[:trans_date] = trans_date.strftime("%Y-%m-%d %H:%M:%S %z")
  if TRANS_TYPES_WITH_ACCOUNT_NUMBER.include?(trans_type)
    message[:account_no] = account_no
  end

  GenData.(
    username: username,
    password: password,
    eks_path: eks_path,
    prv_path: prv_path,
    reference_no: reference_no,
    message: message,
    logger: logger,
    log: log,
  )
end
default_path() click to toggle source
# File lib/ezapi_client/requests/create_transaction_request.rb, line 70
def default_path
  DEFAULT_PATH
end