Module: Clt::GeneralMethods

Included in:
CreditCard, Cvs
Defined in:
lib/clt/general_methods.rb

Instance Method Summary collapse

Instance Method Details

#apn_notice_valid?(params) ⇒ Boolean

APN(Active Payment Notification) notice validation

Returns:

  • (Boolean)


4
5
6
7
8
9
10
# File 'lib/clt/general_methods.rb', line 4

def apn_notice_valid?(params)
  params = params.stringify_keys
  checksum = params['checksum']
  checksum_generated = generate_checksum "#{params['api_id']}:#{params['trans_id']}:#{params['amount']}:#{params['status']}:#{params['nonce']}"

  checksum == checksum_generated
end

#generate_checksum(data) ⇒ Object



12
13
14
# File 'lib/clt/general_methods.rb', line 12

def generate_checksum(data)
  Digest::MD5.hexdigest data
end