Package unlimeted ?

07/27/2014 00:44 sdrakula#1
Buying limited payment packages :
Code:
function throwError(msg) {
    alert(msg);
    throw new Error(msg);
}

if (typeof(Payment) === "undefined") {
	try {
		var paymentLayer = document.getElementsByClassName('paymentContent')[0];
	} catch (e) {
		var paymentLayer = document.getElementsByTagName('iframe')[0];
	}
	
	if (typeof(paymentLayer) === "undefined") {
		throwError('No payment layer or window detected. Are you logged in and is a payment window visible?');
	}
	
	var confirmNewTab = confirm('Payment frame detected, but it\'s required to be opened as a seperate window.\n\n' + 
		'Click \"OK\" to open the frame in a new tab. You have to copy the script content in the console there again!' + 
		'\n\n(There is a good chance that your popup blocker will block this tab.)');
		
	if (confirmNewTab) {
		window.open(paymentLayer.src, '_blank');
		throw new Error('Continue in the newly opened tab');
	}
	
	throw new Error('Cancelled by user.');
}

if ((Payment.cartElements.length < 1) || (typeof(Payment.cartElements[0]) === "undefined")) {
	// Prepare the cart by removing old undefined entries
	Payment.cartElements = [];
	throwError('The shopping cart is empty! Add an item first (either by using a payment link or choosing something from the left list).');
}

var itemDesc = Payment.cartElements[0].item.textContent;
var targetAmount = prompt('Please enter how often you want to buy the package \"' + itemDesc + '\"');

if ((isNaN(targetAmount)) || (targetAmount == "") || (targetAmount < 1)) {
	throwError('Enter only numbers.');
}

// Make sure the is only one item in the cart
Payment.cartElements = Payment.cartElements.slice(0, 1);

var totalPrice = Payment.cartElements[0].shoppingCartPrice;
for (var i = 1; i < targetAmount; i++) {
	Payment.cartElements.push(Payment.cartElements[0]);
	
	totalPrice += Payment.cartElements.slice(-1)[0].shoppingCartPrice;
}

// For security list the cart elements in the console
var cartStr = 'Shopping cart content:\n';
for (i = 0; i < Payment.cartElements.length; i++) {
	cartStr += (i + 1) + '. ' + Payment.cartElements[i].item.textContent + '\n';
}

try {
	console.info(cartStr);
} catch (e) {}

var confirmBuy = confirm('You are going to buy the package \"' + itemDesc + '\" ' + 
	Payment.cartElements.length + ' times, for a total price of ' + totalPrice + getShoppingCartCurrency() + 
	'.\n\nYou have to pay the price of ' + totalPrice + getShoppingCartCurrency() + ', you don\'t get anything for free!' +
	'\nYOU HAVE BEEN WARNED!\n\nPlease also check the console, your shopping cart content is listed there.\n' + 
	'If everything is correct, press \"OK\"');
	
if (!confirmBuy) {
	// Reset cart to 1 element
	Payment.cartElements = Payment.cartElements.slice(0, 1);
	throwError('Cancelled by user.');
} else {
	Payment.calcSums();
	Payment.requestMethods();
	
	alert('Everything done. Now continue with the payment as normal.');
}
does work ?
07/27/2014 00:59 sandersmith#2
yes
07/27/2014 01:02 sdrakula#3
so 30 vodo cannon = 105 TL i can buy 315 tl = 90 voodo cannon ?
07/27/2014 02:17 grandskull#4
how can I use?
07/27/2014 12:51 the-h-#5
it will work but big point will give you only one packeg and cheng the others to pearls
i did try it
07/27/2014 21:31 ☛Tʜᴇʜᴀᴄᴋᴇʀ☚#6
Quote:
Originally Posted by the-h- View Post
it will work but big point will give you only one packeg and cheng the others to pearls
i did try it
Its works nicely.
Some pack cant be bought multiple times but the 200 eur Voodoo pack kan be bought multiple times
07/27/2014 21:33 Uther#7
For Google Chrome Press press SHIFT+CTRL+J Paste the code and press Enter.
07/28/2014 19:09 iPusheer#8
Kann mir einer die Links für die großen Kristallpakete schicken?
07/28/2014 20:18 GOETHE.#9
Thanks to creator for the code ;) .
07/29/2014 23:53 grandskull#10
I did not work and I get the following

Payment.requestMethods();

alert('Everything done. Now continue with the payment as normal.');
SyntaxError: Unexpected end of input
message: "Unexpected end of input"
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: Error