ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPurchaseBMFGUI Class Reference
+ Inheritance diagram for ilPurchaseBMFGUI:
+ Collaboration diagram for ilPurchaseBMFGUI:

Public Member Functions

 ilPurchaseBMFGUI ($user_obj)
 cancel ()
 showPersonalData ()
 getPersonalData ()
 showPaymentType ()
 getPaymentType ()
 showDebitEntry ()
 getDebitEntry ()
 sendDebitEntry ()
 showCreditCard ()
 getCreditCard ()
 sendCreditCard ()
executeCommand ()
 execute command
- Public Member Functions inherited from ilPurchaseBaseGUI
 ilPurchaseBaseGUI ($user_obj, $pay_method)
 showBillConfirm ()
 __addBookings ($external_data=null)
 __sendBill ($bookings)
 __emptyShoppingCart ()
 __clearSession ()
 __loadTemplate ()
 __buildStatusline ()
 __buildLocator ()
 __buildStylesheet ()
 __getCountries ()
 shows select box f�r countries
 __getCountryCode ($value= '')
 __getCountryName ($value= '')
 __getShoppingCart ()
 __getTotalAmount ()
 getBill ()
 __showShoppingCart ()

Data Fields

 $ctrl
 $tpl
 $user_obj
 $coupon_obj = null
 $error
 $shoppingCart
 $soapClient
 $pay_method = null
- Data Fields inherited from ilPurchaseBaseGUI
 $ctrl
 $tpl
 $psc_obj = null
 $user_obj = null
 $coupon_obj = null
 $error
 $pmethod_obj = null

Private Attributes

 $totalVat = 0
 $pm_id = 0

Detailed Description

Definition at line 27 of file class.ilPurchaseBMFGUI.php.

Member Function Documentation

ilPurchaseBMFGUI::cancel ( )

Reimplemented from ilPurchaseBaseGUI.

Definition at line 52 of file class.ilPurchaseBMFGUI.php.

References ilUtil\redirect().

{
ilUtil::redirect("./payment.php");
}

+ Here is the call graph for this function:

& ilPurchaseBMFGUI::executeCommand ( )

execute command

Reimplemented from ilPurchaseBaseGUI.

Definition at line 1012 of file class.ilPurchaseBMFGUI.php.

References $cmd.

{
global $tree;
$cmd = $this->ctrl->getCmd();
switch ($this->ctrl->getNextClass($this))
{
default:
if(!$cmd = $this->ctrl->getCmd())
{
$cmd = 'showPersonalData';
}
$this->$cmd();
break;
}
}
ilPurchaseBMFGUI::getCreditCard ( )

Definition at line 784 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, sendCreditCard(), ilUtil\sendInfo(), and showCreditCard().

{
if ($_POST["card_holder"] == "" ||
$_POST["card_number"]["block_1"] == "" ||
$_POST["card_number"]["block_2"] == "" ||
$_POST["card_number"]["block_3"] == "" ||
$_POST["card_number"]["block_4"] == "" ||
$_POST["validity"]["month"] == "" ||
$_POST["validity"]["year"] == "" ||
$_POST["validity"]["year"]."-".$_POST["validity"]["month"] < date("Y-m"))
{
$this->error = $this->lng->txt('pay_bmf_credit_card_not_valid');
ilUtil::sendInfo($this->error);
$this->showCreditCard();
return;
}
if ($_POST["terms_conditions"] != 1)
{
$this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
ilUtil::sendInfo($this->error);
$this->showCreditCard();
return;
}
if ($_POST["password"] == "" ||
md5($_POST["password"]) != $this->user_obj->getPasswd())
{
$this->error = $this->lng->txt('pay_bmf_password_not_valid');
ilUtil::sendInfo($this->error);
$this->showCreditCard();
return;
}
$_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] = $_POST["validity"]["month"];
$_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] = $_POST["validity"]["year"];
$_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_POST["card_holder"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_1"] = $_POST["card_number"]["block_1"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_2"] = $_POST["card_number"]["block_2"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_3"] = $_POST["card_number"]["block_3"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_4"] = $_POST["card_number"]["block_4"];
$_SESSION["bmf"]["credit_card"]["kartenpruefnummer"] = $_POST["check_number"];
# zum testen
$this->error = "";
$this->sendCreditCard();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::getDebitEntry ( )

Definition at line 370 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, sendDebitEntry(), ilUtil\sendInfo(), and showDebitEntry().

{
if ($_POST["account_holder"] == "" ||
$_POST["bank_code"] == "" ||
$_POST["account_number"] == "")
{
$this->error = $this->lng->txt('pay_bmf_debit_entry_not_valid');
ilUtil::sendInfo($this->error);
$this->showDebitEntry();
return;
}
if ($_POST["terms_conditions"] != 1)
{
$this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
ilUtil::sendInfo($this->error);
$this->showDebitEntry();
return;
}
if ($_POST["password"] == "" ||
md5($_POST["password"]) != $this->user_obj->getPasswd())
{
$this->error = $this->lng->txt('pay_bmf_password_not_valid');
ilUtil::sendInfo($this->error);
$this->showDebitEntry();
return;
}
$_SESSION["bmf"]["debit_entry"]["BLZ"] = $_POST["bank_code"];
$_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_POST["account_holder"];
$_SESSION["bmf"]["debit_entry"]["kontoNr"] = $_POST["account_number"];
$this->error = "";
$this->sendDebitEntry();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::getPaymentType ( )

Definition at line 256 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), showCreditCard(), showDebitEntry(), and showPaymentType().

{
if (($_POST["payment_type"] != "credit_card" && $_POST["payment_type"] != "debit_entry") ||
($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] == "debit_entry"))
{
$this->error = $this->lng->txt('pay_bmf_payment_type_not_valid');
ilUtil::sendInfo($this->error);
$this->showPaymentType();
return;
}
$_SESSION["bmf"]["payment_type"] = $_POST["payment_type"];
$this->error = "";
if ($_SESSION["bmf"]["payment_type"] == "credit_card")
{
$this->showCreditCard();
}
else
{
$this->showDebitEntry();
}
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::getPersonalData ( )

Reimplemented from ilPurchaseBaseGUI.

Definition at line 139 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), showPaymentType(), and showPersonalData().

{
if ($_SESSION["bmf"]["personal_data"]["firstname"] == "" ||
$_SESSION["bmf"]["personal_data"]["lastname"] == "" ||
$_POST["zipcode"] == "" ||
$_POST["city"] == "" ||
$_POST["country"] == "" ||
$_SESSION["bmf"]["personal_data"]["email"] == "")
{
$this->error = $this->lng->txt('pay_bmf_personal_data_not_valid');
ilUtil::sendInfo($this->error);
$this->showPersonalData();
return;
}
if (($_POST["street"] == "" && $_POST["house_number"] == "" && $_POST["po_box"] == "") ||
(($_POST["street"] != "" || $_POST["house_number"] != "") && $_POST["po_box"] != "") ||
($_POST["street"] != "" && $_POST["house_number"] == "") ||
($_POST["street"] == "" && $_POST["house_number"] != ""))
{
$this->error = $this->lng->txt('pay_bmf_street_or_pobox');
ilUtil::sendInfo($this->error);
$this->showPersonalData();
return;
}
$_SESSION["bmf"]["personal_data"]["firstname"] = $this->user_obj->getFirstname();
$_SESSION["bmf"]["personal_data"]["lastname"] = $this->user_obj->getLastname();
$_SESSION["bmf"]["personal_data"]["street"] = $_POST["street"];
$_SESSION["bmf"]["personal_data"]["house_number"] = $_POST["house_number"];
$_SESSION["bmf"]["personal_data"]["po_box"] = $_POST["po_box"];
$_SESSION["bmf"]["personal_data"]["zipcode"] = $_POST["zipcode"];
$_SESSION["bmf"]["personal_data"]["city"] = $_POST["city"];
$_SESSION["bmf"]["personal_data"]["country"] = $_POST["country"];
$_SESSION["bmf"]["personal_data"]["email"] = $this->user_obj->getEmail();
$_SESSION["bmf"]["personal_data"]["language"] = $this->user_obj->getLanguage();
if ($_SESSION["bmf"]["personal_data"]["country"] != "DE")
{
if ($_SESSION["bmf"]["payment_type"] == "debit_entry")
{
$_SESSION["bmf"]["payment_type"] = "";
}
}
$this->error = "";
$this->showPaymentType();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::ilPurchaseBMFGUI (   $user_obj)

Definition at line 42 of file class.ilPurchaseBMFGUI.php.

References $user_obj, and ilPayMethods\_getIdByTitle().

{
$this->pm_id = ilPayMethods::_getIdByTitle('bmf');
$this->pay_method = ilPayMethods::_getIdByTitle('bmf');
// Get user object
$this->user_obj = $user_obj;
parent::__construct($this->user_obj, $this->pay_method);
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::sendCreditCard ( )

Definition at line 829 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $error, $result, ilPurchaseBaseGUI\__clearSession(), ilPurchaseBaseGUI\__emptyShoppingCart(), ilUtil\sendInfo(), showCreditCard(), showPaymentType(), and showPersonalData().

Referenced by getCreditCard().

{
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
$this->psc_obj->clearCouponItemsSession();
if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$payment = new KreditkartenzahlungWS();
$customer = new Kunde($this->user_obj->getId());
$creditCard = new Kreditkarte();
$sc_obj = new ilPaymentShoppingCart($this->user_obj);
$tmp_bookEntries = $sc_obj->getShoppingCart();
if (!is_array($tmp_bookEntries))
{
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$totalAmount = 0;
for ($i = 0; $i < count($tmp_bookEntries); $i++)
{
$booking = true;
if (!empty($_SESSION["coupons"]["bmf"]))
{
$price = $tmp_bookEntries[$i]["price"];
$tmp_bookEntries[$i]["math_price"] = $price;
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
$tmp_pobject = new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $price;
$_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
$booking = false;
}
unset($tmp_pobject);
}
}
if ($booking)
{
$tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
$bookEntries[] = new Buchung($tmp_bookEntries[$i]);
$totalAmount += $tmp_bookEntries[$i]["price"];
}
else
{
$tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
}
}
$coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
{
foreach ($coupon_discount_items as $item)
{
$item["price"] = number_format((float)$item["discount_price"] , 2, ".", "");
$bookEntries[] = new Buchung($item);
$totalAmount += $item["discount_price"];
}
}
$totalAmount = number_format((float)$totalAmount , 2, ".", "");
$values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
$bookingList = new BuchungsListe($this->user_obj->getId(), $values);
}
$resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
$result = $resultObj->ergebnis;
if (is_object($result))
{
if ($result->code < 0)
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
$error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
if ($result->code == -103 ||
$result->code == -104 ||
$result->code == -107 ||
($result->code <= -202 && $result->code >= -208) ||
$result->code == -213)
{
$this->showPersonalData();
}
else if ($result->code == -507 ||
$result->code == -510 ||
$result->code == -511)
{
$this->showPaymentType();
}
else if ($result->code == -701 ||
$result->code == -1701 ||
$result->code == -1706 ||
$result->code == -1707 ||
$result->code == -1710 ||
$result->code == -1711)
{
$this->showCreditCard();
}
else
{
$error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
$this->showPersonalData();
}
}
else
{
// everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
$external_data = array();
$external_data['voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
$external_data['transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
$external_data['street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
$external_data['po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
$external_data['zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
$external_data['city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
$external_data['country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
parent::__addbookings($external_data);
$this->__clearSession();
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','Services/Payment');
if ($this->ilias->getSetting("https") != 1)
{
$this->tpl->setCurrentBlock("buyed_objects");
$link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
$this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
$this->tpl->parseCurrentBlock("buyed_objects");
}
$this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
}
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
}
#zum testen
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::sendDebitEntry ( )

Definition at line 405 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $error, $result, ilPurchaseBaseGUI\__clearSession(), ilPurchaseBaseGUI\__emptyShoppingCart(), ilUtil\sendInfo(), showDebitEntry(), showPaymentType(), and showPersonalData().

Referenced by getDebitEntry().

{
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
$this->psc_obj->clearCouponItemsSession();
if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$customer = new KundenstammdatenPflegeWS();
$newCustomer = new Kunde($this->user_obj->getId());
$resultCustomerObj = $customer->anlegenKunde($newCustomer);
$resultCustomer = $resultCustomerObj->ergebnis;
if (is_object($resultCustomer))
{
if ($resultCustomer->code < 0)
{
$error = $this->lng->txt('pay_bmf_server_error_code') . " " . $resultCustomer->code . ": " . $resultCustomer->kurzText . "<br>\n" . $resultCustomer->langText;
if ($resultCustomer->code == -103 ||
$resultCustomer->code == -104 ||
$resultCustomer->code == -107 ||
($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
$resultCustomer->code == -213)
{
$this->showPersonalData();
}
else
{
$error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
$this->showPersonalData();
}
}
else
{
$payment = new LastschriftWS();
$debitEntry = new Lastschrift();
$address = new LieferAdresse();
$bank = new Bankverbindung();
$sc_obj = new ilPaymentShoppingCart($this->user_obj);
$tmp_bookEntries = $sc_obj->getShoppingCart();
if (!is_array($tmp_bookEntries))
{
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$totalAmount = 0;
for ($i = 0; $i < count($tmp_bookEntries); $i++)
{
$booking = true;
if (!empty($_SESSION["coupons"]["bmf"]))
{
$price = $tmp_bookEntries[$i]["price"];
$tmp_bookEntries[$i]["math_price"] = $price;
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
$tmp_pobject = new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $price;
$_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
$booking = false;
}
unset($tmp_pobject);
}
}
if ($booking)
{
$tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ".", "");
$bookEntries[] = new Buchung($tmp_bookEntries[$i]);
$totalAmount += $tmp_bookEntries[$i]["price"];
}
else
{
$tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
}
}
$coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
{
foreach ($coupon_discount_items as $item)
{
$item["price"]= number_format( (float) $item["discount_price"], 2, ".", "");
$bookEntries[] = new Buchung($item);
$totalAmount += $item["price"];
}
}
$totalAmount = number_format( (float) $totalAmount , 2, ".", "");
$values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
$bookingList = new BuchungsListe($this->user_obj->getId(), $values);
}
$resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr, $address, $bank, $bookingList);
$result = $resultObj->ergebnis;
if (is_object($result))
{
if ($result->code < 0)
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
$error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
if ($result->code == -103 ||
$result->code == -104 ||
$result->code == -107 ||
($result->code <= -202 && $result->code >= -208) ||
$result->code == -213)
{
$this->showPersonalData();
}
else if ($result->code == -507 ||
$result->code == -510 ||
$result->code == -511)
{
$this->showPaymentType();
}
else if ($result->code == -402 ||
$result->code == -402 ||
$result->code == -403 ||
$result->code == -406 ||
$result->code == -410 ||
$result->code == -413 ||
$result->code == -701 ||
$result->code == -702 ||
$result->code == -703)
{
$this->showDebitEntry();
}
else
{
$error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
$this->showPersonalData();
}
}
else
{
$resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
$resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
$resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
$resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
$resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
$resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
$resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
$resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
// everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
$external_data = array();
$external_data['voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
$external_data['transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
$external_data['street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
$external_data['po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
$external_data['zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
$external_data['city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
$external_data['country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
parent::__addbookings($external_data);
$this->__clearSession();
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','Services/Payment');
if ($this->ilias->getSetting("https") != 1)
{
$this->tpl->setCurrentBlock("buyed_objects");
$link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
$this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
$this->tpl->parseCurrentBlock("buyed_objects");
}
$this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
}
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
}
}
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showCreditCard ( )

Definition at line 638 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilPurchaseBaseGUI\__showShoppingCart(), ilUtil\getImagePath(), ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getCreditCard(), getPaymentType(), and sendCreditCard().

{
// user_id $this->user_obj->getId()
// all
/* if ($_SESSION["bmf"]["credit_card"]["karteninhaber"] == "" &&
$this->error == "" &&
$_POST["card_holder"] == "")
{
$_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
}*/
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','Services/Payment');
$this->tpl->setVariable("CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_credit_card'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_credit_card_data'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_credit_card'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
$this->tpl->setVariable("TXT_CARD_HOLDER",$this->lng->txt('pay_bmf_card_holder'));
$this->tpl->setVariable("TXT_CHECK_NUMBER",$this->lng->txt('pay_bmf_check_number'));
$this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
$this->tpl->setVariable("TXT_CARD_NUMBER",$this->lng->txt('pay_bmf_card_number'));
$this->tpl->setVariable("TXT_VALIDITY",$this->lng->txt('pay_bmf_validity'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
$this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
$this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
$this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
$this->tpl->setVariable("CARD_HOLDER",
$this->error != "" && isset($_POST['card_holder'])
? ilUtil::prepareFormOutput($_POST['card_holder'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['karteninhaber'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_1",
$this->error != "" && isset($_POST['card_number']['block_1'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_1'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_1'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_2",
$this->error != "" && isset($_POST['card_number']['block_2'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_2'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_2'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_3",
$this->error != "" && isset($_POST['card_number']['block_3'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_3'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_3'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_4",
$this->error != "" && isset($_POST['card_number']['block_4'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_4'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_4'],true));
$this->tpl->setVariable("CHECK_NUMBER",
$this->error != "" && isset($_POST['check_number'])
? ilUtil::prepareFormOutput($_POST['check_number'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kartenpruefnummer'],true));
for ($i = 1; $i <= 12; $i++)
{
$this->tpl->setCurrentBlock("loop_validity_months");
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS", $i < 10 ? "0" . $i : $i);
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS_TXT", $i < 10 ? "0" . $i : $i);
if ($this->error != "" &&
isset($_POST['validity']['month']))
{
if ($_POST['validity']['month'] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
}
}
else
{
if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
}
}
$this->tpl->parseCurrentBlock("loop_validity_months");
}
for ($i = date("Y"); $i <= (date("Y")+6); $i++)
{
$this->tpl->setCurrentBlock("loop_validity_years");
$this->tpl->setVariable("LOOP_VALIDITY_YEARS", $i);
$this->tpl->setVariable("LOOP_VALIDITY_YEARS_TXT", $i);
if ($this->error != "" &&
isset($_POST['validity']['year']))
{
if ($_POST['validity']['year'] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
}
}
else
{
if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
}
}
$this->tpl->parseCurrentBlock("loop_validity_years");
}
/* if ($this->error != "" &&
isset($_POST["terms_conditions"]))
{
$this->tpl->setVariable("TERMS_CONDITIONS_" . $_POST["terms_conditions"], " checked") ;
}*/
/* if ($this->error != "" &&
isset($_POST["password"]))
{
$this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
}*/
// Button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
$this->tpl->parseCurrentBlock("btn_cell");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showDebitEntry ( )

Definition at line 280 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilPurchaseBaseGUI\__showShoppingCart(), ilUtil\getImagePath(), ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getDebitEntry(), getPaymentType(), and sendDebitEntry().

{
// user_id $this->user_obj->getId()
// all
/* if ($_SESSION["bmf"]["debit_entry"]["kontoinhaber"] == "" &&
$this->error == "" &&
$_POST["account_holder"] == "")
{
$_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
}*/
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','Services/Payment');
$this->tpl->setVariable("DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_debit_entry'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_debit_entry_data'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_debit_entry'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
$this->tpl->setVariable("TXT_ACCOUNT_HOLDER",$this->lng->txt('pay_bmf_account_holder'));
$this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
$this->tpl->setVariable("TXT_BANK_CODE",$this->lng->txt('pay_bmf_bank_code'));
$this->tpl->setVariable("TXT_ACCOUNT_NUMBER",$this->lng->txt('pay_bmf_account_number'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
$this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
$this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
$this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
$this->tpl->setVariable("ACCOUNT_HOLDER",
$this->error != "" && isset($_POST['account_holder'])
? ilUtil::prepareFormOutput($_POST['account_holder'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoinhaber'],true));
$this->tpl->setVariable("BANK_CODE",
$this->error != "" && isset($_POST['bank_code'])
? ilUtil::prepareFormOutput($_POST['bank_code'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['BLZ'],true));
$this->tpl->setVariable("ACCOUNT_NUMBER",
$this->error != "" && isset($_POST['account_number'])
? ilUtil::prepareFormOutput($_POST['account_number'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoNr'],true));
/* if ($this->error != "" &&
isset($_POST["terms_conditions"]))
{
$this->tpl->setVariable("TERMS_CONDITIONS_" . strtoupper($_POST["terms_conditions"]), " checked") ;
}*/
/* if ($this->error != "" &&
isset($_POST["password"]))
{
$this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
}*/
// Button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
$this->tpl->parseCurrentBlock("btn_cell");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showPaymentType ( )

Definition at line 189 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\getImagePath(), and ilUtil\sendInfo().

Referenced by getPaymentType(), getPersonalData(), sendCreditCard(), and sendDebitEntry().

{
// user_id $this->user_obj->getId()
// all
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_payment_type.html','Services/Payment');
$this->tpl->setVariable("PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step2'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_payment_type'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_payment_type'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
if ($_SESSION["bmf"]["personal_data"]["country"] == "DE")
{
$this->tpl->setVariable("TXT_DEBIT_ENTRY",$this->lng->txt('pay_bmf_debit_entry'));
}
$this->tpl->setVariable("TXT_CREDIT_CARD",$this->lng->txt('pay_bmf_credit_card'));
$this->tpl->setVariable("INPUT_VALUE",ucfirst($this->lng->txt('next')));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
if ($this->error != "" &&
isset($_POST["payment_type"]))
{
$this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_POST["payment_type"]), " checked") ;
}
else
{
if (($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] != "debit_entry") ||
$_SESSION["bmf"]["personal_data"]["country"] == "DE")
{
$this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_SESSION["bmf"]["payment_type"]), " checked") ;
}
}
// Button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPersonalData"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
$this->tpl->parseCurrentBlock("btn_cell");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showPersonalData ( )

Reimplemented from ilPurchaseBaseGUI.

Definition at line 57 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilPurchaseBaseGUI\__getCountries(), ilUtil\prepareFormOutput(), ilUtil\sendInfo(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by getPersonalData(), sendCreditCard(), and sendDebitEntry().

{
// user_id $this->user_obj->getId()
// all
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step1'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_personal_data'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_personal_data'));
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
$oForm = new ilPropertyFormGUI();
$oForm->setFormAction($this->ctrl->getFormAction($this, 'getPersonalData'));
$oForm->setTitle($this->lng->txt('pay_bmf_personal_data'));
$oFirstname = new ilNonEditableValueGUI($this->lng->txt('firstname'));
$oFirstname->setValue($this->user_obj->getFirstname());
$oForm->addItem($oFirstname);
$oLastname = new ilNonEditableValueGUI($this->lng->txt('lastname'));
$oLastname->setValue($this->user_obj->getLastname());
$oForm->addItem($oLastname);
$oStreet = new ilTextInputGUI($this->lng->txt('street'),'street');
$oStreet->setValue($this->error != '' && isset($_POST['street'])
: ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['street'],true));
$oForm->addItem($oStreet);
$oHouseNumber = new ilTextInputGUI($this->lng->txt('pay_bmf_house_number'), 'house_number');
$oHouseNumber->setValue($this->error != '' && isset($_POST['house_number'])
? ilUtil::prepareFormOutput($_POST['house_number'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['house_number'],true));
$oForm->addItem($oHouseNumber);
$oPoBox = new ilTextInputGUI($this->lng->txt('pay_bmf_or').' '.$this->lng->txt('pay_bmf_po_box'), 'po_box');
$oPoBox->setValue($this->error != '' && isset($_POST['po_box'])
: ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['po_box'],true));
$oForm->addItem($oPoBox);
$oZipCode = new ilTextInputGUI($this->lng->txt('zipcode'), 'zipcode');
$oZipCode->setValue($this->error != '' && isset($_POST['zipcode'])
? ilUtil::prepareFormOutput($_POST['zipcode'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['zipcode'],true));
$oForm->addItem($oZipCode);
$oCity = new ilTextInputGUI($this->lng->txt('city'), 'city');
$oCity->setValue($this->error != '' && isset($_POST['city'])
: ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['city'],true));
$oForm->addItem($oCity);
$oCountry = new ilSelectInputGUI($this->lng->txt('country'), 'country');
$oCountry->setOptions($this->__getCountries());
$oCountry->setValue($this->error != '' && isset($_POST['country']) ? $_POST['country']
: $_SESSION['bmf']['personal_data']['country']);
$oForm->addItem($oCountry);
$oEmail = new ilNonEditableValueGUI($this->lng->txt('email'));
$oEmail->setValue($this->user_obj->getEmail());
$oForm->addItem($oEmail);
$oForm->addcommandButton('getPersonalData',ucfirst($this->lng->txt('next')));
$this->tpl->setVariable('FORM',$oForm->getHTML());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPurchaseBMFGUI::$coupon_obj = null

Definition at line 33 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$ctrl

Definition at line 29 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$error

Definition at line 34 of file class.ilPurchaseBMFGUI.php.

Referenced by sendCreditCard(), and sendDebitEntry().

ilPurchaseBMFGUI::$pay_method = null

Definition at line 38 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$pm_id = 0
private

Definition at line 40 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$shoppingCart

Definition at line 35 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$soapClient

Definition at line 37 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$totalVat = 0
private

Definition at line 39 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$tpl

Definition at line 30 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$user_obj

Definition at line 32 of file class.ilPurchaseBMFGUI.php.

Referenced by ilPurchaseBMFGUI().


The documentation for this class was generated from the following file: