require File.expand_path( File.join(File.dirname(__FILE__),%w[.. lib veritrans])) wpath= File.dirname(__FILE__).gsub(/bin$/,'') def howto_veritrans puts < Start IRB Enjoy... END end arg = ARGV if arg.size==0 howto_veritrans exit end if arg.select{|x|x=='-irb'} != [] ARGV.reject!{|x|x=='-irb'} require 'irb' puts < "IDxx1", "COMMODITY_UNIT" => "10", "COMMODITY_NUM" => "1", "COMMODITY_NAME1" => "Waterbotle", "COMMODITY_NAME2" => "Waterbottle in Indonesian"} ] client.shipping_flag = "1" client.shipping_first_name = "Sam" client.shipping_last_name = "Anthony" client.shipping_address1 = "Buaran I" client.shipping_address2 = "Pulogadung" client.shipping_city = "Jakarta" client.shipping_country_code = "IDN" client.shipping_postal_code = "16954" client.shipping_phone = "0123456789123" client.shipping_method = "N" client.get_keys client OR client = Veritrans::Client.new do |me| me.order_id = "dummy#{(0...12).map{65.+(rand(25))}.join}" me.session_id = "session#{(0...12).map{65.+(rand(25))}.join}" me.gross_amount = "10" me.commodity = [ {"COMMODITY_ID" => "IDxx1", "COMMODITY_UNIT" => "10", "COMMODITY_NUM" => "1", "COMMODITY_NAME1" => "Waterbotle", "COMMODITY_NAME2" => "Waterbottle in Indonesian"} ] me.shipping_flag = "1" me.shipping_first_name = "Sam" me.shipping_last_name = "Anthony" me.shipping_address1 = "Buaran I" me.shipping_address2 = "Pulogadung" me.shipping_city = "Jakarta" me.shipping_country_code = "IDN" me.shipping_postal_code = "16954" me.shipping_phone = "0123456789123" me.shipping_method = "N" end EOF IRB.start end