



// Funds a card and re-directs to success page
function fund_card() {

	$.ajax(
		{type: "POST",
		 url: "https://shared-sandbox-api.marqeta.com/v3/gpaorders",
		 contentType:"application/json; charset=utf-8",
		 dataType: 'json',
		 async: true,

		 beforeSend: function (xhr) {
		  	xhr.setRequestHeader ("Authorization", 
		  		"Basic " + btoa("user2511477178831:f275a342-6db6-4d23-8a78-c2416538a400"));
		 },

		  // username: 'user2511477178831',
		  // password: 'f275a342-6db6-4d23-8a78-c2416538a400',

		  data: JSON.stringify(
		  	{"user_token": "188794de-da8e-4e42-8325-bc668da7426b",
					  			"amount": "10.00",
					  		    "currency_code": "840",
					  			"funding_source_token": "aa643dc1-dafd-41e1-803c-a92ab31037ba"}),
		  success: function (data) {
		  	// alert( "Data Loaded: " + data );
		  	window.location.href = "success.html";
		  }
	});

}




// Funds a card and re-directs to success page
function fund_card() {

	$.ajax(
		{type: "POST",
		 url: "https://shared-sandbox-api.marqeta.com/v3/gpaorders",
		 contentType:"application/json; charset=utf-8",
		 dataType: 'json',
		 async: true,

		 beforeSend: function (xhr) {
		  	xhr.setRequestHeader ("Authorization", 
		  		"Basic " + btoa("user2511477178831:f275a342-6db6-4d23-8a78-c2416538a400"));
		 },

		  // username: 'user2511477178831',
		  // password: 'f275a342-6db6-4d23-8a78-c2416538a400',

		  data: JSON.stringify(
		  	{"user_token": "188794de-da8e-4e42-8325-bc668da7426b",
					  			"amount": "10.00",
					  		    "currency_code": "840",
					  			"funding_source_token": "aa643dc1-dafd-41e1-803c-a92ab31037ba"}),
		  success: function (data) {
		  	// alert( "Data Loaded: " + data );
		  	window.location.href = "game-success.html";
		  }
	});

}
Update redirect url