Class: Bakong::Khqr::MerchantInfo

Inherits:
IndividualInfo show all
Defined in:
lib/bakong/khqr/merchant_info.rb

Overview

MerchantInfo extends IndividualInfo with the merchant ID and acquiring bank fields required by the merchant KHQR path (tag 30).

Constant Summary

Constants inherited from IndividualInfo

IndividualInfo::ATTRS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bakong_account_id:, merchant_name:, merchant_city:, merchant_id:, acquiring_bank:, **optional) ⇒ MerchantInfo

Returns a new instance of MerchantInfo.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bakong/khqr/merchant_info.rb', line 12

def initialize(bakong_account_id:, merchant_name:, merchant_city:,
               merchant_id:, acquiring_bank:, **optional)
  super(
    bakong_account_id: ,
    merchant_name: merchant_name,
    merchant_city: merchant_city,
    **optional
  )

  unless merchant_id.is_a?(String) && acquiring_bank.is_a?(String)
    raise ArgumentError, "merchant_id and acquiring_bank must be strings"
  end

  @merchant_id = merchant_id
  @acquiring_bank = acquiring_bank
end

Instance Attribute Details

#merchant_idObject

Returns the value of attribute merchant_id.



10
11
12
# File 'lib/bakong/khqr/merchant_info.rb', line 10

def merchant_id
  @merchant_id
end