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";
38 include_once
'Services/Payment/classes/class.ilShopVatsList.php';
56 $this->ilias = $ilias;
67 if (!is_array(
$_SESSION[
"bmf"][
"personal_data"]))
69 $_SESSION[
"bmf"][
"personal_data"][
"firstname"] = $this->user_obj->getFirstname();
70 $_SESSION[
"bmf"][
"personal_data"][
"lastname"] = $this->user_obj->getLastname();
71 if (strpos(
"_" . $this->user_obj->getStreet(),
" ") > 0)
73 $houseNo = substr($this->user_obj->getStreet(), strrpos($this->user_obj->getStreet(),
" ")+1);
74 $street = substr($this->user_obj->getStreet(), 0, strlen($this->user_obj->getStreet())-(strlen($houseNo)+1));
75 $_SESSION[
"bmf"][
"personal_data"][
"street"] = $street;
76 $_SESSION[
"bmf"][
"personal_data"][
"house_number"] = $houseNo;
80 $_SESSION[
"bmf"][
"personal_data"][
"street"] = $this->user_obj->getStreet();
81 $_SESSION[
"bmf"][
"personal_data"][
"house_number"] =
"";
83 $_SESSION[
"bmf"][
"personal_data"][
"po_box"] =
"";
84 $_SESSION[
"bmf"][
"personal_data"][
"zipcode"] = $this->user_obj->getZipcode();
85 $_SESSION[
"bmf"][
"personal_data"][
"city"] = $this->user_obj->getCity();
87 $_SESSION[
"bmf"][
"personal_data"][
"email"] = $this->user_obj->getEmail();
88 $_SESSION[
"bmf"][
"personal_data"][
"language"] = $this->user_obj->getLanguage();
91 if (!is_array(
$_SESSION[
"coupons"][
"bmf"]))
100 $this->lng->loadLanguageModule(
"payment");
102 $ilTabs->clearTargets();
103 $ilTabs->clearSubTabs();
121 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
122 $this->tpl->touchBlock(
"stop_floating");
129 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_personal_data.html',
'payment');
130 #$this->tpl = new ilTemplate('tpl.pay_bmf_personal_data.html', true, true, 'payment');
132 $this->tpl->setVariable(
"PERSONAL_DATA_FORMACTION",$this->ctrl->getFormAction($this));
136 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
137 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step1'));
138 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_personal_data'));
139 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_personal_data'));
140 $this->tpl->touchBlock(
"stop_floating");
141 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
144 $this->tpl->setVariable(
"TXT_FIRSTNAME",$this->lng->txt(
'firstname'));
145 $this->tpl->setVariable(
"TXT_LASTNAME",$this->lng->txt(
'lastname'));
146 $this->tpl->setVariable(
"TXT_STREET",$this->lng->txt(
'street'));
147 $this->tpl->setVariable(
"TXT_HOUSE_NUMBER",$this->lng->txt(
'pay_bmf_house_number'));
148 $this->tpl->setVariable(
"TXT_OR",$this->lng->txt(
'pay_bmf_or'));
149 $this->tpl->setVariable(
"TXT_PO_BOX",$this->lng->txt(
'pay_bmf_po_box'));
150 $this->tpl->setVariable(
"TXT_ZIPCODE",$this->lng->txt(
'zipcode'));
151 $this->tpl->setVariable(
"TXT_CITY",$this->lng->txt(
'city'));
152 $this->tpl->setVariable(
"TXT_COUNTRY",$this->lng->txt(
'country'));
153 $this->tpl->setVariable(
"TXT_EMAIL",$this->lng->txt(
'email'));
155 $this->tpl->setVariable(
"INPUT_VALUE",ucfirst($this->lng->txt(
'next')));
156 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
169 $this->tpl->setVariable(
"FIRSTNAME", $this->user_obj->getFirstname());
170 $this->tpl->setVariable(
"LASTNAME", $this->user_obj->getLastname());
171 $this->tpl->setVariable(
"STREET",
172 $this->error !=
"" && isset(
$_POST[
'street'])
175 $this->tpl->setVariable(
"HOUSE_NUMBER",
176 $this->error !=
"" && isset(
$_POST[
'house_number'])
179 $this->tpl->setVariable(
"PO_BOX",
180 $this->error !=
"" && isset(
$_POST[
'po_box'])
183 $this->tpl->setVariable(
"ZIPCODE",
184 $this->error !=
"" && isset(
$_POST[
'zipcode'])
187 $this->tpl->setVariable(
"CITY",
188 $this->error !=
"" && isset(
$_POST[
'city'])
191 $this->tpl->setVariable(
"EMAIL", $this->user_obj->getEmail());
199 if (
$_SESSION[
"bmf"][
"personal_data"][
"firstname"] ==
"" ||
200 $_SESSION[
"bmf"][
"personal_data"][
"lastname"] ==
"" ||
201 $_POST[
"zipcode"] ==
"" ||
203 $_POST[
"country"] ==
"" ||
204 $_SESSION[
"bmf"][
"personal_data"][
"email"] ==
"")
206 $this->error = $this->lng->txt(
'pay_bmf_personal_data_not_valid');
211 if ((
$_POST[
"street"] ==
"" &&
$_POST[
"house_number"] ==
"" &&
$_POST[
"po_box"] ==
"") ||
212 ((
$_POST[
"street"] !=
"" ||
$_POST[
"house_number"] !=
"") &&
$_POST[
"po_box"] !=
"") ||
213 (
$_POST[
"street"] !=
"" &&
$_POST[
"house_number"] ==
"") ||
214 (
$_POST[
"street"] ==
"" &&
$_POST[
"house_number"] !=
""))
216 $this->error = $this->lng->txt(
'pay_bmf_street_or_pobox');
223 $_SESSION[
"bmf"][
"personal_data"][
"firstname"] = $this->user_obj->getFirstname();
224 $_SESSION[
"bmf"][
"personal_data"][
"lastname"] = $this->user_obj->getLastname();
226 $_SESSION[
"bmf"][
"personal_data"][
"house_number"] =
$_POST[
"house_number"];
231 $_SESSION[
"bmf"][
"personal_data"][
"email"] = $this->user_obj->getEmail();
232 $_SESSION[
"bmf"][
"personal_data"][
"language"] = $this->user_obj->getLanguage();
234 if (
$_SESSION[
"bmf"][
"personal_data"][
"country"] !=
"DE")
236 if (
$_SESSION[
"bmf"][
"payment_type"] ==
"debit_entry")
256 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
257 $this->tpl->touchBlock(
"stop_floating");
264 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_payment_type.html',
'payment');
266 $this->tpl->setVariable(
"PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
270 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
271 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step2'));
272 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_payment_type'));
273 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_payment_type'));
274 $this->tpl->touchBlock(
"stop_floating");
275 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
278 if (
$_SESSION[
"bmf"][
"personal_data"][
"country"] ==
"DE")
280 $this->tpl->setVariable(
"TXT_DEBIT_ENTRY",$this->lng->txt(
'pay_bmf_debit_entry'));
282 $this->tpl->setVariable(
"TXT_CREDIT_CARD",$this->lng->txt(
'pay_bmf_credit_card'));
284 $this->tpl->setVariable(
"INPUT_VALUE",ucfirst($this->lng->txt(
'next')));
285 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
289 if ($this->error !=
"" &&
290 isset(
$_POST[
"payment_type"]))
292 $this->tpl->setVariable(
"PAYMENT_TYPE_" . strtoupper(
$_POST[
"payment_type"]),
" checked") ;
296 if ((
$_SESSION[
"bmf"][
"personal_data"][
"country"] !=
"DE" &&
$_POST[
"payment_type"] !=
"debit_entry") ||
297 $_SESSION[
"bmf"][
"personal_data"][
"country"] ==
"DE")
299 $this->tpl->setVariable(
"PAYMENT_TYPE_" . strtoupper(
$_SESSION[
"bmf"][
"payment_type"]),
" checked") ;
304 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
305 $this->tpl->setCurrentBlock(
"btn_cell");
306 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPersonalData"));
307 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
308 $this->tpl->parseCurrentBlock(
"btn_cell");
315 if ((
$_POST[
"payment_type"] !=
"credit_card" &&
$_POST[
"payment_type"] !=
"debit_entry") ||
316 (
$_SESSION[
"bmf"][
"personal_data"][
"country"] !=
"DE" &&
$_POST[
"payment_type"] ==
"debit_entry"))
318 $this->error = $this->lng->txt(
'pay_bmf_payment_type_not_valid');
327 if (
$_SESSION[
"bmf"][
"payment_type"] ==
"credit_card")
354 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
355 $this->tpl->touchBlock(
"stop_floating");
362 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_debit_entry.html',
'payment');
363 #$this->tpl = new ilTemplate('tpl.pay_bmf_debit_entry.html', true, true, 'payment');
367 $this->tpl->setVariable(
"DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
371 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
372 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step3_debit_entry'));
373 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_debit_entry_data'));
374 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_debit_entry'));
375 $this->tpl->touchBlock(
"stop_floating");
376 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
379 $this->tpl->setVariable(
"TXT_ACCOUNT_HOLDER",$this->lng->txt(
'pay_bmf_account_holder'));
380 $this->tpl->setVariable(
"TXT_OPTIONAL",$this->lng->txt(
'pay_bmf_optional'));
381 $this->tpl->setVariable(
"TXT_BANK_CODE",$this->lng->txt(
'pay_bmf_bank_code'));
382 $this->tpl->setVariable(
"TXT_ACCOUNT_NUMBER",$this->lng->txt(
'pay_bmf_account_number'));
383 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS",$this->lng->txt(
'pay_bmf_terms_conditions'));
384 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_READ",$this->lng->txt(
'pay_bmf_terms_conditions_read'));
385 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt(
'pay_bmf_terms_conditions_show'));
386 $this->tpl->setVariable(
"LINK_TERMS_CONDITIONS",
"./payment.php?view=conditions");
387 $this->tpl->setVariable(
"TXT_PASSWORD",$this->lng->txt(
'password'));
388 $this->tpl->setVariable(
"TXT_CONFIRM_ORDER",$this->lng->txt(
'pay_confirm_order'));
390 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_send_order'));
391 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
395 $this->tpl->setVariable(
"ACCOUNT_HOLDER",
396 $this->error !=
"" && isset(
$_POST[
'account_holder'])
399 $this->tpl->setVariable(
"BANK_CODE",
400 $this->error !=
"" && isset(
$_POST[
'bank_code'])
403 $this->tpl->setVariable(
"ACCOUNT_NUMBER",
404 $this->error !=
"" && isset(
$_POST[
'account_number'])
419 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
420 $this->tpl->setCurrentBlock(
"btn_cell");
421 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPaymentType"));
422 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
423 $this->tpl->parseCurrentBlock(
"btn_cell");
430 if (
$_POST[
"account_holder"] ==
"" ||
431 $_POST[
"bank_code"] ==
"" ||
432 $_POST[
"account_number"] ==
"")
434 $this->error = $this->lng->txt(
'pay_bmf_debit_entry_not_valid');
439 if (
$_POST[
"terms_conditions"] != 1)
441 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
446 if (
$_POST[
"password"] ==
"" ||
447 md5(
$_POST[
"password"]) != $this->user_obj->getPasswd())
449 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
456 $_SESSION[
"bmf"][
"debit_entry"][
"kontoinhaber"] =
$_POST[
"account_holder"];
467 $this->psc_obj->clearCouponItemsSession();
472 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
473 $this->tpl->touchBlock(
"stop_floating");
481 $newCustomer =
new Kunde($this->user_obj->getId());
483 $resultCustomerObj = $customer->anlegenKunde($newCustomer);
485 $resultCustomer = $resultCustomerObj->ergebnis;
487 if (is_object($resultCustomer))
489 if ($resultCustomer->code < 0)
491 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " . $resultCustomer->code .
": " . $resultCustomer->kurzText .
"<br>\n" . $resultCustomer->langText;
492 if ($resultCustomer->code == -103 ||
493 $resultCustomer->code == -104 ||
494 $resultCustomer->code == -107 ||
495 ($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
496 $resultCustomer->code == -213)
503 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
520 $tmp_bookEntries = $sc_obj->getShoppingCart();
521 if (!is_array($tmp_bookEntries))
528 for ($i = 0; $i < count($tmp_bookEntries); $i++)
534 $price = $tmp_bookEntries[$i][
"betrag"];
535 $tmp_bookEntries[$i][
"math_price"] = (float) $price;
539 $this->coupon_obj->setId($coupon[
"pc_pk"]);
540 $this->coupon_obj->setCurrentCoupon($coupon);
542 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i][
'pobject_id']);
544 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
546 $_SESSION[
"coupons"][
"bmf"][
$key][
"total_objects_coupon_price"] += (float) $price;
547 $_SESSION[
"coupons"][
"bmf"][
$key][
"items"][] = $tmp_bookEntries[$i];
557 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
559 $bookEntries[] =
new Buchung($tmp_bookEntries[$i]);
560 $totalAmount += $tmp_bookEntries[$i][
"betrag"];
564 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
568 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
570 if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
572 foreach ($coupon_discount_items as $item)
574 $item[
"betrag"] = $item[
"discount_price"];
575 $bookEntries[] =
new Buchung($item);
576 $totalAmount += $item[
"betrag"];
580 $values = array(
"betrag" => $totalAmount,
"buchungen" => $bookEntries);
581 $bookingList =
new BuchungsListe($this->user_obj->getId(), $values);
586 $resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr,
$address, $bank, $bookingList);
587 $result = $resultObj->ergebnis;
593 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
594 $this->tpl->touchBlock(
"stop_floating");
595 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " .
$result->code .
": " .
$result->kurzText .
"<br>\n" .
$result->langText;
605 else if (
$result->code == -507 ||
612 else if (
$result->code == -402 ||
627 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
635 $resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
636 $resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
637 $resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
638 $resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
639 $resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
640 $resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
641 $resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
642 $resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
645 $this->
__sendBill($resultCustomerObj->kunde,
$_SESSION[
"bmf"][
"payment_type"], $bookingList, $resultObj);
647 $this->
__addBookings($resultObj,$bookingList->getTransaction());
651 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
652 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_thanks'));
653 $this->tpl->touchBlock(
"stop_floating");
657 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_debit_entry.html',
'payment');
659 if ($this->ilias->getSetting(
"https") != 1)
661 $this->tpl->setCurrentBlock(
"buyed_objects");
662 #$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", "./payment.php?baseClass=ilpaymentbuyedobjectsgui&cmd=2");
663 #$link = $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui', 'showItems');
664 $link = $this->ctrl->getLinkTargetByClass(
'ilshopboughtobjectsgui');
665 $this->tpl->setVariable(
"LINK_GOTO_BUYED_OBJECTS", $link);
666 $this->tpl->setVariable(
"TXT_GOTO_BUYED_OBJECTS", $this->lng->txt(
'pay_goto_buyed_objects'));
667 $this->tpl->parseCurrentBlock(
"buyed_objects");
669 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW", $this->lng->txt(
'close_window'));
674 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
675 $this->tpl->touchBlock(
"stop_floating");
682 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
683 $this->tpl->touchBlock(
"stop_floating");
706 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
707 $this->tpl->touchBlock(
"stop_floating");
714 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_credit_card.html',
'payment');
715 #$this->tpl = new ilTemplate('tpl.pay_bmf_credit_card.html', true, true, 'payment');
718 $this->tpl->setVariable(
"CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
722 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
723 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step3_credit_card'));
724 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_credit_card_data'));
725 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_credit_card'));
726 $this->tpl->touchBlock(
"stop_floating");
727 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
730 $this->tpl->setVariable(
"TXT_CARD_HOLDER",$this->lng->txt(
'pay_bmf_card_holder'));
731 $this->tpl->setVariable(
"TXT_CHECK_NUMBER",$this->lng->txt(
'pay_bmf_check_number'));
732 $this->tpl->setVariable(
"TXT_OPTIONAL",$this->lng->txt(
'pay_bmf_optional'));
733 $this->tpl->setVariable(
"TXT_CARD_NUMBER",$this->lng->txt(
'pay_bmf_card_number'));
734 $this->tpl->setVariable(
"TXT_VALIDITY",$this->lng->txt(
'pay_bmf_validity'));
735 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS",$this->lng->txt(
'pay_bmf_terms_conditions'));
736 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_READ",$this->lng->txt(
'pay_bmf_terms_conditions_read'));
737 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt(
'pay_bmf_terms_conditions_show'));
738 $this->tpl->setVariable(
"LINK_TERMS_CONDITIONS",
"./payment.php?view=conditions");
739 $this->tpl->setVariable(
"TXT_PASSWORD",$this->lng->txt(
'password'));
740 $this->tpl->setVariable(
"TXT_CONFIRM_ORDER",$this->lng->txt(
'pay_confirm_order'));
742 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_send_order'));
743 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
747 $this->tpl->setVariable(
"CARD_HOLDER",
748 $this->error !=
"" && isset(
$_POST[
'card_holder'])
751 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_1",
752 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_1'])
755 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_2",
756 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_2'])
759 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_3",
760 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_3'])
763 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_4",
764 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_4'])
767 $this->tpl->setVariable(
"CHECK_NUMBER",
768 $this->error !=
"" && isset(
$_POST[
'check_number'])
771 for ($i = 1; $i <= 12; $i++)
773 $this->tpl->setCurrentBlock(
"loop_validity_months");
774 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS", $i < 10 ?
"0" . $i : $i);
775 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_TXT", $i < 10 ?
"0" . $i : $i);
776 if ($this->error !=
"" &&
777 isset(
$_POST[
'validity'][
'month']))
779 if (
$_POST[
'validity'][
'month'] == $i)
781 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_SELECTED",
" selected");
786 if (
$_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"monat"] == $i)
788 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_SELECTED",
" selected");
791 $this->tpl->parseCurrentBlock(
"loop_validity_months");
793 for ($i = date(
"Y"); $i <= (date(
"Y")+6); $i++)
795 $this->tpl->setCurrentBlock(
"loop_validity_years");
796 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS", $i);
797 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_TXT", $i);
798 if ($this->error !=
"" &&
799 isset(
$_POST[
'validity'][
'year']))
801 if (
$_POST[
'validity'][
'year'] == $i)
803 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_SELECTED",
" selected");
808 if (
$_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"jahr"] == $i)
810 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_SELECTED",
" selected");
813 $this->tpl->parseCurrentBlock(
"loop_validity_years");
827 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
828 $this->tpl->setCurrentBlock(
"btn_cell");
829 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPaymentType"));
830 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
831 $this->tpl->parseCurrentBlock(
"btn_cell");
838 if (
$_POST[
"card_holder"] ==
"" ||
839 $_POST[
"card_number"][
"block_1"] ==
"" ||
840 $_POST[
"card_number"][
"block_2"] ==
"" ||
841 $_POST[
"card_number"][
"block_3"] ==
"" ||
842 $_POST[
"card_number"][
"block_4"] ==
"" ||
843 $_POST[
"validity"][
"month"] ==
"" ||
844 $_POST[
"validity"][
"year"] ==
"" ||
845 $_POST[
"validity"][
"year"].
"-".
$_POST[
"validity"][
"month"] < date(
"Y-m"))
847 $this->error = $this->lng->txt(
'pay_bmf_credit_card_not_valid');
852 if (
$_POST[
"terms_conditions"] != 1)
854 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
859 if (
$_POST[
"password"] ==
"" ||
860 md5(
$_POST[
"password"]) != $this->user_obj->getPasswd())
862 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
868 $_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"monat"] =
$_POST[
"validity"][
"month"];
869 $_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"jahr"] =
$_POST[
"validity"][
"year"];
870 $_SESSION[
"bmf"][
"credit_card"][
"karteninhaber"] =
$_POST[
"card_holder"];
871 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_1"] =
$_POST[
"card_number"][
"block_1"];
872 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_2"] =
$_POST[
"card_number"][
"block_2"];
873 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_3"] =
$_POST[
"card_number"][
"block_3"];
874 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_4"] =
$_POST[
"card_number"][
"block_4"];
875 $_SESSION[
"bmf"][
"credit_card"][
"kartenpruefnummer"] =
$_POST[
"check_number"];
885 $this->psc_obj->clearCouponItemsSession();
890 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
891 $this->tpl->touchBlock(
"stop_floating");
899 $customer =
new Kunde($this->user_obj->getId());
905 $tmp_bookEntries = $sc_obj->getShoppingCart();
906 if (!is_array($tmp_bookEntries))
913 for ($i = 0; $i < count($tmp_bookEntries); $i++)
919 $price = $tmp_bookEntries[$i][
"betrag"];
920 $tmp_bookEntries[$i][
"math_price"] = (float) $price;
924 $this->coupon_obj->setId($coupon[
"pc_pk"]);
925 $this->coupon_obj->setCurrentCoupon($coupon);
927 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i][
'pobject_id']);
929 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
931 $_SESSION[
"coupons"][
"bmf"][
$key][
"total_objects_coupon_price"] += (float) $price;
932 $_SESSION[
"coupons"][
"bmf"][
$key][
"items"][] = $tmp_bookEntries[$i];
943 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
945 $bookEntries[] =
new Buchung($tmp_bookEntries[$i]);
946 $totalAmount += $tmp_bookEntries[$i][
"betrag"];
950 $tmp_bookEntries[$i][
"betrag_string"] = number_format( (
float) $tmp_bookEntries[$i][
"betrag"] , 2,
",",
".");
954 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
956 if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
958 foreach ($coupon_discount_items as $item)
960 $item[
"betrag"] = $item[
"discount_price"];
961 $bookEntries[] =
new Buchung($item);
962 $totalAmount += $item[
"discount_price"];
966 $values = array(
"betrag" => $totalAmount,
"buchungen" => $bookEntries);
967 $bookingList =
new BuchungsListe($this->user_obj->getId(), $values);
970 $resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
971 $result = $resultObj->ergebnis;
979 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
980 $this->tpl->touchBlock(
"stop_floating");
981 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " .
$result->code .
": " .
$result->kurzText .
"<br>\n" .
$result->langText;
991 else if (
$result->code == -507 ||
998 else if (
$result->code == -701 ||
1010 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
1022 $this->
__addBookings($resultObj,$bookingList->getTransaction());
1026 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
1027 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_thanks'));
1028 $this->tpl->touchBlock(
"stop_floating");
1032 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_credit_card.html',
'payment');
1033 #$this->tpl = new ilTemplate('tpl.pay_bmf_credit_card.html', true, true, 'payment');
1034 if ($this->ilias->getSetting(
"https") != 1)
1036 $this->tpl->setCurrentBlock(
"buyed_objects");
1037 #$this->ctrl->redirectByClass("ilPaymentBuyedObjectsGUI", "ilpaymentbuyedobjectsgui");
1038 #$link = $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui', 'showItems');
1039 $link = $this->ctrl->getLinkTargetByClass(
'ilshopboughtobjectsgui');
1040 $this->tpl->setVariable(
"LINK_GOTO_BUYED_OBJECTS", $link);
1041 $this->tpl->setVariable(
"TXT_GOTO_BUYED_OBJECTS", $this->lng->txt(
'pay_goto_buyed_objects'));
1042 $this->tpl->parseCurrentBlock(
"buyed_objects");
1044 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW", $this->lng->txt(
'close_window'));
1050 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
1051 $this->tpl->touchBlock(
"stop_floating");
1066 $cmd = $this->ctrl->getCmd();
1068 switch ($this->ctrl->getNextClass($this))
1072 if(!
$cmd = $this->ctrl->getCmd())
1074 $cmd =
'showPersonalData';
1084 include_once
'./classes/class.ilTemplate.php';
1085 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1086 include_once
'./payment/classes/class.ilGeneralSettings.php';
1087 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
1088 include_once
'Services/Mail/classes/class.ilMimeMail.php';
1093 $tpl =
new ilTemplate(
"./payment/templates/default/tpl.pay_bmf_bill.html",
true,
true,
true);
1095 $tpl->setVariable(
"VENDOR_ADDRESS", nl2br(utf8_decode($genSet->get(
"address"))));
1096 $tpl->setVariable(
"VENDOR_ADD_INFO", nl2br(utf8_decode($genSet->get(
"add_info"))));
1097 $tpl->setVariable(
"VENDOR_BANK_DATA", nl2br(utf8_decode($genSet->get(
"bank_data"))));
1098 $tpl->setVariable(
"TXT_BANK_DATA", utf8_decode($this->lng->txt(
"pay_bank_data")));
1100 $tpl->setVariable(
"CUSTOMER_FIRSTNAME", $customer->vorname);
1101 $tpl->setVariable(
"CUSTOMER_LASTNAME", $customer->nachname);
1102 if ($customer->rechnungsAdresse->strasse !=
"" &&
1103 $customer->rechnungsAdresse->hausNr !=
"")
1105 $tpl->setVariable(
"CUSTOMER_STREET_POBOX", $customer->rechnungsAdresse->strasse .
" ". $customer->rechnungsAdresse->hausNr);
1109 $tpl->setVariable(
"CUSTOMER_STREET_POBOX", $customer->rechnungsAdresse->postfach);
1111 $tpl->setVariable(
"CUSTOMER_ZIPCODE", $customer->rechnungsAdresse->PLZ);
1112 $tpl->setVariable(
"CUSTOMER_CITY", $customer->rechnungsAdresse->ort);
1113 $tpl->setVariable(
"CUSTOMER_COUNTRY", $this->
__getCountryName($customer->rechnungsAdresse->land));
1115 $tpl->setVariable(
"BILL_NO",
$result->buchungsListe->kassenzeichen);
1116 $tpl->setVariable(
"DATE", date(
"d.m.Y"));
1118 $tpl->setVariable(
"TXT_BILL", utf8_decode($this->lng->txt(
"pays_bill")));
1119 $tpl->setVariable(
"TXT_BILL_NO", utf8_decode($this->lng->txt(
"pay_bill_no")));
1120 $tpl->setVariable(
"TXT_DATE", utf8_decode($this->lng->txt(
"date")));
1122 $tpl->setVariable(
"TXT_ARTICLE", utf8_decode($this->lng->txt(
"pay_article")));
1123 $tpl->setVariable(
'TXT_VAT_RATE', utf8_decode($this->lng->txt(
'vat_rate')));
1124 $tpl->setVariable(
'TXT_VAT_UNIT', utf8_decode($this->lng->txt(
'vat_unit')));
1125 $tpl->setVariable(
"TXT_PRICE", utf8_decode($this->lng->txt(
"price_a")));
1127 $bookEntries = $sc_obj->getShoppingCart();
1128 for ($i = 0; $i < count($bookEntries); $i++)
1130 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $bookEntries[$i][
'pobject_id']);
1132 $assigned_coupons =
'';
1133 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1137 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1138 $this->coupon_obj->setCurrentCoupon($coupon);
1140 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1142 $assigned_coupons .=
'<br />' . $this->lng->txt(
'paya_coupons_coupon') .
': ' . $coupon[
"pcc_code"];
1147 $tpl->setCurrentBlock(
"loop");
1148 $tpl->setVariable(
"LOOP_OBJ_TYPE", utf8_decode($this->lng->txt($bookEntries[$i][
"typ"])));
1149 $tpl->setVariable(
"LOOP_TITLE", $bookEntries[$i][
"buchungstext"]. $assigned_coupons);
1150 $tpl->setVariable(
"LOOP_TXT_ENTITLED_RETRIEVE", utf8_decode($this->lng->txt(
"pay_entitled_retrieve")));
1151 $tpl->setVariable(
"LOOP_DURATION", $bookEntries[$i][
"dauer"] .
" " . utf8_decode($this->lng->txt(
"paya_months")));
1155 $totalVat += (float)$bookEntries[$i][
'vat_unit'];
1157 $tpl->setVariable(
"LOOP_PRICE", number_format($bookEntries[$i][
"betrag"], 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1158 $tpl->parseCurrentBlock(
"loop");
1160 unset($tmp_pobject);
1163 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1165 if (count($items = $bookEntries))
1167 $sub_total_amount = $bookingList->betrag;
1169 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1171 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1172 $this->coupon_obj->setCurrentCoupon($coupon);
1174 $total_object_price = 0.0;
1175 $current_coupon_bonus = 0.0;
1177 foreach ($bookEntries as $item)
1179 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $item[
'pobject_id']);
1181 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1183 $total_object_price += $item[
"betrag"];
1186 unset($tmp_pobject);
1189 $current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
1191 $sub_total_amount += $current_coupon_bonus;
1193 $tpl->setCurrentBlock(
"cloop");
1194 $tpl->setVariable(
"TXT_COUPON", utf8_decode($this->lng->txt(
"paya_coupons_coupon") .
" " . $coupon[
"pcc_code"]));
1195 $tpl->setVariable(
"BONUS", number_format($current_coupon_bonus * (-1), 2,
',',
'.') .
" " . $genSet->get(
"currency_unit"));
1196 $tpl->parseCurrentBlock();
1199 $tpl->setVariable(
"TXT_SUBTOTAL_AMOUNT", utf8_decode($this->lng->txt(
"pay_bmf_subtotal_amount")));
1200 $tpl->setVariable(
"SUBTOTAL_AMOUNT", number_format($sub_total_amount, 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1204 if ($bookingList->betrag < 0) $bookingList->betrag = 0.0;
1206 $tpl->setVariable(
"TXT_TOTAL_AMOUNT", utf8_decode($this->lng->txt(
"pay_bmf_total_amount")));
1207 $tpl->setVariable(
"TOTAL_AMOUNT", number_format($bookingList->betrag, 2,
",",
".") .
" " . $genSet->get(
"currency_unit"));
1209 if ($this->totalVat > 0)
1212 $tpl->setVariable(
"TXT_TOTAL_VAT", utf8_decode($this->lng->txt(
"pay_bmf_vat_included")));
1215 if ($paymentType ==
"debit_entry")
1217 $tpl->setVariable(
"TXT_PAYMENT_TYPE", utf8_decode($this->lng->txt(
"pay_payed_debit_entry")));
1221 $tpl->setVariable(
"TXT_PAYMENT_TYPE", utf8_decode($this->lng->txt(
"pay_payed_credit_card")));
1224 if (!@file_exists($genSet->get(
"pdf_path")))
1229 if (@file_exists($genSet->get(
"pdf_path")))
1234 if (@file_exists($genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".pdf") &&
1235 $customer->EMailAdresse !=
"" &&
1236 $this->ilias->getSetting(
"admin_email") !=
"")
1239 $m->
From( $this->ilias->getSetting(
"admin_email") );
1240 $m->To( $customer->EMailAdresse );
1241 $m->Subject( $this->lng->txt(
"pay_message_subject") );
1242 $message = $this->lng->txt(
"pay_message_hello") .
" " . utf8_encode($customer->vorname) .
" " . utf8_encode($customer->nachname) .
",\n\n";
1243 $message .= $this->lng->txt(
"pay_message_thanks") .
"\n\n";
1244 $message .= $this->lng->txt(
"pay_message_attachment") .
"\n\n";
1245 $message .= $this->lng->txt(
"pay_message_regards") .
"\n\n";
1246 $message .= strip_tags($genSet->get(
"address"));
1247 $m->Body( $message );
1248 $m->Attach( $genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".pdf",
"application/pdf" ) ;
1252 @unlink($genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".html");
1253 @unlink($genSet->get(
"pdf_path") .
"/" .
$result->buchungsListe->kassenzeichen .
".pdf");
1259 global $ilObjDataCache;
1261 include_once
'./payment/classes/class.ilPaymentBookings.php';
1262 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
1263 include_once
'./payment/classes/class.ilPaymentObject.php';
1264 include_once
'./payment/classes/class.ilPaymentPrices.php';
1265 include_once
'./Services/Payment/classes/class.ilShopUtils.php';
1273 $sc_obj->clearCouponItemsSession();
1275 foreach($items as $entry)
1277 $pobject =&
new ilPaymentObject($this->user_obj,$entry[
'pobject_id']);
1281 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1283 $entry[
"math_price"] = $entry[
'price'];
1286 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1287 $this->coupon_obj->setCurrentCoupon($coupon);
1289 if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
1291 $_SESSION[
"coupons"][
"bmf"][
$key][
"total_objects_coupon_price"] += $entry[
'price'];
1300 $coupon_discount_items = $sc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
1303 foreach($items as $entry)
1305 $pobject =&
new ilPaymentObject($this->user_obj,$entry[
'pobject_id']);
1309 if (array_key_exists($entry[
"pobject_id"], $coupon_discount_items))
1311 $bonus = $coupon_discount_items[$entry[
"pobject_id"]][
"math_price"] - $coupon_discount_items[$entry[
"pobject_id"]][
"discount_price"];
1314 $booking_obj->setTransaction($a_transaction);
1315 $booking_obj->setPobjectId($entry[
'pobject_id']);
1316 $booking_obj->setCustomerId($this->user_obj->getId());
1317 $booking_obj->setVendorId($pobject->getVendorId());
1318 $booking_obj->setPayMethod($pobject->getPayMethod());
1319 $booking_obj->setOrderDate(time());
1320 $booking_obj->setDuration($price[
'duration']);
1324 $booking_obj->setPayed(1);
1325 $booking_obj->setAccess(1);
1326 $booking_obj->setVoucher($a_result->buchungsListe->buchungen[$i++]->belegNr);
1327 $booking_obj->setTransactionExtern($a_result->buchungsListe->kassenzeichen);
1329 $obj_id = $ilObjDataCache->lookupObjId($pobject->getRefId());
1330 $obj_title = $ilObjDataCache->lookupTitle($obj_id);
1332 $oVAT =
new ilShopVats((
int)$pobject->getVatId());
1333 $obj_vat_rate = $oVAT->
getRate();
1336 $booking_obj->setObjectTitle($obj_title);
1337 $booking_obj->setVatRate($obj_vat_rate);
1338 $booking_obj->setVatUnit($obj_vat_unit);
1341 include_once
'./payment/classes/class.ilPayMethods.php';
1345 if($save_user_adr_bmf == 1)
1347 $booking_obj->setStreet(
$_SESSION[
'bmf'][
'personal_data'][
'street'],
$_SESSION[
'bmf'][
'personal_data'][
'house_number']);
1348 $booking_obj->setPoBox(
$_SESSION[
'bmf'][
'personal_data'][
'po_box']);
1349 $booking_obj->setZipcode(
$_SESSION[
'bmf'][
'personal_data'][
'zipcode']);
1350 $booking_obj->setCity(
$_SESSION[
'bmf'][
'personal_data'][
'city']);
1351 $booking_obj->setCountry(
$_SESSION[
'bmf'][
'personal_data'][
'country']);
1354 $current_booking_id = $booking_obj->add();
1356 if (!empty(
$_SESSION[
"coupons"][
"bmf"]) && $current_booking_id)
1358 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1360 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1361 $this->coupon_obj->setCurrentCoupon($coupon);
1363 if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
1365 $this->coupon_obj->addCouponForBookingId($current_booking_id);
1370 unset($current_booking_id);
1374 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1376 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1378 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1379 $this->coupon_obj->setCurrentCoupon($coupon);
1380 $this->coupon_obj->addTracking();
1387 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
1391 return $sc_obj->emptyShoppingCart();
1398 $_SESSION[
"bmf"][
"debit_entry"] = array();
1399 $_SESSION[
"bmf"][
"credit_card"] = array();
1404 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.payb_content.html");
1412 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1413 # $this->__buildLocator();
1418 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
1419 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
1421 $this->tpl->setCurrentBlock(
"locator_item");
1422 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"personal_desktop"));
1423 $this->tpl->setVariable(
"LINK_ITEM",
"../ilias.php?baseClass=ilPersonalDesktopGUI");
1424 #$this->tpl->setVariable("LINK_ITEM", "../usr_personaldesktop.php");
1425 $this->tpl->parseCurrentBlock();
1427 $this->tpl->setCurrentBlock(
"locator_item");
1428 $this->tpl->setVariable(
"PREFIX",
'> ');
1429 # $this->tpl->setVariable("ITEM", $this->lng->txt("pay_locator"));
1430 $this->tpl->setVariable(
"ITEM",
"Payment");
1431 $this->tpl->setVariable(
"LINK_ITEM",
"./payment.php");
1432 $this->tpl->parseCurrentBlock();
1451 foreach($countries as $code => $text)
1453 $tpl->setCurrentBlock(
"loop_countries");
1454 $tpl->setVariable(
"LOOP_COUNTRIES", $code);
1455 $tpl->setVariable(
"LOOP_COUNTRIES_TXT", $text);
1459 $tpl->setVariable(
"LOOP_COUNTRIES_SELECTED",
" selected");
1461 $tpl->parseCurrentBlock(
"loop_countries");
1463 $tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"pay_bmf_please_select"));
1471 $lng->loadLanguageModule(
"meta");
1473 $cntcodes = array (
"DE",
"ES",
"FR",
"GB",
"AT",
"CH",
"AF",
"AL",
"DZ",
"AS",
"AD",
"AO",
1474 "AI",
"AQ",
"AG",
"AR",
"AM",
"AW",
"AU",
"AT",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BY",
1475 "BE",
"BZ",
"BJ",
"BM",
"BT",
"BO",
"BA",
"BW",
"BV",
"BR",
"IO",
"BN",
"BG",
"BF",
1476 "BI",
"KH",
"CM",
"CA",
"CV",
"KY",
"CF",
"TD",
"CL",
"CN",
"CX",
"CC",
"CO",
"KM",
1477 "CG",
"CK",
"CR",
"CI",
"HR",
"CU",
"CY",
"CZ",
"DK",
"DJ",
"DM",
"DO",
"TP",
"EC",
1478 "EG",
"SV",
"GQ",
"ER",
"EE",
"ET",
"FK",
"FO",
"FJ",
"FI",
"FR",
"FX",
"GF",
"PF",
1479 "TF",
"GA",
"GM",
"GE",
"DE",
"GH",
"GI",
"GR",
"GL",
"GD",
"GP",
"GU",
"GT",
"GN",
1480 "GW",
"GY",
"HT",
"HM",
"HN",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IL",
"IT",
1481 "JM",
"JP",
"JO",
"KZ",
"KE",
"KI",
"KP",
"KR",
"KW",
"KG",
"LA",
"LV",
"LB",
"LS",
1482 "LR",
"LY",
"LI",
"LT",
"LU",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"ML",
"MT",
"MH",
1483 "MQ",
"MR",
"MU",
"YT",
"MX",
"FM",
"MD",
"MC",
"MN",
"MS",
"MA",
"MZ",
"MM",
"NA",
1484 "NR",
"NP",
"NL",
"AN",
"NC",
"NZ",
"NI",
"NE",
"NG",
"NU",
"NF",
"MP",
"NO",
"OM",
1485 "PK",
"PW",
"PA",
"PG",
"PY",
"PE",
"PH",
"PN",
"PL",
"PT",
"PR",
"QA",
"RE",
"RO",
1486 "RU",
"RW",
"KN",
"LC",
"VC",
"WS",
"SM",
"ST",
"SA",
"CH",
"SN",
"SC",
"SL",
"SG",
1487 "SK",
"SI",
"SB",
"SO",
"ZA",
"GS",
"ES",
"LK",
"SH",
"PM",
"SD",
"SR",
"SJ",
"SZ",
1488 "SE",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TG",
"TK",
"TO",
"TT",
"TN",
"TR",
"TM",
"TC",
1489 "TV",
"UG",
"UA",
"AE",
"GB",
"UY",
"US",
"UM",
"UZ",
"VU",
"VA",
"VE",
"VN",
"VG",
1490 "VI",
"WF",
"EH",
"YE",
"ZR",
"ZM",
"ZW");
1492 foreach($cntcodes as $cntcode)
1494 $cntrs[$cntcode] = $lng->txt(
"meta_c_".$cntcode);
1503 foreach($countries as $code => $text)
1505 if ($text == $value)
1516 return $countries[$value];
1573 include_once
'./payment/classes/class.ilGeneralSettings.php';
1584 foreach($items as $item)
1587 $tmp_pobject =&
new ilPaymentObject($this->user_obj,$item[
'pobject_id']);
1593 $assigned_coupons =
'';
1594 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1598 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1599 $this->coupon_obj->setCurrentCoupon($coupon);
1601 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1603 $assigned_coupons .=
'<br />' . $this->lng->txt(
'paya_coupons_coupon') .
': ' . $coupon[
"pcc_code"];
1608 $f_result[$counter][] = $tmp_obj->getTitle();
1609 if ($assigned_coupons !=
'') $f_result[$counter][count($f_result[$counter]) - 1] .= $assigned_coupons;
1612 if($price_arr[
'duration'] == 0)
1614 $f_result[$counter][] = $this->lng->txt(
'unlimited_duration');
1618 $f_result[$counter][] = $price_arr[
'duration'] .
' ' . $this->lng->txt(
'paya_months');
1621 $oVAT =
new ilShopVats((
int)$tmp_pobject->getVatId());
1624 $float_price = $price_arr[
'price'];
1626 $f_result[$counter][] = $tmp_pobject->getVat($float_price,
'GUI').
' '.$genSet->get(
'currency_unit');
1627 $this->totalVat = $this->totalVat + $tmp_pobject->getVat($float_price);
1632 unset($tmp_pobject);
1642 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1650 include_once
'./payment/classes/class.ilGeneralSettings.php';
1655 $tpl =& $tbl->getTemplateObject();
1658 $tpl->setCurrentBlock(
"tbl_form_header");
1660 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1661 $tpl->parseCurrentBlock();
1663 $tbl->setTitle($this->lng->txt(
"paya_shopping_cart"),
"icon_pays_b.gif",$this->lng->txt(
"paya_shopping_cart"));
1664 $tbl->setHeaderNames(array($this->lng->txt(
"title"),
1665 $this->lng->txt(
"duration"),
1666 $this->lng->txt(
'vat_rate'),
1667 $this->lng->txt(
'vat_unit'),
1668 $this->lng->txt(
"price_a")));
1670 $tbl->setHeaderVars(array(
"title",
1676 "cmdClass" =>
"ilpurchasebmfgui",
1677 "cmdNode" =>
$_GET[
"cmdNode"]));
1679 $tbl->disable(
"footer");
1680 $tbl->disable(
"sort");
1681 $tbl->disable(
"linkbar");
1683 $offset =
$_GET[
"offset"];
1684 $order =
$_GET[
"sort_by"];
1685 $direction =
$_GET[
"sort_order"] ?
$_GET[
'sort_order'] :
'desc';
1687 $tbl->setOrderColumn($order,
'title');
1688 $tbl->setOrderDirection($direction);
1689 $tbl->setOffset($offset);
1690 $tbl->setLimit(
$_GET[
"limit"]);
1691 $tbl->setMaxCount(count($a_result_set));
1692 # $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
1693 $tbl->setData($a_result_set);
1697 $totalAmount = $sc_obj->getTotalAmount();
1699 $tpl->setCurrentBlock(
"tbl_footer_linkbar");
1700 $amount .=
"<table class=\"\" style=\"float: right;\">\n";
1701 if (!empty(
$_SESSION[
"coupons"][
"bmf"]))
1707 $amount .=
"<tr>\n";
1708 $amount .=
"<td>\n";
1709 $amount .=
"<b>" . $this->lng->txt(
"pay_bmf_subtotal_amount") .
":";
1710 $amount .=
"</td>\n";
1711 $amount .=
"<td>\n";
1712 $amount .= number_format($totalAmount[
PAY_METHOD_BMF], 2,
',',
'.') .
" " . $genSet->get(
"currency_unit") .
"</b>";
1713 $amount .=
"</td>\n";
1714 $amount .=
"</tr>\n";
1716 foreach (
$_SESSION[
"coupons"][
"bmf"] as $coupon)
1718 $this->coupon_obj->setCurrentCoupon($coupon);
1719 $this->coupon_obj->setId($coupon[
"pc_pk"]);
1721 $total_object_price = 0.0;
1722 $current_coupon_bonus = 0.0;
1724 foreach ($items as $item)
1726 $tmp_pobject =&
new ilPaymentObject($this->user_obj, $item[
'pobject_id']);
1728 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1731 $price = (float) $price_data[
"price"];
1733 $total_object_price += $price;
1736 unset($tmp_pobject);
1739 $current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
1742 $amount .=
"<tr>\n";
1743 $amount .=
"<td>\n";
1744 $amount .= $this->lng->txt(
"paya_coupons_coupon") .
" " . $coupon[
"pcc_code"] .
":";
1745 $amount .=
"</td>\n";
1746 $amount .=
"<td>\n";
1747 $amount .= number_format($current_coupon_bonus * (-1), 2,
',',
'.') .
" " . $genSet->get(
"currency_unit");
1748 $amount .=
"</td>\n";
1749 $amount .=
"</tr>\n";
1753 if ($totalAmount[PAY_METHOD_BMF] < 0)
1756 $this->totalVat = 0;
1761 $amount .=
"<tr>\n";
1762 $amount .=
"<td>\n";
1763 $amount .=
"<b>" . $this->lng->txt(
"pay_bmf_total_amount") .
":";
1764 $amount .=
"</td>\n";
1765 $amount .=
"<td>\n";
1766 $amount .= number_format($totalAmount[
PAY_METHOD_BMF], 2,
',',
'.') .
" " . $genSet->get(
"currency_unit");
1767 $amount .=
"</td>\n";
1768 $amount .=
"</tr>\n";
1770 if ($this->totalVat > 0)
1772 $amount .=
"<tr>\n";
1773 $amount .=
"<td>\n";
1774 $amount .= $this->lng->txt(
'pay_bmf_vat_included') .
":";
1775 $amount .=
"</td>\n";
1776 $amount .=
"<td>\n";
1778 $amount .=
"</td>\n";
1779 $amount .=
"</tr>\n";
1782 $amount .=
"</table>\n";
1784 $tpl->setVariable(
"LINKBAR", $amount);
1785 $tpl->parseCurrentBlock(
"tbl_footer_linkbar");
1786 $tpl->setCurrentBlock(
'tbl_footer');
1787 $tpl->setVariable(
'COLUMN_COUNT',5);
1788 $tpl->parseCurrentBlock();
1791 $this->tpl->setVariable(
"ITEMS_TABLE",$tbl->tpl->get());
1808 $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"])));
1818 'kunde' => $customer
1821 $result = $this->_soapClient->call(
"anlegenKunde", $tmp,
"KundenstammdatenPflegeWS");
1836 $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"])));
1846 'kreditkarte' => $creditCard,
1847 'waehrungskennzeichen' =>
$bmfConfig[
"waehrungskennzeichen"]
1850 $result = $this->_soapClient->call(
"validierenKreditkarte", $tmp,
"KreditkartenzahlungWS");
1863 'Kunde' => $customer,
1864 'Kreditkarte' => $creditCard,
1865 'buchungsListe' => $bookingList,
1866 'lieferadresse' => $lieferadresse
1869 $result = $this->_soapClient->call(
"zahlenUndAnlegenKunde", $tmp,
"KreditkartenzahlungWS");
1884 $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"])));
1894 'eShopKundenNr' => $eShopCustomerNumber,
1896 'bankverbindung' => $bank,
1897 'buchungsListe' => $bookingList
1900 $result = $this->_soapClient->call(
"abbuchenOhneEinzugsermaechtigung", $tmp,
"LastschriftWS");
1908 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Kunde');
1910 function Kunde ($customerNumber =
"", $values =
"")
1918 $this->EShopKundenNr = time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1919 if ($customerNumber !=
"")
1921 $this->EShopKundenNr = $customerNumber .
"_" . time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1927 $values =
$_SESSION[
"bmf"][
"personal_data"];
1930 if ($values[
"language"] != NULL)
1932 $this->sprache = $values[
"language"];
1934 if ($values[
"firstname"] != NULL)
1936 $this->vorname = utf8_decode($values[
"firstname"]);
1938 if ($values[
"lastname"] != NULL)
1940 $this->nachname = utf8_decode($values[
"lastname"]);
1942 if ($values[
"email"] != NULL)
1944 $this->EMailAdresse = utf8_decode($values[
"email"]);
1949 $this->rechnungsAdresse =
$address;
1954 return $this->EShopKundenNr;
1961 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Adresse');
1967 $values =
$_SESSION[
"bmf"][
"personal_data"];
1970 if (is_array($values))
1972 if ($values[
"street"] != NULL)
1974 $this->strasse = utf8_decode($values[
"street"]);
1976 if ($values[
"house_number"] != NULL)
1978 $this->hausNr = utf8_decode($values[
"house_number"]);
1980 if ($values[
"po_box"] != NULL)
1982 $this->postfach = utf8_decode($values[
"po_box"]);
1984 if ($values[
"country"] != NULL)
1986 $this->land = utf8_decode($values[
"country"]);
1988 if ($values[
"zipcode"] != NULL)
1990 $this->PLZ = utf8_decode($values[
"zipcode"]);
1992 if ($values[
"city"] != NULL)
1994 $this->ort = utf8_decode($values[
"city"]);
2003 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Kreditkarte');
2009 $values =
$_SESSION[
"bmf"][
"credit_card"];
2012 if (is_array($values))
2014 if ($values[
"karteninhaber"] != NULL)
2016 $this->karteninhaber = utf8_decode($values[
"karteninhaber"]);
2018 if ($values[
"kartenpruefnummer"] != NULL)
2020 $this->kartenpruefnummer = utf8_decode($values[
"kartenpruefnummer"]);
2022 if (is_array ($values[
"kreditkartenNr"]) &&
2023 count($values[
"kreditkartenNr"]) == 4)
2025 for ($i = 1; $i <= count($values[
"kreditkartenNr"]); $i++)
2027 $this->kreditkartenNr .= utf8_decode($values[
"kreditkartenNr"][
"block_".$i]);# .
"-";
2029 # $this->kreditkartenNr = substr($this->kreditkartenNr, 0, strlen($this->kreditkartenNr)-1);
2031 if (is_array($values[
"gueltigkeit"]) &&
2032 $values[
"gueltigkeit"][
"monat"] !=
"" &&
2033 $values[
"gueltigkeit"][
"jahr"] !=
"")
2035 $this->gueltigkeit = utf8_decode($values[
"gueltigkeit"][
"monat"]);
2036 $this->gueltigkeit .= utf8_decode($values[
"gueltigkeit"][
"jahr"]);
2045 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Lastschrift');
2049 $this->EShopKundenNr = time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
2050 if ($customerNumber !=
"")
2052 $this->EShopKundenNr = $customerNumber .
"_" . time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
2060 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Bankverbindung');
2066 $values =
$_SESSION[
"bmf"][
"debit_entry"];
2069 if (is_array($values))
2071 if ($values[
"kontoinhaber"] != NULL)
2073 $this->kontoinhaber = utf8_decode($values[
"kontoinhaber"]);
2075 if ($values[
"kontoNr"] != NULL)
2077 $this->kontoNr = utf8_decode($values[
"kontoNr"]);
2079 if ($values[
"BLZ"] != NULL)
2081 $this->BLZ = utf8_decode($values[
"BLZ"]);
2090 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');
2099 $this->haushaltsstelle =
$bmfConfig[
"haushaltsstelle"];
2103 $this->objektnummer =
$bmfConfig[
"objektNr"];
2106 if (is_array($values))
2108 if ($values[
"buchungstext"] != NULL)
2110 $buchungstext = utf8_decode($values[
"buchungstext"]);
2111 if(strlen($buchungstext) > 16)
2113 $buchungstext = substr($buchungstext,0,15).
'...';
2116 $this->buchungstext = $buchungstext;
2118 if ($values[
"betrag"] !=
"")
2120 $this->betrag = $values[
"betrag"];
2128 if ($voucherNumber != NULL)
2130 $this->belegNr = $voucherNumber;
2136 return $this->belegNr;
2142 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment',
'nsPrefix' =>
'ns2',
'type' =>
'BuchungsListe');
2153 $this->bewirtschafterNr =
$bmfConfig[
"bewirtschafterNr"];
2155 if (
$bmfConfig[
"waehrungskennzeichen"] != NULL)
2157 $this->waehrungskennzeichen =
$bmfConfig[
"waehrungskennzeichen"];
2159 $this->faelligkeitsdatum = date(
"Y-m-d") .
"T" . date(
"H:i:s") .
"Z";
2160 if (
$bmfConfig[
"kennzeichenMahnverfahren"] != NULL)
2162 $this->kennzeichenMahnverfahren =
$bmfConfig[
"kennzeichenMahnverfahren"];
2165 $inst_id_time = $ilias->getSetting(
'inst_id').
'_'.$userId.
'_'.substr((
string) time(),-3);
2166 $this->EShopTransaktionsNr = $inst_id_time.substr(md5(uniqid(rand(),
true)), 0, 4);
2168 if (is_array($values))
2170 if ($values[
"betrag"] != NULL)
2172 $this->betrag = $values[
"betrag"];
2174 if ($values[
"buchungen"] != NULL)
2176 $this->buchungen = $values[
"buchungen"];
2182 return $this->EShopTransaktionsNr;
2188 if ($kassenzeichen != NULL)
2190 $this->kassenzeichen = $kassenzeichen;
2196 return $this->kassenzeichen;
2203 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'LieferAdresse');
2209 $values =
$_SESSION[
"bmf"][
"personal_data"];
2212 if (is_array($values))
2214 if ($values[
"firstname"] != NULL)
2216 $this->vorname = utf8_decode($values[
"firstname"]);
2218 if ($values[
"lastname"] != NULL)
2220 $this->nachname = utf8_decode($values[
"lastname"]);
2222 if ($values[
"street"] != NULL)
2224 $this->strasse = utf8_decode($values[
"street"]);
2226 if ($values[
"house_number"] != NULL)
2228 $this->hausNr = utf8_decode($values[
"house_number"]);
2230 if ($values[
"po_box"] != NULL)
2232 $this->postfach = utf8_decode($values[
"po_box"]);
2234 if ($values[
"country"] != NULL)
2236 $this->land = utf8_decode($values[
"country"]);
2238 if ($values[
"zipcode"] != NULL)
2240 $this->PLZ = utf8_decode($values[
"zipcode"]);
2242 if ($values[
"city"] != NULL)
2244 $this->ort = utf8_decode($values[
"city"]);