lib/khalti/transaction.rb in khalti-0.1.5 vs lib/khalti/transaction.rb in khalti-0.2.0
- old
+ new
@@ -1,13 +1,17 @@
+# frozen_string_literal: true
+
require 'uri'
require 'net/http'
require 'json'
module Khalti
+ # Khalti Transaction API wrapper
class Transaction
API_URL = 'https://khalti.com/api/merchant-transaction'
def self.find(idx)
- raise Errors::BlankError.new('Ensure idx is not blank.') if idx.nil? || idx.strip.empty?
+ raise Errors::BlankError, 'Ensure idx is not blank.' \
+ if idx.nil? || idx.strip.empty?
RequestHelper.get("#{API_URL}/#{idx}/")
end
def self.all
RequestHelper.get("#{API_URL}/")