

function SUE_doPay(oPayForm, bShowWaitForPay){
	var sFormTarget = 'PaymentTerminal';
	var oWin = null;



	oWin = new SMPopup();

	with(oWin){
		targetName = sFormTarget;
		targetUrl = "https://www.sofort-ueberweisung.de/payment.php";
		locationReplace = true;
		showScroll = true;
		showModal = false;
		pWidth = 800;
		pHeight = 560;
		openPage();
	};

	with(oPayForm){
		action = 'https://www.sofort-ueberweisung.de/payment.php';
		target = sFormTarget;
		submit();
	};

	return(bShowWaitForPay);
};

function SUE_setFieldValue(fieldName, fieldValue){
	switch(fieldName){
		case 'kdnr':
			fieldValue = '29444'; break;
		case 'projekt':
			fieldValue = '79881'; break;
		case 'betrag':
			var oAmount = new cSMPrice();
			oAmount.decode(SMShop.basket.getAttribute(_SMAFinalSum));
			fieldValue = cprimary.format(oAmount.gross, SM_CNOFORMAT);
			break;
		case 'v_zweck_1':
			fieldValue = SMShop.getAttribute("sid");
			break;
		case 'v_zweck_2':
			switch('opt2'){
				case 'opt1':
					fieldValue = SMShop.getFormValue("BILLTO", "BILLTO_EMAIL"); break;
				case 'opt2':
					fieldValue = SMShop.getFormValue("BILLTO", "BILLTO_FIRSTNAME") + " " + SMShop.getFormValue("BILLTO", "BILLTO_LASTNAME");
					break;
				case 'opt3':
					fieldValue = SMShop.getAttribute("sid"); break;
				case 'opt4':
					fieldValue = ''; break;
			};
			break;
		case 'const_betrag':
			fieldValue = '1'; break;
		case 'const_v_zweck_1':
			fieldValue = '0'; 
			break;
		case 'const_v_zweck_2':
			if("Falsch" == "Falsch"){
				fieldValue = '1'; break;
			} else {
				fieldValue = '0'; break;
			};
		case 'kunden_var_0':
			fieldValue = SMShop.getAttribute("sid"); break;
		case 'kunden_var_1':
			fieldValue = ''; break;
		case 'kunden_var_2':
			fieldValue = ''; break;
		case 'kunden_var_3':
			fieldValue = ''; break;
		case 'kunden_var_4':
			fieldValue = ''; break;
		case 'kunden_var_5':
			fieldValue = ''; break;
		case 'Partner':
			fieldValue = 'SmartStore AG'; break;
		case 'use_input_passwort':
			if("Falsch" == "Falsch"){
				fieldValue = '1'; break;
			} else {
				fieldValue = '0'; break;
			};
		case 'input_passwort':
			fieldValue = ''; break;
	};
	return(fieldValue);
};

function SUE_removePayFormFields(){
	return(true);
};

function SUE_setForwardPayformFieldNames(){
	var sFields = ''; // semicolon separated string with paymethods formfields to show in ordermail
	return(sFields);
};

function SUE_setResponseQueryCaptions(param){
	var sCaption = '';
	switch(param.toLowerCase()){
		case 'transid': sCaption = 'Transaktionsnr.'; break;
		default: sCaption = param;
	};
	return(sCaption);
};
