Transaction = {
	
	create : function(){
		q = {Method : "Transaction.create"};
		API.query(q, function(json){
			if(json.Button != undefined){
				$("#paypal").html(json.Button);
			}
			
			User.checkLogin(function(){$("#paypal").append("<a onclick=\"Transaction.pay("+json.Transaction_Id+");return false;\" class=\"wide_btn textcenter\">Pay with Cash</a>")});
		});
	},
	
	pay : function(id){
		q = {Method : "Transaction.pay", Id : id};
		API.query(q, function(json){
			UI.showStep(6);
			Session.clear();
			Timer.stop();
		});
	}
	
}
