32 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
33 include_once
'./payment/classes/class.ilPaymentShoppingCartGUI.php';
34 include_once
'./payment/classes/class.ilPaymentCoupons.php';
35 include_once
'./payment/classes/class.ilBMFSettings.php';
36 #include_once dirname(__FILE__)."/../bmf/lib/ePayment/cfg_epayment.inc.php";
37 include_once dirname(__FILE__).
"/../bmf/lib/SOAP/class.ilBMFClient.php";
54 $this->ilias = $ilias;
65 if (!is_array(
$_SESSION[
"bmf"][
"personal_data"]))
67 $_SESSION[
"bmf"][
"personal_data"][
"vorname"] = $this->user_obj->getFirstname();
68 $_SESSION[
"bmf"][
"personal_data"][
"nachname"] = $this->user_obj->getLastname();
69 if (strpos(
"_" . $this->user_obj->getStreet(),
" ") > 0)
71 $houseNo = substr($this->user_obj->getStreet(), strrpos($this->user_obj->getStreet(),
" ")+1);
72 $street = substr($this->user_obj->getStreet(), 0, strlen($this->user_obj->getStreet())-(strlen($houseNo)+1));
73 $_SESSION[
"bmf"][
"personal_data"][
"strasse"] = $street;
74 $_SESSION[
"bmf"][
"personal_data"][
"hausNr"] = $houseNo;
78 $_SESSION[
"bmf"][
"personal_data"][
"strasse"] = $this->user_obj->getStreet();
79 $_SESSION[
"bmf"][
"personal_data"][
"hausNr"] =
"";
81 $_SESSION[
"bmf"][
"personal_data"][
"postfach"] =
"";
82 $_SESSION[
"bmf"][
"personal_data"][
"PLZ"] = $this->user_obj->getZipcode();
83 $_SESSION[
"bmf"][
"personal_data"][
"ort"] = $this->user_obj->getCity();
85 $_SESSION[
"bmf"][
"personal_data"][
"EMailAdresse"] = $this->user_obj->getEmail();
86 $_SESSION[
"bmf"][
"personal_data"][
"sprache"] = $this->user_obj->getLanguage();
89 if (!is_array(
$_SESSION[
"coupons"][
"bmf"]))
98 $this->lng->loadLanguageModule(
"payment");
100 $ilTabs->clearTargets();
101 $ilTabs->clearSubTabs();
119 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
120 $this->tpl->touchBlock(
"stop_floating");
127 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_personal_data.html',
'payment');
128 #$this->tpl = new ilTemplate('tpl.pay_bmf_personal_data.html', true, true, 'payment');
130 $this->tpl->setVariable(
"PERSONAL_DATA_FORMACTION",$this->ctrl->getFormAction($this));
134 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
135 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step1'));
136 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_personal_data'));
137 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_personal_data'));
138 $this->tpl->touchBlock(
"stop_floating");
139 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
142 $this->tpl->setVariable(
"TXT_FIRSTNAME",$this->lng->txt(
'firstname'));
143 $this->tpl->setVariable(
"TXT_LASTNAME",$this->lng->txt(
'lastname'));
144 $this->tpl->setVariable(
"TXT_STREET",$this->lng->txt(
'street'));
145 $this->tpl->setVariable(
"TXT_HOUSE_NUMBER",$this->lng->txt(
'pay_bmf_house_number'));
146 $this->tpl->setVariable(
"TXT_OR",$this->lng->txt(
'pay_bmf_or'));
147 $this->tpl->setVariable(
"TXT_PO_BOX",$this->lng->txt(
'pay_bmf_po_box'));
148 $this->tpl->setVariable(
"TXT_ZIPCODE",$this->lng->txt(
'zipcode'));
149 $this->tpl->setVariable(
"TXT_CITY",$this->lng->txt(
'city'));
150 $this->tpl->setVariable(
"TXT_COUNTRY",$this->lng->txt(
'country'));
151 $this->tpl->setVariable(
"TXT_EMAIL",$this->lng->txt(
'email'));
153 $this->tpl->setVariable(
"INPUT_VALUE",ucfirst($this->lng->txt(
'next')));
154 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
167 $this->tpl->setVariable(
"FIRSTNAME", $this->user_obj->getFirstname());
168 $this->tpl->setVariable(
"LASTNAME", $this->user_obj->getLastname());
169 $this->tpl->setVariable(
"STREET",
170 $this->error !=
"" && isset($_POST[
'street'])
173 $this->tpl->setVariable(
"HOUSE_NUMBER",
174 $this->error !=
"" && isset($_POST[
'house_number'])
177 $this->tpl->setVariable(
"PO_BOX",
178 $this->error !=
"" && isset($_POST[
'po_box'])
181 $this->tpl->setVariable(
"ZIPCODE",
182 $this->error !=
"" && isset($_POST[
'zipcode'])
185 $this->tpl->setVariable(
"CITY",
186 $this->error !=
"" && isset($_POST[
'city'])
193 $this->tpl->setVariable(
"EMAIL", $this->user_obj->getEmail());
202 if (
$_SESSION[
"bmf"][
"personal_data"][
"vorname"] ==
"" ||
203 $_SESSION[
"bmf"][
"personal_data"][
"nachname"] ==
"" ||
204 $_POST[
"zipcode"] ==
"" ||
205 $_POST[
"city"] ==
"" ||
206 $_POST[
"country"] ==
"" ||
208 $_SESSION[
"bmf"][
"personal_data"][
"EMailAdresse"] ==
"")
210 $this->error = $this->lng->txt(
'pay_bmf_personal_data_not_valid');
215 if (($_POST[
"street"] ==
"" && $_POST[
"house_number"] ==
"" && $_POST[
"po_box"] ==
"") ||
216 (($_POST[
"street"] !=
"" || $_POST[
"house_number"] !=
"") && $_POST[
"po_box"] !=
"") ||
217 ($_POST[
"street"] !=
"" && $_POST[
"house_number"] ==
"") ||
218 ($_POST[
"street"] ==
"" && $_POST[
"house_number"] !=
""))
220 $this->error = $this->lng->txt(
'pay_bmf_street_or_pobox');
228 $_SESSION[
"bmf"][
"personal_data"][
"vorname"] = $this->user_obj->getFirstname();
229 $_SESSION[
"bmf"][
"personal_data"][
"nachname"] = $this->user_obj->getLastname();
230 $_SESSION[
"bmf"][
"personal_data"][
"strasse"] = $_POST[
"street"];
231 $_SESSION[
"bmf"][
"personal_data"][
"hausNr"] = $_POST[
"house_number"];
232 $_SESSION[
"bmf"][
"personal_data"][
"postfach"] = $_POST[
"po_box"];
233 $_SESSION[
"bmf"][
"personal_data"][
"PLZ"] = $_POST[
"zipcode"];
234 $_SESSION[
"bmf"][
"personal_data"][
"ort"] = $_POST[
"city"];
235 $_SESSION[
"bmf"][
"personal_data"][
"land"] = $_POST[
"country"];
237 $_SESSION[
"bmf"][
"personal_data"][
"EmailAdresse"] = $this->user_obj->getEmail();
238 $_SESSION[
"bmf"][
"personal_data"][
"sprache"] = $this->user_obj->getLanguage();
240 if (
$_SESSION[
"bmf"][
"personal_data"][
"land"] !=
"DE")
242 if (
$_SESSION[
"bmf"][
"payment_type"] ==
"debit_entry")
262 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
263 $this->tpl->touchBlock(
"stop_floating");
270 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_payment_type.html',
'payment');
271 #$this->tpl = new ilTemplate('tpl.pay_bmf_payment_type.html', true, true, 'payment');
273 $this->tpl->setVariable(
"PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
277 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
278 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step2'));
279 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_payment_type'));
280 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_payment_type'));
281 $this->tpl->touchBlock(
"stop_floating");
282 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
285 if (
$_SESSION[
"bmf"][
"personal_data"][
"land"] ==
"DE")
287 $this->tpl->setVariable(
"TXT_DEBIT_ENTRY",$this->lng->txt(
'pay_bmf_debit_entry'));
289 $this->tpl->setVariable(
"TXT_CREDIT_CARD",$this->lng->txt(
'pay_bmf_credit_card'));
291 $this->tpl->setVariable(
"INPUT_VALUE",ucfirst($this->lng->txt(
'next')));
292 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
296 if ($this->error !=
"" &&
297 isset($_POST[
"payment_type"]))
299 $this->tpl->setVariable(
"PAYMENT_TYPE_" . strtoupper($_POST[
"payment_type"]),
" checked") ;
303 if ((
$_SESSION[
"bmf"][
"personal_data"][
"land"] !=
"DE" && $_POST[
"payment_type"] !=
"debit_entry") ||
304 $_SESSION[
"bmf"][
"personal_data"][
"land"] ==
"DE")
306 $this->tpl->setVariable(
"PAYMENT_TYPE_" . strtoupper(
$_SESSION[
"bmf"][
"payment_type"]),
" checked") ;
311 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
312 $this->tpl->setCurrentBlock(
"btn_cell");
313 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPersonalData"));
314 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
315 $this->tpl->parseCurrentBlock(
"btn_cell");
322 if (($_POST[
"payment_type"] !=
"credit_card" && $_POST[
"payment_type"] !=
"debit_entry") ||
323 (
$_SESSION[
"bmf"][
"personal_data"][
"land"] !=
"DE" && $_POST[
"payment_type"] ==
"debit_entry"))
325 $this->error = $this->lng->txt(
'pay_bmf_payment_type_not_valid');
331 $_SESSION[
"bmf"][
"payment_type"] = $_POST[
"payment_type"];
334 if (
$_SESSION[
"bmf"][
"payment_type"] ==
"credit_card")
361 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
362 $this->tpl->touchBlock(
"stop_floating");
369 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_debit_entry.html',
'payment');
370 #$this->tpl = new ilTemplate('tpl.pay_bmf_debit_entry.html', true, true, 'payment');
374 $this->tpl->setVariable(
"DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
378 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
379 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step3_debit_entry'));
380 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_debit_entry_data'));
381 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_debit_entry'));
382 $this->tpl->touchBlock(
"stop_floating");
383 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
386 $this->tpl->setVariable(
"TXT_ACCOUNT_HOLDER",$this->lng->txt(
'pay_bmf_account_holder'));
387 $this->tpl->setVariable(
"TXT_OPTIONAL",$this->lng->txt(
'pay_bmf_optional'));
388 $this->tpl->setVariable(
"TXT_BANK_CODE",$this->lng->txt(
'pay_bmf_bank_code'));
389 $this->tpl->setVariable(
"TXT_ACCOUNT_NUMBER",$this->lng->txt(
'pay_bmf_account_number'));
390 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS",$this->lng->txt(
'pay_bmf_terms_conditions'));
391 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_READ",$this->lng->txt(
'pay_bmf_terms_conditions_read'));
392 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt(
'pay_bmf_terms_conditions_show'));
393 $this->tpl->setVariable(
"LINK_TERMS_CONDITIONS",
"./payment.php?view=conditions");
394 $this->tpl->setVariable(
"TXT_PASSWORD",$this->lng->txt(
'password'));
395 $this->tpl->setVariable(
"TXT_CONFIRM_ORDER",$this->lng->txt(
'pay_confirm_order'));
397 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_send_order'));
398 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
402 $this->tpl->setVariable(
"ACCOUNT_HOLDER",
403 $this->error !=
"" && isset($_POST[
'account_holder'])
406 $this->tpl->setVariable(
"BANK_CODE",
407 $this->error !=
"" && isset($_POST[
'bank_code'])
410 $this->tpl->setVariable(
"ACCOUNT_NUMBER",
411 $this->error !=
"" && isset($_POST[
'account_number'])
426 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
427 $this->tpl->setCurrentBlock(
"btn_cell");
428 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPaymentType"));
429 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
430 $this->tpl->parseCurrentBlock(
"btn_cell");
437 if ($_POST[
"account_holder"] ==
"" ||
438 $_POST[
"bank_code"] ==
"" ||
439 $_POST[
"account_number"] ==
"")
441 $this->error = $this->lng->txt(
'pay_bmf_debit_entry_not_valid');
446 if ($_POST[
"terms_conditions"] != 1)
448 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
453 if ($_POST[
"password"] ==
"" ||
454 md5($_POST[
"password"]) != $this->user_obj->getPasswd())
456 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
462 $_SESSION[
"bmf"][
"debit_entry"][
"BLZ"] = $_POST[
"bank_code"];
463 $_SESSION[
"bmf"][
"debit_entry"][
"kontoinhaber"] = $_POST[
"account_holder"];
464 $_SESSION[
"bmf"][
"debit_entry"][
"kontoNr"] = $_POST[
"account_number"];
474 $this->psc_obj->clearCouponItemsSession();
479 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
480 $this->tpl->touchBlock(
"stop_floating");
488 $newCustomer =
new Kunde($this->user_obj->getId());
490 $resultCustomerObj = $customer->anlegenKunde($newCustomer);
492 $resultCustomer = $resultCustomerObj->ergebnis;
494 if (is_object($resultCustomer))
496 if ($resultCustomer->code < 0)
498 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " . $resultCustomer->code .
": " . $resultCustomer->kurzText .
"<br>\n" . $resultCustomer->langText;
499 if ($resultCustomer->code == -103 ||
500 $resultCustomer->code == -104 ||
501 $resultCustomer->code == -107 ||
502 ($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
503 $resultCustomer->code == -213)
510 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
527 $tmp_bookEntries = $sc_obj->getShoppingCart();
528 if (!is_array($tmp_bookEntries))
535 for ($i = 0; $i < count($tmp_bookEntries); $i++)
541 $price = $tmp_bookEntries[$i][
"betrag"];
542 $tmp_bookEntries[$i][
"math_price"] = (float) $price;
544 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
546 $this->coupon_obj->setId($coupon[
"pc_pk"]);
547 $this->coupon_obj->setCurrentCoupon($coupon);
549 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i][
'pobject_id']);
551 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
553 $_SESSION[
"coupons"][
"bmf"][$key][
"total_objects_coupon_price"] += (float) $price;
554 $_SESSION[
"coupons"][
"bmf"][$key][
"items"][] = $tmp_bookEntries[$i];
564 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
566 $bookEntries[] =
new Buchung($tmp_bookEntries[$i]);
567 $totalAmount += $tmp_bookEntries[$i][
"betrag"];
571 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
575 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
577 if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
579 foreach ($coupon_discount_items as $item)
581 $item[
"betrag"] = $item[
"discount_price"];
582 $bookEntries[] =
new Buchung($item);
583 $totalAmount += $item[
"betrag"];
587 $values = array(
"betrag" => $totalAmount,
"buchungen" => $bookEntries);
588 $bookingList =
new BuchungsListe($this->user_obj->getId(), $values);
596 $resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr, $address, $bank, $bookingList);
597 $result = $resultObj->ergebnis;
603 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
604 $this->tpl->touchBlock(
"stop_floating");
605 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " .
$result->code .
": " .
$result->kurzText .
"<br>\n" .
$result->langText;
615 else if (
$result->code == -507 ||
622 else if (
$result->code == -402 ||
637 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
645 $resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
646 $resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
647 $resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
648 $resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
649 $resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
650 $resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
651 $resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
652 $resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
655 $this->
__sendBill($resultCustomerObj->kunde,
$_SESSION[
"bmf"][
"payment_type"], $bookingList, $resultObj);
657 $this->
__addBookings($resultObj,$bookingList->getTransaction());
661 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
662 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_thanks'));
663 $this->tpl->touchBlock(
"stop_floating");
667 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_debit_entry.html',
'payment');
668 #$this->tpl = new ilTemplate('tpl.pay_bmf_debit_entry.html', true, true, 'payment');
669 if ($this->ilias->getSetting(
"https") != 1)
671 $this->tpl->setCurrentBlock(
"buyed_objects");
672 #$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", "./payment.php?baseClass=ilpaymentbuyedobjectsgui&cmd=2");
673 #$link = $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui', 'showItems');
674 $link = $this->ctrl->getLinkTargetByClass(
'ilshopboughtobjectsgui');
675 $this->tpl->setVariable(
"LINK_GOTO_BUYED_OBJECTS", $link);
676 $this->tpl->setVariable(
"TXT_GOTO_BUYED_OBJECTS", $this->lng->txt(
'pay_goto_buyed_objects'));
677 $this->tpl->parseCurrentBlock(
"buyed_objects");
679 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW", $this->lng->txt(
'close_window'));
684 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
685 $this->tpl->touchBlock(
"stop_floating");
692 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
693 $this->tpl->touchBlock(
"stop_floating");
716 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
717 $this->tpl->touchBlock(
"stop_floating");
724 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_credit_card.html',
'payment');
725 #$this->tpl = new ilTemplate('tpl.pay_bmf_credit_card.html', true, true, 'payment');
728 $this->tpl->setVariable(
"CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
732 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
733 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step3_credit_card'));
734 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_credit_card_data'));
735 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_credit_card'));
736 $this->tpl->touchBlock(
"stop_floating");
737 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
740 $this->tpl->setVariable(
"TXT_CARD_HOLDER",$this->lng->txt(
'pay_bmf_card_holder'));
741 $this->tpl->setVariable(
"TXT_CHECK_NUMBER",$this->lng->txt(
'pay_bmf_check_number'));
742 $this->tpl->setVariable(
"TXT_OPTIONAL",$this->lng->txt(
'pay_bmf_optional'));
743 $this->tpl->setVariable(
"TXT_CARD_NUMBER",$this->lng->txt(
'pay_bmf_card_number'));
744 $this->tpl->setVariable(
"TXT_VALIDITY",$this->lng->txt(
'pay_bmf_validity'));
745 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS",$this->lng->txt(
'pay_bmf_terms_conditions'));
746 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_READ",$this->lng->txt(
'pay_bmf_terms_conditions_read'));
747 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt(
'pay_bmf_terms_conditions_show'));
748 $this->tpl->setVariable(
"LINK_TERMS_CONDITIONS",
"./payment.php?view=conditions");
749 $this->tpl->setVariable(
"TXT_PASSWORD",$this->lng->txt(
'password'));
750 $this->tpl->setVariable(
"TXT_CONFIRM_ORDER",$this->lng->txt(
'pay_confirm_order'));
752 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_send_order'));
753 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
757 $this->tpl->setVariable(
"CARD_HOLDER",
758 $this->error !=
"" && isset($_POST[
'card_holder'])
761 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_1",
762 $this->error !=
"" && isset($_POST[
'card_number'][
'block_1'])
765 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_2",
766 $this->error !=
"" && isset($_POST[
'card_number'][
'block_2'])
769 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_3",
770 $this->error !=
"" && isset($_POST[
'card_number'][
'block_3'])
773 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_4",
774 $this->error !=
"" && isset($_POST[
'card_number'][
'block_4'])
777 $this->tpl->setVariable(
"CHECK_NUMBER",
778 $this->error !=
"" && isset($_POST[
'check_number'])
781 for ($i = 1; $i <= 12; $i++)
783 $this->tpl->setCurrentBlock(
"loop_validity_months");
784 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS", $i < 10 ?
"0" . $i : $i);
785 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_TXT", $i < 10 ?
"0" . $i : $i);
786 if ($this->error !=
"" &&
787 isset($_POST[
'validity'][
'month']))
789 if ($_POST[
'validity'][
'month'] == $i)
791 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_SELECTED",
" selected");
796 if (
$_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"monat"] == $i)
798 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_SELECTED",
" selected");
801 $this->tpl->parseCurrentBlock(
"loop_validity_months");
803 for ($i = date(
"Y"); $i <= (date(
"Y")+6); $i++)
805 $this->tpl->setCurrentBlock(
"loop_validity_years");
806 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS", $i);
807 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_TXT", $i);
808 if ($this->error !=
"" &&
809 isset($_POST[
'validity'][
'year']))
811 if ($_POST[
'validity'][
'year'] == $i)
813 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_SELECTED",
" selected");
818 if (
$_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"jahr"] == $i)
820 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_SELECTED",
" selected");
823 $this->tpl->parseCurrentBlock(
"loop_validity_years");
837 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
838 $this->tpl->setCurrentBlock(
"btn_cell");
839 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPaymentType"));
840 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
841 $this->tpl->parseCurrentBlock(
"btn_cell");
848 if ($_POST[
"card_holder"] ==
"" ||
849 $_POST[
"card_number"][
"block_1"] ==
"" ||
850 $_POST[
"card_number"][
"block_2"] ==
"" ||
851 $_POST[
"card_number"][
"block_3"] ==
"" ||
852 $_POST[
"card_number"][
"block_4"] ==
"" ||
853 $_POST[
"validity"][
"month"] ==
"" ||
854 $_POST[
"validity"][
"year"] ==
"" ||
855 $_POST[
"validity"][
"year"].
"-".$_POST[
"validity"][
"month"] < date(
"Y-m"))
857 $this->error = $this->lng->txt(
'pay_bmf_credit_card_not_valid');
862 if ($_POST[
"terms_conditions"] != 1)
864 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
869 if ($_POST[
"password"] ==
"" ||
870 md5($_POST[
"password"]) != $this->user_obj->getPasswd())
872 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
878 $_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"monat"] = $_POST[
"validity"][
"month"];
879 $_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"jahr"] = $_POST[
"validity"][
"year"];
880 $_SESSION[
"bmf"][
"credit_card"][
"karteninhaber"] = $_POST[
"card_holder"];
881 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_1"] = $_POST[
"card_number"][
"block_1"];
882 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_2"] = $_POST[
"card_number"][
"block_2"];
883 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_3"] = $_POST[
"card_number"][
"block_3"];
884 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_4"] = $_POST[
"card_number"][
"block_4"];
885 $_SESSION[
"bmf"][
"credit_card"][
"kartenpruefnummer"] = $_POST[
"check_number"];
895 $this->psc_obj->clearCouponItemsSession();
900 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
901 $this->tpl->touchBlock(
"stop_floating");
910 $customer =
new Kunde($this->user_obj->getId());
916 $tmp_bookEntries = $sc_obj->getShoppingCart();
917 if (!is_array($tmp_bookEntries))
924 for ($i = 0; $i < count($tmp_bookEntries); $i++)
930 $price = $tmp_bookEntries[$i][
"betrag"];
931 $tmp_bookEntries[$i][
"math_price"] = (float) $price;
933 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
935 $this->coupon_obj->setId($coupon[
"pc_pk"]);
936 $this->coupon_obj->setCurrentCoupon($coupon);
938 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i][
'pobject_id']);
940 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
942 $_SESSION[
"coupons"][
"bmf"][$key][
"total_objects_coupon_price"] += (float) $price;
943 $_SESSION[
"coupons"][
"bmf"][$key][
"items"][] = $tmp_bookEntries[$i];
954 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
956 $bookEntries[] =
new Buchung($tmp_bookEntries[$i]);
957 $totalAmount += $tmp_bookEntries[$i][
"betrag"];
961 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
965 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
967 if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
969 foreach ($coupon_discount_items as $item)
971 $item[
"betrag"] = $item[
"discount_price"];
972 $bookEntries[] =
new Buchung($item);
973 $totalAmount += $item[
"discount_price"];
977 $values = array(
"betrag" => $totalAmount,
"buchungen" => $bookEntries);
978 $bookingList =
new BuchungsListe($this->user_obj->getId(), $values);
985 $resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
986 $result = $resultObj->ergebnis;
994 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
995 $this->tpl->touchBlock(
"stop_floating");
996 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " .
$result->code .
": " .
$result->kurzText .
"<br>\n" .
$result->langText;
1006 else if (
$result->code == -507 ||
1013 else if (
$result->code == -701 ||
1025 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
1036 $this->
__addBookings($resultObj,$bookingList->getTransaction());
1040 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
1041 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_thanks'));
1042 $this->tpl->touchBlock(
"stop_floating");
1046 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_credit_card.html',
'payment');
1047 #$this->tpl = new ilTemplate('tpl.pay_bmf_credit_card.html', true, true, 'payment');
1048 if ($this->ilias->getSetting(
"https") != 1)
1050 $this->tpl->setCurrentBlock(
"buyed_objects");
1051 #$this->ctrl->redirectByClass("ilPaymentBuyedObjectsGUI", "ilpaymentbuyedobjectsgui");
1052 #$link = $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui', 'showItems');
1053 $link = $this->ctrl->getLinkTargetByClass(
'ilshopboughtobjectsgui');
1054 $this->tpl->setVariable(
"LINK_GOTO_BUYED_OBJECTS", $link);
1055 $this->tpl->setVariable(
"TXT_GOTO_BUYED_OBJECTS", $this->lng->txt(
'pay_goto_buyed_objects'));
1056 $this->tpl->parseCurrentBlock(
"buyed_objects");
1058 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW", $this->lng->txt(
'close_window'));
1063 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
1064 $this->tpl->touchBlock(
"stop_floating");
1079 $cmd = $this->ctrl->getCmd();
1081 switch ($this->ctrl->getNextClass($this))
1085 if(!
$cmd = $this->ctrl->getCmd())
1087 $cmd =
'showPersonalData';
1097 include_once
'./classes/class.ilTemplate.php';
1098 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1099 include_once
'./payment/classes/class.ilGeneralSettings.php';
1100 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
1101 include_once
'Services/Mail/classes/class.ilMimeMail.php';
1106 $tpl =
new ilTemplate(
"./payment/templates/default/tpl.pay_bmf_bill.html",
true,
true,
true);
1108 $tpl->setVariable(
"VENDOR_ADDRESS", nl2br(utf8_decode($genSet->get(
"address"))));
1109 $tpl->setVariable(
"VENDOR_ADD_INFO", nl2br(utf8_decode($genSet->get(
"add_info"))));
1110 $tpl->setVariable(
"VENDOR_BANK_DATA", nl2br(utf8_decode($genSet->get(
"bank_data"))));
1111 $tpl->setVariable(
"TXT_BANK_DATA", utf8_decode($this->lng->txt(
"pay_bank_data")));
1113 $tpl->setVariable(
"CUSTOMER_FIRSTNAME", $customer->vorname);
1114 $tpl->setVariable(
"CUSTOMER_LASTNAME", $customer->nachname);
1115 if ($customer->rechnungsAdresse->strasse !=
"" &&
1116 $customer->rechnungsAdresse->hausNr !=
"")
1118 $tpl->setVariable(
"CUSTOMER_STREET_POBOX", $customer->rechnungsAdresse->strasse .
" ". $customer->rechnungsAdresse->hausNr);
1122 $tpl->setVariable(
"CUSTOMER_STREET_POBOX", $customer->rechnungsAdresse->postfach);
1124 $tpl->setVariable(
"CUSTOMER_ZIPCODE", $customer->rechnungsAdresse->PLZ);
1125 $tpl->setVariable(
"CUSTOMER_CITY", $customer->rechnungsAdresse->ort);
1126 $tpl->setVariable(
"CUSTOMER_COUNTRY", $this->
__getCountryName($customer->rechnungsAdresse->land));
1128 $tpl->setVariable(
"BILL_NO",
$result->buchungsListe->kassenzeichen);
1129 $tpl->setVariable(
"DATE", date(
"d.m.Y"));
1131 $tpl->setVariable(
"TXT_BILL", utf8_decode($this->lng->txt(
"pays_bill")));
1132 $tpl->setVariable(
"TXT_BILL_NO", utf8_decode($this->lng->txt(
"pay_bill_no")));
1133 $tpl->setVariable(
"TXT_DATE", utf8_decode($this->lng->txt(
"date")));
1135 $tpl->setVariable(
"TXT_ARTICLE", utf8_decode($this->lng->txt(
"pay_article")));
1136 $tpl->setVariable(
"TXT_PRICE", utf8_decode($this->lng->txt(
"price_a")));
1138 $bookEntries = $sc_obj->getShoppingCart();
1139 for ($i = 0; $i < count($bookEntries); $i++)
1141 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $bookEntries[$i][
'pobject_id']);
1143 $assigned_coupons =
'';
1144 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1146 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
1148 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1149 $this->coupon_obj->setCurrentCoupon($coupon);
1151 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1153 $assigned_coupons .=
'<br />' . $this->lng->txt(
'paya_coupons_coupon') .
': ' . $coupon[
"pcc_code"];
1158 $tpl->setCurrentBlock(
"loop");
1159 $tpl->setVariable(
"LOOP_OBJ_TYPE", utf8_decode($this->lng->txt($bookEntries[$i][
"typ"])));
1160 $tpl->setVariable(
"LOOP_TITLE", $bookEntries[$i][
"buchungstext"]. $assigned_coupons);
1161 $tpl->setVariable(
"LOOP_TXT_ENTITLED_RETRIEVE", utf8_decode($this->lng->txt(
"pay_entitled_retrieve")));
1162 $tpl->setVariable(
"LOOP_DURATION", $bookEntries[$i][
"dauer"] .
" " . utf8_decode($this->lng->txt(
"paya_months")));
1163 $tpl->setVariable(
"LOOP_PRICE", number_format($bookEntries[$i][
"betrag"], 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1164 $tpl->parseCurrentBlock(
"loop");
1166 unset($tmp_pobject);
1169 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1171 if (count($items = $bookEntries))
1173 $sub_total_amount = $bookingList->betrag;
1175 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1177 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1178 $this->coupon_obj->setCurrentCoupon($coupon);
1180 $total_object_price = 0.0;
1181 $current_coupon_bonus = 0.0;
1183 foreach ($bookEntries as $item)
1185 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $item[
'pobject_id']);
1187 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1189 $total_object_price += $item[
"betrag"];
1192 unset($tmp_pobject);
1195 $current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
1197 $sub_total_amount += $current_coupon_bonus;
1199 $tpl->setCurrentBlock(
"cloop");
1200 $tpl->setVariable(
"TXT_COUPON", utf8_decode($this->lng->txt(
"paya_coupons_coupon") .
" " . $coupon[
"pcc_code"]));
1201 $tpl->setVariable(
"BONUS", number_format($current_coupon_bonus * (-1), 2,
',',
'.') .
" " . $genSet->get(
"currency_unit"));
1202 $tpl->parseCurrentBlock();
1205 $tpl->setVariable(
"TXT_SUBTOTAL_AMOUNT", utf8_decode($this->lng->txt(
"pay_bmf_subtotal_amount")));
1206 $tpl->setVariable(
"SUBTOTAL_AMOUNT", number_format($sub_total_amount, 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1210 if ($bookingList->betrag < 0) $bookingList->betrag = 0.0;
1212 $tpl->setVariable(
"TXT_TOTAL_AMOUNT", utf8_decode($this->lng->txt(
"pay_bmf_total_amount")));
1213 $tpl->setVariable(
"TOTAL_AMOUNT", number_format($bookingList->betrag, 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1214 if (($vat = $sc_obj->getVat($bookingList->betrag)) > 0)
1216 $tpl->setVariable(
"VAT", number_format($vat, 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1217 $tpl->setVariable(
"TXT_VAT", $genSet->get(
"vat_rate") .
"% " . utf8_decode($this->lng->txt(
"pay_bmf_vat_included")));
1220 if ($paymentType ==
"debit_entry")
1222 $tpl->setVariable(
"TXT_PAYMENT_TYPE", utf8_decode($this->lng->txt(
"pay_payed_debit_entry")));
1226 $tpl->setVariable(
"TXT_PAYMENT_TYPE", utf8_decode($this->lng->txt(
"pay_payed_credit_card")));
1229 if (!@file_exists($genSet->get(
"pdf_path")))
1234 if (@file_exists($genSet->get(
"pdf_path")))
1239 if (@file_exists($genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".pdf") &&
1240 $customer->EMailAdresse !=
"" &&
1241 $this->ilias->getSetting(
"admin_email") !=
"")
1244 $m->
From( $this->ilias->getSetting(
"admin_email") );
1245 $m->To( $customer->EMailAdresse );
1246 $m->Subject( $this->lng->txt(
"pay_message_subject") );
1247 $message = $this->lng->txt(
"pay_message_hello") .
" " . utf8_encode($customer->vorname) .
" " . utf8_encode($customer->nachname) .
",\n\n";
1248 $message .= $this->lng->txt(
"pay_message_thanks") .
"\n\n";
1249 $message .= $this->lng->txt(
"pay_message_attachment") .
"\n\n";
1250 $message .= $this->lng->txt(
"pay_message_regards") .
"\n\n";
1251 $message .= strip_tags($genSet->get(
"address"));
1252 $m->Body( $message );
1253 $m->Attach( $genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".pdf",
"application/pdf" ) ;
1257 @unlink($genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".html");
1258 @unlink($genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".pdf");
1264 include_once
'./payment/classes/class.ilPaymentBookings.php';
1265 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
1266 include_once
'./payment/classes/class.ilPaymentObject.php';
1267 include_once
'./payment/classes/class.ilPaymentPrices.php';
1275 $sc_obj->clearCouponItemsSession();
1277 foreach($items as $entry)
1279 $pobject =&
new ilPaymentObject($this->user_obj,$entry[
'pobject_id']);
1283 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1286 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
1288 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1289 $this->coupon_obj->setCurrentCoupon($coupon);
1291 if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
1294 $_SESSION[
"coupons"][
"bmf"][$key][
"items"][] = $entry;
1302 $coupon_discount_items = $sc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
1305 foreach($items as $entry)
1307 $pobject =&
new ilPaymentObject($this->user_obj,$entry[
'pobject_id']);
1311 if (array_key_exists($entry[
"pobject_id"], $coupon_discount_items))
1313 $bonus = $coupon_discount_items[$entry[
"pobject_id"]][
"math_price"] - $coupon_discount_items[$entry[
"pobject_id"]][
"discount_price"];
1316 $booking_obj->setTransaction($a_transaction);
1317 $booking_obj->setPobjectId($entry[
'pobject_id']);
1318 $booking_obj->setCustomerId($this->user_obj->getId());
1319 $booking_obj->setVendorId($pobject->getVendorId());
1320 $booking_obj->setPayMethod($pobject->getPayMethod());
1321 $booking_obj->setOrderDate(time());
1322 $booking_obj->setDuration($price[
'duration']);
1325 $booking_obj->setPayed(1);
1326 $booking_obj->setAccess(1);
1327 $booking_obj->setVoucher($a_result->buchungsListe->buchungen[$i++]->belegNr);
1328 $booking_obj->setTransactionExtern($a_result->buchungsListe->kassenzeichen);
1330 $current_booking_id = $booking_obj->add();
1332 if (!empty(
$_SESSION[
"coupons"][
"bmf"]) && $current_booking_id)
1334 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1336 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1337 $this->coupon_obj->setCurrentCoupon($coupon);
1339 if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
1341 $this->coupon_obj->addCouponForBookingId($current_booking_id);
1346 unset($current_booking_id);
1350 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1352 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1354 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1355 $this->coupon_obj->setCurrentCoupon($coupon);
1356 $this->coupon_obj->addTracking();
1363 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
1367 return $sc_obj->emptyShoppingCart();
1374 $_SESSION[
"bmf"][
"debit_entry"] = array();
1375 $_SESSION[
"bmf"][
"credit_card"] = array();
1380 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.payb_content.html");
1388 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1389 # $this->__buildLocator();
1394 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html");
1395 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
1397 $this->tpl->setCurrentBlock(
"locator_item");
1398 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"personal_desktop"));
1399 $this->tpl->setVariable(
"LINK_ITEM",
"../ilias.php?baseClass=ilPersonalDesktopGUI");
1400 #$this->tpl->setVariable("LINK_ITEM", "../usr_personaldesktop.php");
1401 $this->tpl->parseCurrentBlock();
1403 $this->tpl->setCurrentBlock(
"locator_item");
1404 $this->tpl->setVariable(
"PREFIX",
'> ');
1405 # $this->tpl->setVariable("ITEM", $this->lng->txt("pay_locator"));
1406 $this->tpl->setVariable(
"ITEM",
"Payment");
1407 $this->tpl->setVariable(
"LINK_ITEM",
"./payment.php");
1408 $this->tpl->parseCurrentBlock();
1427 foreach($countries as $code => $text)
1429 $tpl->setCurrentBlock(
"loop_countries");
1430 $tpl->setVariable(
"LOOP_COUNTRIES", $code);
1431 $tpl->setVariable(
"LOOP_COUNTRIES_TXT", $text);
1435 $tpl->setVariable(
"LOOP_COUNTRIES_SELECTED",
" selected");
1437 $tpl->parseCurrentBlock(
"loop_countries");
1439 $tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"pay_bmf_please_select"));
1447 $lng->loadLanguageModule(
"meta");
1449 $cntcodes = array (
"DE",
"ES",
"FR",
"GB",
"AT",
"CH",
"AF",
"AL",
"DZ",
"AS",
"AD",
"AO",
1450 "AI",
"AQ",
"AG",
"AR",
"AM",
"AW",
"AU",
"AT",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BY",
1451 "BE",
"BZ",
"BJ",
"BM",
"BT",
"BO",
"BA",
"BW",
"BV",
"BR",
"IO",
"BN",
"BG",
"BF",
1452 "BI",
"KH",
"CM",
"CA",
"CV",
"KY",
"CF",
"TD",
"CL",
"CN",
"CX",
"CC",
"CO",
"KM",
1453 "CG",
"CK",
"CR",
"CI",
"HR",
"CU",
"CY",
"CZ",
"DK",
"DJ",
"DM",
"DO",
"TP",
"EC",
1454 "EG",
"SV",
"GQ",
"ER",
"EE",
"ET",
"FK",
"FO",
"FJ",
"FI",
"FR",
"FX",
"GF",
"PF",
1455 "TF",
"GA",
"GM",
"GE",
"DE",
"GH",
"GI",
"GR",
"GL",
"GD",
"GP",
"GU",
"GT",
"GN",
1456 "GW",
"GY",
"HT",
"HM",
"HN",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IL",
"IT",
1457 "JM",
"JP",
"JO",
"KZ",
"KE",
"KI",
"KP",
"KR",
"KW",
"KG",
"LA",
"LV",
"LB",
"LS",
1458 "LR",
"LY",
"LI",
"LT",
"LU",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"ML",
"MT",
"MH",
1459 "MQ",
"MR",
"MU",
"YT",
"MX",
"FM",
"MD",
"MC",
"MN",
"MS",
"MA",
"MZ",
"MM",
"NA",
1460 "NR",
"NP",
"NL",
"AN",
"NC",
"NZ",
"NI",
"NE",
"NG",
"NU",
"NF",
"MP",
"NO",
"OM",
1461 "PK",
"PW",
"PA",
"PG",
"PY",
"PE",
"PH",
"PN",
"PL",
"PT",
"PR",
"QA",
"RE",
"RO",
1462 "RU",
"RW",
"KN",
"LC",
"VC",
"WS",
"SM",
"ST",
"SA",
"CH",
"SN",
"SC",
"SL",
"SG",
1463 "SK",
"SI",
"SB",
"SO",
"ZA",
"GS",
"ES",
"LK",
"SH",
"PM",
"SD",
"SR",
"SJ",
"SZ",
1464 "SE",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TG",
"TK",
"TO",
"TT",
"TN",
"TR",
"TM",
"TC",
1465 "TV",
"UG",
"UA",
"AE",
"GB",
"UY",
"US",
"UM",
"UZ",
"VU",
"VA",
"VE",
"VN",
"VG",
1466 "VI",
"WF",
"EH",
"YE",
"ZR",
"ZM",
"ZW");
1468 foreach($cntcodes as $cntcode)
1470 $cntrs[$cntcode] = $lng->txt(
"meta_c_".$cntcode);
1479 foreach($countries as $code => $text)
1481 if ($text == $value)
1492 return $countries[$value];
1558 foreach($items as $item)
1560 $tmp_pobject =&
new ilPaymentObject($this->user_obj,$item[
'pobject_id']);
1566 $assigned_coupons =
'';
1567 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1569 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
1571 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1572 $this->coupon_obj->setCurrentCoupon($coupon);
1574 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1576 $assigned_coupons .=
'<br />' . $this->lng->txt(
'paya_coupons_coupon') .
': ' . $coupon[
"pcc_code"];
1581 $f_result[$counter][] = $tmp_obj->getTitle();
1582 if ($assigned_coupons !=
'') $f_result[$counter][count($f_result[$counter]) - 1] .= $assigned_coupons;
1584 $f_result[$counter][] = $price_arr[
'duration'] .
" " . $this->lng->txt(
"paya_months");
1589 unset($tmp_pobject);
1599 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1606 include_once
'./payment/classes/class.ilGeneralSettings.php';
1611 $tpl =& $tbl->getTemplateObject();
1614 $tpl->setCurrentBlock(
"tbl_form_header");
1616 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1617 $tpl->parseCurrentBlock();
1619 $tbl->setTitle($this->lng->txt(
"paya_shopping_cart"),
"icon_pays_b.gif",$this->lng->txt(
"paya_shopping_cart"));
1620 $tbl->setHeaderNames(array($this->lng->txt(
"title"),
1621 $this->lng->txt(
"duration"),
1622 $this->lng->txt(
"price_a")));
1624 $tbl->setHeaderVars(array(
"title",
1628 "cmdClass" =>
"ilpurchasebmfgui",
1629 "cmdNode" =>
$_GET[
"cmdNode"]));
1631 $tbl->disable(
"footer");
1632 $tbl->disable(
"sort");
1633 $tbl->disable(
"linkbar");
1635 $offset =
$_GET[
"offset"];
1636 $order =
$_GET[
"sort_by"];
1637 $direction =
$_GET[
"sort_order"] ?
$_GET[
'sort_order'] :
'desc';
1639 $tbl->setOrderColumn($order,
'title');
1640 $tbl->setOrderDirection($direction);
1641 $tbl->setOffset($offset);
1642 $tbl->setLimit(
$_GET[
"limit"]);
1643 $tbl->setMaxCount(count($a_result_set));
1644 # $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
1645 $tbl->setData($a_result_set);
1649 $totalAmount = $sc_obj->getTotalAmount();
1652 $tpl->setCurrentBlock(
"tbl_footer_linkbar");
1653 $amount .=
"<table class=\"\" style=\"float: right;\">\n";
1654 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1658 if (count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
1660 $amount .=
"<tr>\n";
1661 $amount .=
"<td>\n";
1662 $amount .=
"<b>" . $this->lng->txt(
"pay_bmf_subtotal_amount") .
":";
1663 $amount .=
"</td>\n";
1664 $amount .=
"<td>\n";
1665 $amount .= number_format($totalAmount[PAY_METHOD_BMF], 2,
',',
'.') .
" " . $genSet->get(
"currency_unit") .
"</b>";
1666 $amount .=
"</td>\n";
1667 $amount .=
"</tr>\n";
1669 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1671 $this->coupon_obj->setCurrentCoupon($coupon);
1672 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1674 $total_object_price = 0.0;
1675 $current_coupon_bonus = 0.0;
1677 foreach ($items as $item)
1679 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $item[
'pobject_id']);
1681 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1684 $price = ((int) $price_data[
"unit_value"]) .
"." . sprintf(
"%02d", ((
int) $price_data[
"sub_unit_value"]));
1686 $total_object_price += $price;
1689 unset($tmp_pobject);
1692 $current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
1695 $amount .=
"<tr>\n";
1696 $amount .=
"<td>\n";
1697 $amount .= $this->lng->txt(
"paya_coupons_coupon") .
" " . $coupon[
"pcc_code"] .
":";
1698 $amount .=
"</td>\n";
1699 $amount .=
"<td>\n";
1700 $amount .= number_format($current_coupon_bonus * (-1), 2,
',',
'.') .
" " . $genSet->get(
"currency_unit");
1701 $amount .=
"</td>\n";
1702 $amount .=
"</tr>\n";
1706 if ($totalAmount[PAY_METHOD_BMF] < 0)
1713 $vat = $sc_obj->getVat($totalAmount[PAY_METHOD_BMF]);
1718 $amount .=
"<tr>\n";
1719 $amount .=
"<td>\n";
1720 $amount .=
"<b>" . $this->lng->txt(
"pay_bmf_total_amount") .
":";
1721 $amount .=
"</td>\n";
1722 $amount .=
"<td>\n";
1723 $amount .= number_format($totalAmount[PAY_METHOD_BMF], 2,
',',
'.') .
" " . $genSet->get(
"currency_unit");
1724 $amount .=
"</td>\n";
1725 $amount .=
"</tr>\n";
1729 $amount .=
"<tr>\n";
1730 $amount .=
"<td>\n";
1731 $amount .= $genSet->get(
"vat_rate") .
"% " . $this->lng->txt(
"pay_bmf_vat_included") .
":";
1732 $amount .=
"</td>\n";
1733 $amount .=
"<td>\n";
1734 $amount .= number_format($vat, 2,
',',
'.') .
" " . $genSet->get(
"currency_unit");
1735 $amount .=
"</td>\n";
1736 $amount .=
"</tr>\n";
1739 $amount .=
"</table>\n";
1741 $tpl->setVariable(
"LINKBAR", $amount);
1742 $tpl->parseCurrentBlock(
"tbl_footer_linkbar");
1743 $tpl->setCurrentBlock(
'tbl_footer');
1744 $tpl->setVariable(
'COLUMN_COUNT',3);
1745 $tpl->parseCurrentBlock();
1748 $this->tpl->setVariable(
"ITEMS_TABLE",$tbl->tpl->get());
1765 $this->_soapClient =
new ilBMFClient(
$bmfConfig[
"ePaymentServer"],
false,
false, array(
'curl' => array(CURLOPT_SSLCERT =>
$bmfConfig[
"clientCertificate"], CURLE_SSL_PEER_CERTIFICATE =>
$bmfConfig[
"caCertificate"], CURLOPT_TIMEOUT => (
int)
$bmfConfig[
"timeOut"])));
1775 'kunde' => $customer
1778 $result = $this->_soapClient->call(
"anlegenKunde", $tmp,
"KundenstammdatenPflegeWS");
1793 $this->_soapClient =
new ilBMFClient(
$bmfConfig[
"ePaymentServer"],
false,
false, array(
'curl' => array(CURLOPT_SSLCERT =>
$bmfConfig[
"clientCertificate"], CURLE_SSL_PEER_CERTIFICATE =>
$bmfConfig[
"caCertificate"], CURLOPT_TIMEOUT => (
int)
$bmfConfig[
"timeOut"])));
1803 'kreditkarte' => $creditCard,
1804 'waehrungskennzeichen' =>
$bmfConfig[
"waehrungskennzeichen"]
1807 $result = $this->_soapClient->call(
"validierenKreditkarte", $tmp,
"KreditkartenzahlungWS");
1820 'Kunde' => $customer,
1821 'Kreditkarte' => $creditCard,
1822 'buchungsListe' => $bookingList,
1823 'lieferadresse' => $lieferadresse
1826 $result = $this->_soapClient->call(
"zahlenUndAnlegenKunde", $tmp,
"KreditkartenzahlungWS");
1841 $this->_soapClient =
new ilBMFClient(
$bmfConfig[
"ePaymentServer"],
false,
false, array(
'curl' => array(CURLOPT_SSLCERT =>
$bmfConfig[
"clientCertificate"], CURLE_SSL_PEER_CERTIFICATE =>
$bmfConfig[
"caCertificate"], CURLOPT_TIMEOUT => (
int)
$bmfConfig[
"timeOut"])));
1851 'eShopKundenNr' => $eShopCustomerNumber,
1852 'lieferAdresse' => $address,
1853 'bankverbindung' => $bank,
1854 'buchungsListe' => $bookingList
1857 $result = $this->_soapClient->call(
"abbuchenOhneEinzugsermaechtigung", $tmp,
"LastschriftWS");
1865 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Kunde');
1867 function Kunde ($customerNumber =
"", $values =
"")
1875 $this->EShopKundenNr = time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1876 if ($customerNumber !=
"")
1878 $this->EShopKundenNr = $customerNumber .
"_" . time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1884 $values =
$_SESSION[
"bmf"][
"personal_data"];
1887 if ($values[
"sprache"] != NULL)
1889 $this->sprache = $values[
"sprache"];
1891 if ($values[
"vorname"] != NULL)
1893 $this->vorname = utf8_decode($values[
"vorname"]);
1895 if ($values[
"nachname"] != NULL)
1897 $this->nachname = utf8_decode($values[
"nachname"]);
1899 if ($values[
"EMailAdresse"] != NULL)
1901 $this->EMailAdresse = utf8_decode($values[
"EMailAdresse"]);
1906 $this->rechnungsAdresse = $address;
1911 return $this->EShopKundenNr;
1918 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Adresse');
1924 $values =
$_SESSION[
"bmf"][
"personal_data"];
1927 if (is_array($values))
1929 if ($values[
"strasse"] != NULL)
1931 $this->strasse = utf8_decode($values[
"strasse"]);
1933 if ($values[
"hausNr"] != NULL)
1935 $this->hausNr = utf8_decode($values[
"hausNr"]);
1937 if ($values[
"postfach"] != NULL)
1939 $this->postfach = utf8_decode($values[
"postfach"]);
1941 if ($values[
"land"] != NULL)
1943 $this->land = utf8_decode($values[
"land"]);
1945 if ($values[
"PLZ"] != NULL)
1947 $this->PLZ = utf8_decode($values[
"PLZ"]);
1949 if ($values[
"ort"] != NULL)
1951 $this->ort = utf8_decode($values[
"ort"]);
1960 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Kreditkarte');
1966 $values =
$_SESSION[
"bmf"][
"credit_card"];
1969 if (is_array($values))
1971 if ($values[
"karteninhaber"] != NULL)
1973 $this->karteninhaber = utf8_decode($values[
"karteninhaber"]);
1975 if ($values[
"kartenpruefnummer"] != NULL)
1977 $this->kartenpruefnummer = utf8_decode($values[
"kartenpruefnummer"]);
1979 if (is_array ($values[
"kreditkartenNr"]) &&
1980 count($values[
"kreditkartenNr"]) == 4)
1982 for ($i = 1; $i <= count($values[
"kreditkartenNr"]); $i++)
1984 $this->kreditkartenNr .= utf8_decode($values[
"kreditkartenNr"][
"block_".$i]);# .
"-";
1986 # $this->kreditkartenNr = substr($this->kreditkartenNr, 0, strlen($this->kreditkartenNr)-1);
1988 if (is_array($values[
"gueltigkeit"]) &&
1989 $values[
"gueltigkeit"][
"monat"] !=
"" &&
1990 $values[
"gueltigkeit"][
"jahr"] !=
"")
1992 $this->gueltigkeit = utf8_decode($values[
"gueltigkeit"][
"monat"]);
1993 $this->gueltigkeit .= utf8_decode($values[
"gueltigkeit"][
"jahr"]);
2002 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Lastschrift');
2006 $this->EShopKundenNr = time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
2007 if ($customerNumber !=
"")
2009 $this->EShopKundenNr = $customerNumber .
"_" . time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
2017 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Bankverbindung');
2023 $values =
$_SESSION[
"bmf"][
"debit_entry"];
2026 if (is_array($values))
2028 if ($values[
"kontoinhaber"] != NULL)
2030 $this->kontoinhaber = utf8_decode($values[
"kontoinhaber"]);
2032 if ($values[
"kontoNr"] != NULL)
2034 $this->kontoNr = utf8_decode($values[
"kontoNr"]);
2036 if ($values[
"BLZ"] != NULL)
2038 $this->BLZ = utf8_decode($values[
"BLZ"]);
2047 var
$OBJTypeNS = array (
'namespace' =>
'http://schemas.xmlsoap.org/soap/encoding/',
'nsPrefix' =>
'ns3',
'type' =>
'Buchung',
'pnamespace' =>
'http://www.bff.bund.de/ePayment',
'pnsPrefix' =>
'ns2',
'item' =>
'ns2:Buchung');
2056 $this->haushaltsstelle =
$bmfConfig[
"haushaltsstelle"];
2060 $this->objektnummer =
$bmfConfig[
"objektNr"];
2063 if (is_array($values))
2065 if ($values[
"buchungstext"] != NULL)
2067 $buchungstext = utf8_decode($values[
"buchungstext"]);
2068 if(strlen($buchungstext) > 16)
2070 $buchungstext = substr($buchungstext,0,15).
'...';
2073 $this->buchungstext = $buchungstext;
2075 if ($values[
"betrag"] !=
"")
2077 $this->betrag = $values[
"betrag"];
2085 if ($voucherNumber != NULL)
2087 $this->belegNr = $voucherNumber;
2093 return $this->belegNr;
2099 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment',
'nsPrefix' =>
'ns2',
'type' =>
'BuchungsListe');
2110 $this->bewirtschafterNr =
$bmfConfig[
"bewirtschafterNr"];
2112 if (
$bmfConfig[
"waehrungskennzeichen"] != NULL)
2114 $this->waehrungskennzeichen =
$bmfConfig[
"waehrungskennzeichen"];
2116 $this->faelligkeitsdatum = date(
"Y-m-d") .
"T" . date(
"H:i:s") .
"Z";
2117 if (
$bmfConfig[
"kennzeichenMahnverfahren"] != NULL)
2119 $this->kennzeichenMahnverfahren =
$bmfConfig[
"kennzeichenMahnverfahren"];
2122 $inst_id_time = $ilias->getSetting(
'inst_id').
'_'.$userId.
'_'.substr((
string) time(),-3);
2123 $this->EShopTransaktionsNr = $inst_id_time.substr(md5(uniqid(rand(),
true)), 0, 4);
2125 if (is_array($values))
2127 if ($values[
"betrag"] != NULL)
2129 $this->betrag = $values[
"betrag"];
2131 if ($values[
"buchungen"] != NULL)
2133 $this->buchungen = $values[
"buchungen"];
2139 return $this->EShopTransaktionsNr;
2145 if ($kassenzeichen != NULL)
2147 $this->kassenzeichen = $kassenzeichen;
2153 return $this->kassenzeichen;
2160 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'LieferAdresse');
2166 $values =
$_SESSION[
"bmf"][
"personal_data"];
2169 if (is_array($values))
2171 if ($values[
"vorname"] != NULL)
2173 $this->vorname = utf8_decode($values[
"vorname"]);
2175 if ($values[
"nachname"] != NULL)
2177 $this->nachname = utf8_decode($values[
"nachname"]);
2179 if ($values[
"strasse"] != NULL)
2181 $this->strasse = utf8_decode($values[
"strasse"]);
2183 if ($values[
"hausNr"] != NULL)
2185 $this->hausNr = utf8_decode($values[
"hausNr"]);
2187 if ($values[
"postfach"] != NULL)
2189 $this->postfach = utf8_decode($values[
"postfach"]);
2191 if ($values[
"land"] != NULL)
2193 $this->land = utf8_decode($values[
"land"]);
2195 if ($values[
"PLZ"] != NULL)
2197 $this->PLZ = utf8_decode($values[
"PLZ"]);
2199 if ($values[
"ort"] != NULL)
2201 $this->ort = utf8_decode($values[
"ort"]);