Module: CcavenuePayment

Defined in:
lib/ccavenue_payment.rb,
lib/ccavenue_payment/config.rb,
lib/ccavenue_payment/crypto.rb,
lib/ccavenue_payment/version.rb

Defined Under Namespace

Classes: Config, Crypto

Constant Summary collapse

VERSION =
"1.1.9"

Class Method Summary collapse

Class Method Details

.access_codeObject



27
28
29
# File 'lib/ccavenue_payment.rb', line 27

def access_code
  @access_code ||= Config.access_code
end

.decrypted_data(encrypted_string) ⇒ Object



15
16
17
# File 'lib/ccavenue_payment.rb', line 15

def decrypted_data(encrypted_string)
  crypto.decrypt(encrypted_string)
end

.encrypted_data(data) ⇒ Object

Create request object

Options(Hash)



9
10
11
12
13
# File 'lib/ccavenue_payment.rb', line 9

def encrypted_data(data)
  #query_string = data.merge!({ merchant_id: Config.merchant_id }).to_query
  query_string = hash_to_query(data.merge!({ merchant_id: Config.merchant_id }))
  crypto.encrypt(query_string)
end

.request_urlObject



19
20
21
22
23
24
25
# File 'lib/ccavenue_payment.rb', line 19

def request_url
  if Config.mode.upcase == 'TEST'
    "https://test.ccavenue.com/transaction/transaction.do?command=initiateTransaction"
  elsif Config.mode.upcase == 'LIVE'
    "https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction"
  end
end