Class: Khalti::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/khalti/transaction.rb

Overview

Khalti Transaction API wrapper

Constant Summary collapse

API_URL =
'https://khalti.com/api/merchant-transaction'

Class Method Summary collapse

Class Method Details

.allObject



17
18
19
# File 'lib/khalti/transaction.rb', line 17

def self.all
  RequestHelper.get("#{API_URL}/")
end

.find(idx) ⇒ Object

Raises:



11
12
13
14
15
# File 'lib/khalti/transaction.rb', line 11

def self.find(idx)
  raise Errors::BlankError, 'Ensure idx is not blank.' \
    if idx.nil? || idx.strip.empty?
  RequestHelper.get("#{API_URL}/#{idx}/")
end