require_relative 'base' require 'json' class Transactions < Base def initialize_transaction(data) base_url = petra_object.base_url required_parameters = ["amount", "type", "email"] check_passed_parameters(required_parameters, data) response = post_request("#{base_url}/transaction/initialize", data) return response end def get_transactions(page = 1, per_page = 50) base_url = petra_object.base_url response = get_request("#{base_url}/transaction?perPage=#{per_page}&page=#{page}") return response end def fetch_transaction(id) base_url = petra_object.base_url response = get_request("#{base_url}/transaction/#{id}") return response end def verify_transaction(id) base_url = petra_object.base_url response = get_request("#{base_url}/transaction/verify/#{id}") return response end end