ILIAS  release_4-4 Revision
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 More...
 
- Public Member Functions inherited from ilPurchaseBaseGUI
 __construct ($user_obj, $pay_method)
 
 cancel ()
 
 showPersonalData ()
 
 getPersonalData ()
 
 showBillConfirm ()
 
 executeCommand ()
 execute command More...
 
 __addBookings ($external_data=null)
 
 __sendBill ($bookings)
 
 __emptyShoppingCart ()
 
 __clearSession ()
 
 __loadTemplate ()
 
 __buildStatusline ()
 
 __buildLocator ()
 
 __buildStylesheet ()
 
 __getCountries ()
 shows select box f�r countries More...
 
 __getCountryCode ($value='')
 
 __getCountryName ($value='')
 
 __getTotalAmount ()
 depricated!? More...
 
 getBill ()
 
 __showShoppingCart ()
 
 getAccess ()
 
 setAccess ($access)
 
 getPayed ()
 
 setPayed ($payed)
 
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from ilShopBaseGUI
 prepareOutput ()
 
 addPager ($result, $a_session_key)
 
 buildSubTabs ()
 
 setSection ($a_section)
 
 getSection ()
 
 setSubSection ($a_sub_section)
 
 getSubSection ()
 
 showButton ($a_cmd, $a_text, $a_target='')
 
 initTableGUI ()
 
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column='')
 
- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $oGeneralSettings = null
 
 $section = 0
 
 $sub_section = 0
 

Detailed Description

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

Member Function Documentation

◆ cancel()

ilPurchaseBMFGUI::cancel ( )

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

References ilUtil\redirect().

53  {
54  ilUtil::redirect("./payment.php");
55  }
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ executeCommand()

& ilPurchaseBMFGUI::executeCommand ( )

execute command

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

References $cmd.

1013  {
1014  global $tree;
1015 
1016  $cmd = $this->ctrl->getCmd();
1017 
1018  switch ($this->ctrl->getNextClass($this))
1019  {
1020 
1021  default:
1022  if(!$cmd = $this->ctrl->getCmd())
1023  {
1024  $cmd = 'showPersonalData';
1025  }
1026  $this->$cmd();
1027  break;
1028  }
1029  }
$cmd
Definition: sahs_server.php:35

◆ getCreditCard()

ilPurchaseBMFGUI::getCreditCard ( )

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

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

785  {
786  if ($_POST["card_holder"] == "" ||
787  $_POST["card_number"]["block_1"] == "" ||
788  $_POST["card_number"]["block_2"] == "" ||
789  $_POST["card_number"]["block_3"] == "" ||
790  $_POST["card_number"]["block_4"] == "" ||
791  $_POST["validity"]["month"] == "" ||
792  $_POST["validity"]["year"] == "" ||
793  $_POST["validity"]["year"]."-".$_POST["validity"]["month"] < date("Y-m"))
794  {
795  $this->error = $this->lng->txt('pay_bmf_credit_card_not_valid');
796  ilUtil::sendInfo($this->error);
797  $this->showCreditCard();
798  return;
799  }
800  if ($_POST["terms_conditions"] != 1)
801  {
802  $this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
803  ilUtil::sendInfo($this->error);
804  $this->showCreditCard();
805  return;
806  }
807  if ($_POST["password"] == "" ||
808  md5($_POST["password"]) != $this->user_obj->getPasswd())
809  {
810  $this->error = $this->lng->txt('pay_bmf_password_not_valid');
811  ilUtil::sendInfo($this->error);
812  $this->showCreditCard();
813  return;
814  }
815 
816  $_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] = $_POST["validity"]["month"];
817  $_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] = $_POST["validity"]["year"];
818  $_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_POST["card_holder"];
819  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_1"] = $_POST["card_number"]["block_1"];
820  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_2"] = $_POST["card_number"]["block_2"];
821  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_3"] = $_POST["card_number"]["block_3"];
822  $_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_4"] = $_POST["card_number"]["block_4"];
823  $_SESSION["bmf"]["credit_card"]["kartenpruefnummer"] = $_POST["check_number"];
824  # zum testen
825  $this->error = "";
826  $this->sendCreditCard();
827  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getDebitEntry()

ilPurchaseBMFGUI::getDebitEntry ( )

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

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

371  {
372  if ($_POST["account_holder"] == "" ||
373  $_POST["bank_code"] == "" ||
374  $_POST["account_number"] == "")
375  {
376  $this->error = $this->lng->txt('pay_bmf_debit_entry_not_valid');
377  ilUtil::sendInfo($this->error);
378  $this->showDebitEntry();
379  return;
380  }
381  if ($_POST["terms_conditions"] != 1)
382  {
383  $this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
384  ilUtil::sendInfo($this->error);
385  $this->showDebitEntry();
386  return;
387  }
388  if ($_POST["password"] == "" ||
389  md5($_POST["password"]) != $this->user_obj->getPasswd())
390  {
391  $this->error = $this->lng->txt('pay_bmf_password_not_valid');
392  ilUtil::sendInfo($this->error);
393  $this->showDebitEntry();
394  return;
395  }
396 
397  $_SESSION["bmf"]["debit_entry"]["BLZ"] = $_POST["bank_code"];
398  $_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_POST["account_holder"];
399  $_SESSION["bmf"]["debit_entry"]["kontoNr"] = $_POST["account_number"];
400 
401  $this->error = "";
402  $this->sendDebitEntry();
403  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getPaymentType()

ilPurchaseBMFGUI::getPaymentType ( )

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

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

257  {
258  if (($_POST["payment_type"] != "credit_card" && $_POST["payment_type"] != "debit_entry") ||
259  ($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] == "debit_entry"))
260  {
261  $this->error = $this->lng->txt('pay_bmf_payment_type_not_valid');
262  ilUtil::sendInfo($this->error);
263  $this->showPaymentType();
264  return;
265  }
266 
267  $_SESSION["bmf"]["payment_type"] = $_POST["payment_type"];
268 
269  $this->error = "";
270  if ($_SESSION["bmf"]["payment_type"] == "credit_card")
271  {
272  $this->showCreditCard();
273  }
274  else
275  {
276  $this->showDebitEntry();
277  }
278  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getPersonalData()

ilPurchaseBMFGUI::getPersonalData ( )

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

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

140  {
141 
142  if ($_SESSION["bmf"]["personal_data"]["firstname"] == "" ||
143  $_SESSION["bmf"]["personal_data"]["lastname"] == "" ||
144  $_POST["zipcode"] == "" ||
145  $_POST["city"] == "" ||
146  $_POST["country"] == "" ||
147  $_SESSION["bmf"]["personal_data"]["email"] == "")
148  {
149  $this->error = $this->lng->txt('pay_bmf_personal_data_not_valid');
150  ilUtil::sendInfo($this->error);
151  $this->showPersonalData();
152  return;
153  }
154  if (($_POST["street"] == "" && $_POST["house_number"] == "" && $_POST["po_box"] == "") ||
155  (($_POST["street"] != "" || $_POST["house_number"] != "") && $_POST["po_box"] != "") ||
156  ($_POST["street"] != "" && $_POST["house_number"] == "") ||
157  ($_POST["street"] == "" && $_POST["house_number"] != ""))
158  {
159  $this->error = $this->lng->txt('pay_bmf_street_or_pobox');
160  ilUtil::sendInfo($this->error);
161  $this->showPersonalData();
162  return;
163  }
164 
165 
166  $_SESSION["bmf"]["personal_data"]["firstname"] = $this->user_obj->getFirstname();
167  $_SESSION["bmf"]["personal_data"]["lastname"] = $this->user_obj->getLastname();
168  $_SESSION["bmf"]["personal_data"]["street"] = $_POST["street"];
169  $_SESSION["bmf"]["personal_data"]["house_number"] = $_POST["house_number"];
170  $_SESSION["bmf"]["personal_data"]["po_box"] = $_POST["po_box"];
171  $_SESSION["bmf"]["personal_data"]["zipcode"] = $_POST["zipcode"];
172  $_SESSION["bmf"]["personal_data"]["city"] = $_POST["city"];
173  $_SESSION["bmf"]["personal_data"]["country"] = $_POST["country"];
174  $_SESSION["bmf"]["personal_data"]["email"] = $this->user_obj->getEmail();
175  $_SESSION["bmf"]["personal_data"]["language"] = $this->user_obj->getLanguage();
176 
177  if ($_SESSION["bmf"]["personal_data"]["country"] != "DE")
178  {
179  if ($_SESSION["bmf"]["payment_type"] == "debit_entry")
180  {
181  $_SESSION["bmf"]["payment_type"] = "";
182  }
183  }
184 
185  $this->error = "";
186  $this->showPaymentType();
187  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ ilPurchaseBMFGUI()

ilPurchaseBMFGUI::ilPurchaseBMFGUI (   $user_obj)

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

References $user_obj, and ilPayMethods\_getIdByTitle().

43  {
44  $this->pm_id = ilPayMethods::_getIdByTitle('bmf');
45  $this->pay_method = ilPayMethods::_getIdByTitle('bmf');
46  // Get user object
47  $this->user_obj = $user_obj;
48 
49  parent::__construct($this->user_obj, $this->pay_method);
50  }
static _getIdByTitle($a_pm_title)
+ Here is the call graph for this function:

◆ sendCreditCard()

ilPurchaseBMFGUI::sendCreditCard ( )

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

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

Referenced by getCreditCard().

830  {
831  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
832 
833  $this->psc_obj->clearCouponItemsSession();
834 
835  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
836  {
837 
838  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
839  $this->tpl->touchBlock("stop_floating");
840  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
841 
842  }
843  else
844  {
845  $payment = new KreditkartenzahlungWS();
846 
847  $customer = new Kunde($this->user_obj->getId());
848 
849  $creditCard = new Kreditkarte();
850 
851  $sc_obj = new ilPaymentShoppingCart($this->user_obj);
852 
853  $tmp_bookEntries = $sc_obj->getShoppingCart();
854  if (!is_array($tmp_bookEntries))
855  {
856  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
857  }
858  else
859  {
860  $totalAmount = 0;
861  for ($i = 0; $i < count($tmp_bookEntries); $i++)
862  {
863  $booking = true;
864 
865  if (!empty($_SESSION["coupons"]["bmf"]))
866  {
867  $price = $tmp_bookEntries[$i]["price"];
868  $tmp_bookEntries[$i]["math_price"] = $price;
869 
870  foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
871  {
872  $this->coupon_obj->setId($coupon["pc_pk"]);
873  $this->coupon_obj->setCurrentCoupon($coupon);
874 
875  $tmp_pobject = new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
876 
877  if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
878  {
879  $_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $price;
880  $_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
881 
882  $booking = false;
883  }
884 
885  unset($tmp_pobject);
886  }
887  }
888 
889  if ($booking)
890  {
891  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
892 
893  $bookEntries[] = new Buchung($tmp_bookEntries[$i]);
894  $totalAmount += $tmp_bookEntries[$i]["price"];
895  }
896  else
897  {
898  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
899  }
900  }
901 
902  $coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
903 
904  if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
905  {
906  foreach ($coupon_discount_items as $item)
907  {
908  $item["price"] = number_format((float)$item["discount_price"] , 2, ".", "");
909  $bookEntries[] = new Buchung($item);
910  $totalAmount += $item["discount_price"];
911  }
912  }
913 
914  $totalAmount = number_format((float)$totalAmount , 2, ".", "");
915  $values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
916  $bookingList = new BuchungsListe($this->user_obj->getId(), $values);
917  }
918 
919  $resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
920  $result = $resultObj->ergebnis;
921 
922  if (is_object($result))
923  {
924  if ($result->code < 0)
925  {
926  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
927  $this->tpl->touchBlock("stop_floating");
928  $error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
929  if ($result->code == -103 ||
930  $result->code == -104 ||
931  $result->code == -107 ||
932  ($result->code <= -202 && $result->code >= -208) ||
933  $result->code == -213)
934  {
936  $this->showPersonalData();
937  }
938  else if ($result->code == -507 ||
939  $result->code == -510 ||
940  $result->code == -511)
941  {
943  $this->showPaymentType();
944  }
945  else if ($result->code == -701 ||
946  $result->code == -1701 ||
947  $result->code == -1706 ||
948  $result->code == -1707 ||
949  $result->code == -1710 ||
950  $result->code == -1711)
951  {
953  $this->showCreditCard();
954  }
955  else
956  {
957  $error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
959  $this->showPersonalData();
960  }
961  }
962  else
963  {
964  // everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
965  $external_data = array();
966  $external_data['voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
967  $external_data['transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
968  $external_data['street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
969  $external_data['po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
970  $external_data['zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
971  $external_data['city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
972  $external_data['country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
973 
974  parent::__addbookings($external_data);
975 
976  $this->__emptyShoppingCart();
977  $this->__clearSession();
978 
979  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
980  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
981  $this->tpl->touchBlock("stop_floating");
982 
983  ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
984 
985  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','Services/Payment');
986 
987  if ($this->ilias->getSetting("https") != 1)
988  {
989  $this->tpl->setCurrentBlock("buyed_objects");
990  $link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
991  $this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
992  $this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
993  $this->tpl->parseCurrentBlock("buyed_objects");
994  }
995  $this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
996  }
997  }
998  else
999  {
1000  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
1001  $this->tpl->touchBlock("stop_floating");
1002  ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
1003  }
1004  #zum testen
1005  }
1006 
1007  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendDebitEntry()

ilPurchaseBMFGUI::sendDebitEntry ( )

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

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

Referenced by getDebitEntry().

406  {
407  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
408 
409  $this->psc_obj->clearCouponItemsSession();
410 
411  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
412  {
413 
414  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
415  $this->tpl->touchBlock("stop_floating");
416  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
417 
418  }
419  else
420  {
421  $customer = new KundenstammdatenPflegeWS();
422 
423  $newCustomer = new Kunde($this->user_obj->getId());
424 
425  $resultCustomerObj = $customer->anlegenKunde($newCustomer);
426 
427  $resultCustomer = $resultCustomerObj->ergebnis;
428 
429  if (is_object($resultCustomer))
430  {
431  if ($resultCustomer->code < 0)
432  {
433  $error = $this->lng->txt('pay_bmf_server_error_code') . " " . $resultCustomer->code . ": " . $resultCustomer->kurzText . "<br>\n" . $resultCustomer->langText;
434  if ($resultCustomer->code == -103 ||
435  $resultCustomer->code == -104 ||
436  $resultCustomer->code == -107 ||
437  ($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
438  $resultCustomer->code == -213)
439  {
441  $this->showPersonalData();
442  }
443  else
444  {
445  $error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
447  $this->showPersonalData();
448  }
449  }
450  else
451  {
452  $payment = new LastschriftWS();
453 
454  $debitEntry = new Lastschrift();
455 
456  $address = new LieferAdresse();
457 
458  $bank = new Bankverbindung();
459 
460  $sc_obj = new ilPaymentShoppingCart($this->user_obj);
461 
462  $tmp_bookEntries = $sc_obj->getShoppingCart();
463 
464  if (!is_array($tmp_bookEntries))
465  {
466  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
467  }
468  else
469  {
470  $totalAmount = 0;
471  for ($i = 0; $i < count($tmp_bookEntries); $i++)
472  {
473  $booking = true;
474 
475  if (!empty($_SESSION["coupons"]["bmf"]))
476  {
477  $price = $tmp_bookEntries[$i]["price"];
478  $tmp_bookEntries[$i]["math_price"] = $price;
479 
480  foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
481  {
482  $this->coupon_obj->setId($coupon["pc_pk"]);
483  $this->coupon_obj->setCurrentCoupon($coupon);
484 
485  $tmp_pobject = new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
486 
487  if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
488  {
489  $_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $price;
490  $_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
491  $booking = false;
492  }
493 
494  unset($tmp_pobject);
495  }
496  }
497 
498  if ($booking)
499  {
500  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ".", "");
501  $bookEntries[] = new Buchung($tmp_bookEntries[$i]);
502  $totalAmount += $tmp_bookEntries[$i]["price"];
503  }
504  else
505  {
506  $tmp_bookEntries[$i]["price_string"] = number_format( (float) $tmp_bookEntries[$i]["price"] , 2, ",", ".");
507  }
508  }
509 
510  $coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
511 
512  if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
513  {
514  foreach ($coupon_discount_items as $item)
515  {
516  $item["price"]= number_format( (float) $item["discount_price"], 2, ".", "");
517  $bookEntries[] = new Buchung($item);
518  $totalAmount += $item["price"];
519  }
520  }
521 
522  $totalAmount = number_format( (float) $totalAmount , 2, ".", "");
523  $values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
524  $bookingList = new BuchungsListe($this->user_obj->getId(), $values);
525  }
526 
527 
528 
529  $resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr, $address, $bank, $bookingList);
530  $result = $resultObj->ergebnis;
531 
532  if (is_object($result))
533  {
534  if ($result->code < 0)
535  {
536  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
537  $this->tpl->touchBlock("stop_floating");
538  $error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
539  if ($result->code == -103 ||
540  $result->code == -104 ||
541  $result->code == -107 ||
542  ($result->code <= -202 && $result->code >= -208) ||
543  $result->code == -213)
544  {
546  $this->showPersonalData();
547  }
548  else if ($result->code == -507 ||
549  $result->code == -510 ||
550  $result->code == -511)
551  {
553  $this->showPaymentType();
554  }
555  else if ($result->code == -402 ||
556  $result->code == -402 ||
557  $result->code == -403 ||
558  $result->code == -406 ||
559  $result->code == -410 ||
560  $result->code == -413 ||
561  $result->code == -701 ||
562  $result->code == -702 ||
563  $result->code == -703)
564  {
566  $this->showDebitEntry();
567  }
568  else
569  {
570  $error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
572  $this->showPersonalData();
573  }
574 
575  }
576  else
577  {
578  $resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
579  $resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
580  $resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
581  $resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
582  $resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
583  $resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
584  $resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
585  $resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
586 
587  // everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
588  $external_data = array();
589  $external_data['voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
590  $external_data['transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
591  $external_data['street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
592  $external_data['po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
593  $external_data['zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
594  $external_data['city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
595  $external_data['country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
596 
597  parent::__addbookings($external_data);
598 
599  $this->__emptyShoppingCart();
600  $this->__clearSession();
601 
602  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
603  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
604  $this->tpl->touchBlock("stop_floating");
605 
606  ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
607 
608  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','Services/Payment');
609 
610  if ($this->ilias->getSetting("https") != 1)
611  {
612  $this->tpl->setCurrentBlock("buyed_objects");
613  $link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
614  $this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
615  $this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
616  $this->tpl->parseCurrentBlock("buyed_objects");
617  }
618  $this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
619  }
620  }
621  else
622  {
623  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
624  $this->tpl->touchBlock("stop_floating");
625  ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
626  }
627  }
628  }
629  else
630  {
631  $this->tpl->setVariable("HEADER",$this->lng->txt('error'));
632  $this->tpl->touchBlock("stop_floating");
633  ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
634  }
635  }
636  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCreditCard()

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().

639  {
640  // user_id $this->user_obj->getId()
641  // all
642 
643 /* if ($_SESSION["bmf"]["credit_card"]["karteninhaber"] == "" &&
644  $this->error == "" &&
645  $_POST["card_holder"] == "")
646  {
647  $_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
648  }*/
649 
650  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
651 
652  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
653  {
654 
655  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
656  $this->tpl->touchBlock("stop_floating");
657  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
658 
659  }
660  else
661  {
662 
663  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','Services/Payment');
664  $this->__showShoppingCart();
665 
666  $this->tpl->setVariable("CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
667 
668  // set table header
669  $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.png'));
670  $this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
671  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_credit_card'));
672  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_credit_card_data'));
673  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_credit_card'));
674  $this->tpl->touchBlock("stop_floating");
675  $this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
676 
677  // set plain text variables
678  $this->tpl->setVariable("TXT_CARD_HOLDER",$this->lng->txt('pay_bmf_card_holder'));
679  $this->tpl->setVariable("TXT_CHECK_NUMBER",$this->lng->txt('pay_bmf_check_number'));
680  $this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
681  $this->tpl->setVariable("TXT_CARD_NUMBER",$this->lng->txt('pay_bmf_card_number'));
682  $this->tpl->setVariable("TXT_VALIDITY",$this->lng->txt('pay_bmf_validity'));
683  $this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
684  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
685  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
686  $this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
687  $this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
688  $this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
689 
690  $this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
691  $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
692 
693  // fill defaults
694 
695  $this->tpl->setVariable("CARD_HOLDER",
696  $this->error != "" && isset($_POST['card_holder'])
697  ? ilUtil::prepareFormOutput($_POST['card_holder'],true)
698  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['karteninhaber'],true));
699  $this->tpl->setVariable("CARD_NUMBER_BLOCK_1",
700  $this->error != "" && isset($_POST['card_number']['block_1'])
701  ? ilUtil::prepareFormOutput($_POST['card_number']['block_1'],true)
702  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_1'],true));
703  $this->tpl->setVariable("CARD_NUMBER_BLOCK_2",
704  $this->error != "" && isset($_POST['card_number']['block_2'])
705  ? ilUtil::prepareFormOutput($_POST['card_number']['block_2'],true)
706  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_2'],true));
707  $this->tpl->setVariable("CARD_NUMBER_BLOCK_3",
708  $this->error != "" && isset($_POST['card_number']['block_3'])
709  ? ilUtil::prepareFormOutput($_POST['card_number']['block_3'],true)
710  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_3'],true));
711  $this->tpl->setVariable("CARD_NUMBER_BLOCK_4",
712  $this->error != "" && isset($_POST['card_number']['block_4'])
713  ? ilUtil::prepareFormOutput($_POST['card_number']['block_4'],true)
714  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_4'],true));
715  $this->tpl->setVariable("CHECK_NUMBER",
716  $this->error != "" && isset($_POST['check_number'])
717  ? ilUtil::prepareFormOutput($_POST['check_number'],true)
718  : ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kartenpruefnummer'],true));
719  for ($i = 1; $i <= 12; $i++)
720  {
721  $this->tpl->setCurrentBlock("loop_validity_months");
722  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS", $i < 10 ? "0" . $i : $i);
723  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS_TXT", $i < 10 ? "0" . $i : $i);
724  if ($this->error != "" &&
725  isset($_POST['validity']['month']))
726  {
727  if ($_POST['validity']['month'] == $i)
728  {
729  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
730  }
731  }
732  else
733  {
734  if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] == $i)
735  {
736  $this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
737  }
738  }
739  $this->tpl->parseCurrentBlock("loop_validity_months");
740  }
741  for ($i = date("Y"); $i <= (date("Y")+6); $i++)
742  {
743  $this->tpl->setCurrentBlock("loop_validity_years");
744  $this->tpl->setVariable("LOOP_VALIDITY_YEARS", $i);
745  $this->tpl->setVariable("LOOP_VALIDITY_YEARS_TXT", $i);
746  if ($this->error != "" &&
747  isset($_POST['validity']['year']))
748  {
749  if ($_POST['validity']['year'] == $i)
750  {
751  $this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
752  }
753  }
754  else
755  {
756  if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] == $i)
757  {
758  $this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
759  }
760  }
761  $this->tpl->parseCurrentBlock("loop_validity_years");
762  }
763 /* if ($this->error != "" &&
764  isset($_POST["terms_conditions"]))
765  {
766  $this->tpl->setVariable("TERMS_CONDITIONS_" . $_POST["terms_conditions"], " checked") ;
767  }*/
768 /* if ($this->error != "" &&
769  isset($_POST["password"]))
770  {
771  $this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
772  }*/
773 
774  // Button
775  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
776  $this->tpl->setCurrentBlock("btn_cell");
777  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
778  $this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
779  $this->tpl->parseCurrentBlock("btn_cell");
780 
781  }
782  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDebitEntry()

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().

281  {
282  // user_id $this->user_obj->getId()
283  // all
284 
285 /* if ($_SESSION["bmf"]["debit_entry"]["kontoinhaber"] == "" &&
286  $this->error == "" &&
287  $_POST["account_holder"] == "")
288  {
289  $_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
290  }*/
291 
292  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
293 
294  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
295  {
296 
297  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
298  $this->tpl->touchBlock("stop_floating");
299  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
300 
301  }
302  else
303  {
304 
305  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','Services/Payment');
306 
307  $this->__showShoppingCart();
308 
309  $this->tpl->setVariable("DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
310 
311  // set table header
312  $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.png'));
313  $this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
314  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_debit_entry'));
315  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_debit_entry_data'));
316  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_debit_entry'));
317  $this->tpl->touchBlock("stop_floating");
318  $this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
319 
320  // set plain text variables
321  $this->tpl->setVariable("TXT_ACCOUNT_HOLDER",$this->lng->txt('pay_bmf_account_holder'));
322  $this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
323  $this->tpl->setVariable("TXT_BANK_CODE",$this->lng->txt('pay_bmf_bank_code'));
324  $this->tpl->setVariable("TXT_ACCOUNT_NUMBER",$this->lng->txt('pay_bmf_account_number'));
325  $this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
326  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
327  $this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
328  $this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
329  $this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
330  $this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
331 
332  $this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
333  $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
334 
335  // fill defaults
336 
337  $this->tpl->setVariable("ACCOUNT_HOLDER",
338  $this->error != "" && isset($_POST['account_holder'])
339  ? ilUtil::prepareFormOutput($_POST['account_holder'],true)
340  : ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoinhaber'],true));
341  $this->tpl->setVariable("BANK_CODE",
342  $this->error != "" && isset($_POST['bank_code'])
343  ? ilUtil::prepareFormOutput($_POST['bank_code'],true)
344  : ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['BLZ'],true));
345  $this->tpl->setVariable("ACCOUNT_NUMBER",
346  $this->error != "" && isset($_POST['account_number'])
347  ? ilUtil::prepareFormOutput($_POST['account_number'],true)
348  : ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoNr'],true));
349 /* if ($this->error != "" &&
350  isset($_POST["terms_conditions"]))
351  {
352  $this->tpl->setVariable("TERMS_CONDITIONS_" . strtoupper($_POST["terms_conditions"]), " checked") ;
353  }*/
354 /* if ($this->error != "" &&
355  isset($_POST["password"]))
356  {
357  $this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
358  }*/
359 
360  // Button
361  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
362  $this->tpl->setCurrentBlock("btn_cell");
363  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
364  $this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
365  $this->tpl->parseCurrentBlock("btn_cell");
366 
367  }
368  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPaymentType()

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().

190  {
191  // user_id $this->user_obj->getId()
192  // all
193 
194  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
195 
196  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
197  {
198 
199  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
200  $this->tpl->touchBlock("stop_floating");
201  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
202 
203  }
204  else
205  {
206 
207  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_payment_type.html','Services/Payment');
208 
209  $this->tpl->setVariable("PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
210 
211  // set table header
212  $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.png'));
213  $this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
214  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step2'));
215  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_payment_type'));
216  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_payment_type'));
217  $this->tpl->touchBlock("stop_floating");
218  $this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
219 
220  // set plain text variables
221  if ($_SESSION["bmf"]["personal_data"]["country"] == "DE")
222  {
223  $this->tpl->setVariable("TXT_DEBIT_ENTRY",$this->lng->txt('pay_bmf_debit_entry'));
224  }
225  $this->tpl->setVariable("TXT_CREDIT_CARD",$this->lng->txt('pay_bmf_credit_card'));
226 
227  $this->tpl->setVariable("INPUT_VALUE",ucfirst($this->lng->txt('next')));
228  $this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
229 
230  // fill defaults
231 
232  if ($this->error != "" &&
233  isset($_POST["payment_type"]))
234  {
235  $this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_POST["payment_type"]), " checked") ;
236  }
237  else
238  {
239  if (($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] != "debit_entry") ||
240  $_SESSION["bmf"]["personal_data"]["country"] == "DE")
241  {
242  $this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_SESSION["bmf"]["payment_type"]), " checked") ;
243  }
244  }
245 
246  // Button
247  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
248  $this->tpl->setCurrentBlock("btn_cell");
249  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPersonalData"));
250  $this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
251  $this->tpl->parseCurrentBlock("btn_cell");
252 
253  }
254  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPersonalData()

ilPurchaseBMFGUI::showPersonalData ( )

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().

58  {
59  // user_id $this->user_obj->getId()
60  // all
61 
62  $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
63 
64  if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
65  {
66 
67  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
68  $this->tpl->touchBlock("stop_floating");
69  ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
70 
71  }
72  else
73  {
74  $this->tpl->setVariable("HEADER",$this->lng->txt('pay_step1'));
75  $this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_personal_data'));
76  $this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_personal_data'));
77 
78  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
79 
80  $oForm = new ilPropertyFormGUI();
81  $oForm->setFormAction($this->ctrl->getFormAction($this, 'getPersonalData'));
82  $oForm->setTitle($this->lng->txt('pay_bmf_personal_data'));
83 
84  $oFirstname = new ilNonEditableValueGUI($this->lng->txt('firstname'));
85  $oFirstname->setValue($this->user_obj->getFirstname());
86  $oForm->addItem($oFirstname);
87 
88  $oLastname = new ilNonEditableValueGUI($this->lng->txt('lastname'));
89  $oLastname->setValue($this->user_obj->getLastname());
90  $oForm->addItem($oLastname);
91 
92  $oStreet = new ilTextInputGUI($this->lng->txt('street'),'street');
93  $oStreet->setValue($this->error != '' && isset($_POST['street'])
94  ? ilUtil::prepareFormOutput($_POST['street'],true)
95  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['street'],true));
96  $oForm->addItem($oStreet);
97 
98  $oHouseNumber = new ilTextInputGUI($this->lng->txt('pay_bmf_house_number'), 'house_number');
99  $oHouseNumber->setValue($this->error != '' && isset($_POST['house_number'])
100  ? ilUtil::prepareFormOutput($_POST['house_number'],true)
101  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['house_number'],true));
102  $oForm->addItem($oHouseNumber);
103 
104  $oPoBox = new ilTextInputGUI($this->lng->txt('pay_bmf_or').' '.$this->lng->txt('pay_bmf_po_box'), 'po_box');
105  $oPoBox->setValue($this->error != '' && isset($_POST['po_box'])
106  ? ilUtil::prepareFormOutput($_POST['po_box'],true)
107  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['po_box'],true));
108  $oForm->addItem($oPoBox);
109 
110  $oZipCode = new ilTextInputGUI($this->lng->txt('zipcode'), 'zipcode');
111  $oZipCode->setValue($this->error != '' && isset($_POST['zipcode'])
112  ? ilUtil::prepareFormOutput($_POST['zipcode'],true)
113  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['zipcode'],true));
114  $oForm->addItem($oZipCode);
115 
116  $oCity = new ilTextInputGUI($this->lng->txt('city'), 'city');
117  $oCity->setValue($this->error != '' && isset($_POST['city'])
118  ? ilUtil::prepareFormOutput($_POST['city'],true)
119  : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['city'],true));
120  $oForm->addItem($oCity);
121 
122 
123  $oCountry = new ilSelectInputGUI($this->lng->txt('country'), 'country');
124  $oCountry->setOptions($this->__getCountries());
125  $oCountry->setValue($this->error != '' && isset($_POST['country']) ? $_POST['country']
126  : $_SESSION['bmf']['personal_data']['country']);
127  $oForm->addItem($oCountry);
128 
129  $oEmail = new ilNonEditableValueGUI($this->lng->txt('email'));
130  $oEmail->setValue($this->user_obj->getEmail());
131  $oForm->addItem($oEmail);
132 
133  $oForm->addcommandButton('getPersonalData',ucfirst($this->lng->txt('next')));
134  $this->tpl->setVariable('FORM',$oForm->getHTML());
135 
136  }
137  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
This class represents a selection list property in a property form.
This class represents a property form user interface.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
This class represents a non editable value in a property form.
setValue($a_value)
Set Value.
__getCountries()
shows select box f�r countries
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $coupon_obj

ilPurchaseBMFGUI::$coupon_obj = null

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

◆ $ctrl

ilPurchaseBMFGUI::$ctrl

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

◆ $error

ilPurchaseBMFGUI::$error

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

◆ $pay_method

ilPurchaseBMFGUI::$pay_method = null

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

◆ $pm_id

ilPurchaseBMFGUI::$pm_id = 0
private

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

◆ $shoppingCart

ilPurchaseBMFGUI::$shoppingCart

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

◆ $soapClient

ilPurchaseBMFGUI::$soapClient

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

◆ $totalVat

ilPurchaseBMFGUI::$totalVat = 0
private

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

◆ $tpl

ilPurchaseBMFGUI::$tpl

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

◆ $user_obj

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: