18 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
19 #include_once dirname(__FILE__)."/../bmf/lib/ePayment/cfg_epayment.inc.php";
20 include_once dirname(__FILE__).
"/../bmf/lib/SOAP/class.ilBMFClient.php";
22 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
23 include_once
'./Services/Payment/classes/class.ilPurchaseBaseGUI.php';
64 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
67 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
68 $this->tpl->touchBlock(
"stop_floating");
74 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step1'));
75 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_personal_data'));
76 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_personal_data'));
78 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
81 $oForm->setFormAction($this->ctrl->getFormAction($this,
'getPersonalData'));
82 $oForm->setTitle($this->lng->txt(
'pay_bmf_personal_data'));
85 $oFirstname->
setValue($this->user_obj->getFirstname());
86 $oForm->addItem($oFirstname);
89 $oLastname->
setValue($this->user_obj->getLastname());
90 $oForm->addItem($oLastname);
96 $oForm->addItem($oStreet);
98 $oHouseNumber =
new ilTextInputGUI($this->lng->txt(
'pay_bmf_house_number'),
'house_number');
99 $oHouseNumber->
setValue($this->error !=
'' && isset(
$_POST[
'house_number'])
102 $oForm->addItem($oHouseNumber);
104 $oPoBox =
new ilTextInputGUI($this->lng->txt(
'pay_bmf_or').
' '.$this->lng->txt(
'pay_bmf_po_box'),
'po_box');
108 $oForm->addItem($oPoBox);
110 $oZipCode =
new ilTextInputGUI($this->lng->txt(
'zipcode'),
'zipcode');
111 $oZipCode->
setValue($this->error !=
'' && isset(
$_POST[
'zipcode'])
114 $oForm->addItem($oZipCode);
120 $oForm->addItem($oCity);
125 $oCountry->setValue($this->error !=
'' && isset(
$_POST[
'country']) ?
$_POST[
'country']
126 :
$_SESSION[
'bmf'][
'personal_data'][
'country']);
127 $oForm->addItem($oCountry);
130 $oEmail->
setValue($this->user_obj->getEmail());
131 $oForm->addItem($oEmail);
133 $oForm->addcommandButton(
'getPersonalData',ucfirst($this->lng->txt(
'next')));
134 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
142 if (
$_SESSION[
"bmf"][
"personal_data"][
"firstname"] ==
"" ||
143 $_SESSION[
"bmf"][
"personal_data"][
"lastname"] ==
"" ||
144 $_POST[
"zipcode"] ==
"" ||
146 $_POST[
"country"] ==
"" ||
147 $_SESSION[
"bmf"][
"personal_data"][
"email"] ==
"")
149 $this->error = $this->lng->txt(
'pay_bmf_personal_data_not_valid');
154 if ((
$_POST[
"street"] ==
"" &&
$_POST[
"house_number"] ==
"" &&
$_POST[
"po_box"] ==
"") ||
155 ((
$_POST[
"street"] !=
"" ||
$_POST[
"house_number"] !=
"") &&
$_POST[
"po_box"] !=
"") ||
156 (
$_POST[
"street"] !=
"" &&
$_POST[
"house_number"] ==
"") ||
157 (
$_POST[
"street"] ==
"" &&
$_POST[
"house_number"] !=
""))
159 $this->error = $this->lng->txt(
'pay_bmf_street_or_pobox');
166 $_SESSION[
"bmf"][
"personal_data"][
"firstname"] = $this->user_obj->getFirstname();
167 $_SESSION[
"bmf"][
"personal_data"][
"lastname"] = $this->user_obj->getLastname();
169 $_SESSION[
"bmf"][
"personal_data"][
"house_number"] =
$_POST[
"house_number"];
174 $_SESSION[
"bmf"][
"personal_data"][
"email"] = $this->user_obj->getEmail();
175 $_SESSION[
"bmf"][
"personal_data"][
"language"] = $this->user_obj->getLanguage();
177 if (
$_SESSION[
"bmf"][
"personal_data"][
"country"] !=
"DE")
179 if (
$_SESSION[
"bmf"][
"payment_type"] ==
"debit_entry")
196 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
199 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
200 $this->tpl->touchBlock(
"stop_floating");
207 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_payment_type.html',
'Services/Payment');
209 $this->tpl->setVariable(
"PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
213 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
214 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step2'));
215 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_payment_type'));
216 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_payment_type'));
217 $this->tpl->touchBlock(
"stop_floating");
218 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
221 if (
$_SESSION[
"bmf"][
"personal_data"][
"country"] ==
"DE")
223 $this->tpl->setVariable(
"TXT_DEBIT_ENTRY",$this->lng->txt(
'pay_bmf_debit_entry'));
225 $this->tpl->setVariable(
"TXT_CREDIT_CARD",$this->lng->txt(
'pay_bmf_credit_card'));
227 $this->tpl->setVariable(
"INPUT_VALUE",ucfirst($this->lng->txt(
'next')));
228 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
232 if ($this->error !=
"" &&
233 isset(
$_POST[
"payment_type"]))
235 $this->tpl->setVariable(
"PAYMENT_TYPE_" . strtoupper(
$_POST[
"payment_type"]),
" checked") ;
239 if ((
$_SESSION[
"bmf"][
"personal_data"][
"country"] !=
"DE" &&
$_POST[
"payment_type"] !=
"debit_entry") ||
240 $_SESSION[
"bmf"][
"personal_data"][
"country"] ==
"DE")
242 $this->tpl->setVariable(
"PAYMENT_TYPE_" . strtoupper(
$_SESSION[
"bmf"][
"payment_type"]),
" checked") ;
247 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
248 $this->tpl->setCurrentBlock(
"btn_cell");
249 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPersonalData"));
250 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
251 $this->tpl->parseCurrentBlock(
"btn_cell");
258 if ((
$_POST[
"payment_type"] !=
"credit_card" &&
$_POST[
"payment_type"] !=
"debit_entry") ||
259 (
$_SESSION[
"bmf"][
"personal_data"][
"country"] !=
"DE" &&
$_POST[
"payment_type"] ==
"debit_entry"))
261 $this->error = $this->lng->txt(
'pay_bmf_payment_type_not_valid');
270 if (
$_SESSION[
"bmf"][
"payment_type"] ==
"credit_card")
294 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
297 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
298 $this->tpl->touchBlock(
"stop_floating");
305 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_debit_entry.html',
'Services/Payment');
309 $this->tpl->setVariable(
"DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
313 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
314 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step3_debit_entry'));
315 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_debit_entry_data'));
316 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_debit_entry'));
317 $this->tpl->touchBlock(
"stop_floating");
318 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
321 $this->tpl->setVariable(
"TXT_ACCOUNT_HOLDER",$this->lng->txt(
'pay_bmf_account_holder'));
322 $this->tpl->setVariable(
"TXT_OPTIONAL",$this->lng->txt(
'pay_bmf_optional'));
323 $this->tpl->setVariable(
"TXT_BANK_CODE",$this->lng->txt(
'pay_bmf_bank_code'));
324 $this->tpl->setVariable(
"TXT_ACCOUNT_NUMBER",$this->lng->txt(
'pay_bmf_account_number'));
325 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS",$this->lng->txt(
'pay_bmf_terms_conditions'));
326 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_READ",$this->lng->txt(
'pay_bmf_terms_conditions_read'));
327 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt(
'pay_bmf_terms_conditions_show'));
328 $this->tpl->setVariable(
"LINK_TERMS_CONDITIONS",
"./payment.php?view=conditions");
329 $this->tpl->setVariable(
"TXT_PASSWORD",$this->lng->txt(
'password'));
330 $this->tpl->setVariable(
"TXT_CONFIRM_ORDER",$this->lng->txt(
'pay_confirm_order'));
332 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_send_order'));
333 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
337 $this->tpl->setVariable(
"ACCOUNT_HOLDER",
338 $this->error !=
"" && isset(
$_POST[
'account_holder'])
341 $this->tpl->setVariable(
"BANK_CODE",
342 $this->error !=
"" && isset(
$_POST[
'bank_code'])
345 $this->tpl->setVariable(
"ACCOUNT_NUMBER",
346 $this->error !=
"" && isset(
$_POST[
'account_number'])
361 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
362 $this->tpl->setCurrentBlock(
"btn_cell");
363 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPaymentType"));
364 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
365 $this->tpl->parseCurrentBlock(
"btn_cell");
372 if (
$_POST[
"account_holder"] ==
"" ||
373 $_POST[
"bank_code"] ==
"" ||
374 $_POST[
"account_number"] ==
"")
376 $this->error = $this->lng->txt(
'pay_bmf_debit_entry_not_valid');
381 if (
$_POST[
"terms_conditions"] != 1)
383 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
388 if (
$_POST[
"password"] ==
"" ||
389 md5(
$_POST[
"password"]) != $this->user_obj->getPasswd())
391 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
398 $_SESSION[
"bmf"][
"debit_entry"][
"kontoinhaber"] =
$_POST[
"account_holder"];
409 $this->psc_obj->clearCouponItemsSession();
411 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
414 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
415 $this->tpl->touchBlock(
"stop_floating");
423 $newCustomer =
new Kunde($this->user_obj->getId());
425 $resultCustomerObj = $customer->anlegenKunde($newCustomer);
427 $resultCustomer = $resultCustomerObj->ergebnis;
429 if (is_object($resultCustomer))
431 if ($resultCustomer->code < 0)
433 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " . $resultCustomer->code .
": " . $resultCustomer->kurzText .
"<br>\n" . $resultCustomer->langText;
434 if ($resultCustomer->code == -103 ||
435 $resultCustomer->code == -104 ||
436 $resultCustomer->code == -107 ||
437 ($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
438 $resultCustomer->code == -213)
445 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
462 $tmp_bookEntries = $sc_obj->getShoppingCart();
464 if (!is_array($tmp_bookEntries))
471 for ($i = 0; $i < count($tmp_bookEntries); $i++)
477 $price = $tmp_bookEntries[$i][
"price"];
478 $tmp_bookEntries[$i][
"math_price"] = $price;
480 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
482 $this->coupon_obj->setId($coupon[
"pc_pk"]);
483 $this->coupon_obj->setCurrentCoupon($coupon);
485 $tmp_pobject =
new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i][
'pobject_id']);
487 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
489 $_SESSION[
"coupons"][
"bmf"][$key][
"total_objects_coupon_price"] += $price;
490 $_SESSION[
"coupons"][
"bmf"][$key][
"items"][] = $tmp_bookEntries[$i];
500 $tmp_bookEntries[$i][
"price_string"] = number_format( (
float) $tmp_bookEntries[$i][
"price"] , 2,
".",
"");
501 $bookEntries[] =
new Buchung($tmp_bookEntries[$i]);
502 $totalAmount += $tmp_bookEntries[$i][
"price"];
506 $tmp_bookEntries[$i][
"price_string"] = number_format( (
float) $tmp_bookEntries[$i][
"price"] , 2,
",",
".");
510 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
512 if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
514 foreach ($coupon_discount_items as $item)
516 $item[
"price"]= number_format( (
float) $item[
"discount_price"], 2,
".",
"");
517 $bookEntries[] =
new Buchung($item);
518 $totalAmount += $item[
"price"];
522 $totalAmount = number_format( (
float) $totalAmount , 2,
".",
"");
523 $values = array(
"betrag" => $totalAmount,
"buchungen" => $bookEntries);
524 $bookingList =
new BuchungsListe($this->user_obj->getId(), $values);
529 $resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr, $address, $bank, $bookingList);
530 $result = $resultObj->ergebnis;
536 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
537 $this->tpl->touchBlock(
"stop_floating");
538 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " .
$result->code .
": " .
$result->kurzText .
"<br>\n" .
$result->langText;
548 else if (
$result->code == -507 ||
555 else if (
$result->code == -402 ||
570 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
578 $resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
579 $resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
580 $resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
581 $resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
582 $resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
583 $resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
584 $resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
585 $resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
588 $external_data = array();
589 $external_data[
'voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
590 $external_data[
'transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
591 $external_data[
'street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).
' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
592 $external_data[
'po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
593 $external_data[
'zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
594 $external_data[
'city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
595 $external_data[
'country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
597 parent::__addbookings($external_data);
602 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
603 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_thanks'));
604 $this->tpl->touchBlock(
"stop_floating");
608 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_debit_entry.html',
'Services/Payment');
610 if ($this->ilias->getSetting(
"https") != 1)
612 $this->tpl->setCurrentBlock(
"buyed_objects");
613 $link = $this->ctrl->getLinkTargetByClass(
'ilshopboughtobjectsgui');
614 $this->tpl->setVariable(
"LINK_GOTO_BUYED_OBJECTS", $link);
615 $this->tpl->setVariable(
"TXT_GOTO_BUYED_OBJECTS", $this->lng->txt(
'pay_goto_buyed_objects'));
616 $this->tpl->parseCurrentBlock(
"buyed_objects");
618 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW", $this->lng->txt(
'close_window'));
623 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
624 $this->tpl->touchBlock(
"stop_floating");
631 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
632 $this->tpl->touchBlock(
"stop_floating");
652 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
655 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
656 $this->tpl->touchBlock(
"stop_floating");
663 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_credit_card.html',
'Services/Payment');
666 $this->tpl->setVariable(
"CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
670 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
671 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_step3_credit_card'));
672 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pay_bmf_credit_card_data'));
673 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_description_credit_card'));
674 $this->tpl->touchBlock(
"stop_floating");
675 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW",$this->lng->txt(
'close_window'));
678 $this->tpl->setVariable(
"TXT_CARD_HOLDER",$this->lng->txt(
'pay_bmf_card_holder'));
679 $this->tpl->setVariable(
"TXT_CHECK_NUMBER",$this->lng->txt(
'pay_bmf_check_number'));
680 $this->tpl->setVariable(
"TXT_OPTIONAL",$this->lng->txt(
'pay_bmf_optional'));
681 $this->tpl->setVariable(
"TXT_CARD_NUMBER",$this->lng->txt(
'pay_bmf_card_number'));
682 $this->tpl->setVariable(
"TXT_VALIDITY",$this->lng->txt(
'pay_bmf_validity'));
683 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS",$this->lng->txt(
'pay_bmf_terms_conditions'));
684 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_READ",$this->lng->txt(
'pay_bmf_terms_conditions_read'));
685 $this->tpl->setVariable(
"TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt(
'pay_bmf_terms_conditions_show'));
686 $this->tpl->setVariable(
"LINK_TERMS_CONDITIONS",
"./payment.php?view=conditions");
687 $this->tpl->setVariable(
"TXT_PASSWORD",$this->lng->txt(
'password'));
688 $this->tpl->setVariable(
"TXT_CONFIRM_ORDER",$this->lng->txt(
'pay_confirm_order'));
690 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_send_order'));
691 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
695 $this->tpl->setVariable(
"CARD_HOLDER",
696 $this->error !=
"" && isset(
$_POST[
'card_holder'])
699 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_1",
700 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_1'])
703 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_2",
704 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_2'])
707 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_3",
708 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_3'])
711 $this->tpl->setVariable(
"CARD_NUMBER_BLOCK_4",
712 $this->error !=
"" && isset(
$_POST[
'card_number'][
'block_4'])
715 $this->tpl->setVariable(
"CHECK_NUMBER",
716 $this->error !=
"" && isset(
$_POST[
'check_number'])
719 for ($i = 1; $i <= 12; $i++)
721 $this->tpl->setCurrentBlock(
"loop_validity_months");
722 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS", $i < 10 ?
"0" . $i : $i);
723 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_TXT", $i < 10 ?
"0" . $i : $i);
724 if ($this->error !=
"" &&
725 isset(
$_POST[
'validity'][
'month']))
727 if (
$_POST[
'validity'][
'month'] == $i)
729 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_SELECTED",
" selected");
734 if (
$_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"monat"] == $i)
736 $this->tpl->setVariable(
"LOOP_VALIDITY_MONTHS_SELECTED",
" selected");
739 $this->tpl->parseCurrentBlock(
"loop_validity_months");
741 for ($i = date(
"Y"); $i <= (date(
"Y")+6); $i++)
743 $this->tpl->setCurrentBlock(
"loop_validity_years");
744 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS", $i);
745 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_TXT", $i);
746 if ($this->error !=
"" &&
747 isset(
$_POST[
'validity'][
'year']))
749 if (
$_POST[
'validity'][
'year'] == $i)
751 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_SELECTED",
" selected");
756 if (
$_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"jahr"] == $i)
758 $this->tpl->setVariable(
"LOOP_VALIDITY_YEARS_SELECTED",
" selected");
761 $this->tpl->parseCurrentBlock(
"loop_validity_years");
775 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
776 $this->tpl->setCurrentBlock(
"btn_cell");
777 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"showPaymentType"));
778 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
779 $this->tpl->parseCurrentBlock(
"btn_cell");
786 if (
$_POST[
"card_holder"] ==
"" ||
787 $_POST[
"card_number"][
"block_1"] ==
"" ||
788 $_POST[
"card_number"][
"block_2"] ==
"" ||
789 $_POST[
"card_number"][
"block_3"] ==
"" ||
790 $_POST[
"card_number"][
"block_4"] ==
"" ||
791 $_POST[
"validity"][
"month"] ==
"" ||
792 $_POST[
"validity"][
"year"] ==
"" ||
793 $_POST[
"validity"][
"year"].
"-".
$_POST[
"validity"][
"month"] < date(
"Y-m"))
795 $this->error = $this->lng->txt(
'pay_bmf_credit_card_not_valid');
800 if (
$_POST[
"terms_conditions"] != 1)
802 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
807 if (
$_POST[
"password"] ==
"" ||
808 md5(
$_POST[
"password"]) != $this->user_obj->getPasswd())
810 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
816 $_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"monat"] =
$_POST[
"validity"][
"month"];
817 $_SESSION[
"bmf"][
"credit_card"][
"gueltigkeit"][
"jahr"] =
$_POST[
"validity"][
"year"];
818 $_SESSION[
"bmf"][
"credit_card"][
"karteninhaber"] =
$_POST[
"card_holder"];
819 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_1"] =
$_POST[
"card_number"][
"block_1"];
820 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_2"] =
$_POST[
"card_number"][
"block_2"];
821 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_3"] =
$_POST[
"card_number"][
"block_3"];
822 $_SESSION[
"bmf"][
"credit_card"][
"kreditkartenNr"][
"block_4"] =
$_POST[
"card_number"][
"block_4"];
823 $_SESSION[
"bmf"][
"credit_card"][
"kartenpruefnummer"] =
$_POST[
"check_number"];
833 $this->psc_obj->clearCouponItemsSession();
835 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
838 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
839 $this->tpl->touchBlock(
"stop_floating");
847 $customer =
new Kunde($this->user_obj->getId());
853 $tmp_bookEntries = $sc_obj->getShoppingCart();
854 if (!is_array($tmp_bookEntries))
861 for ($i = 0; $i < count($tmp_bookEntries); $i++)
867 $price = $tmp_bookEntries[$i][
"price"];
868 $tmp_bookEntries[$i][
"math_price"] = $price;
870 foreach (
$_SESSION[
"coupons"][
"bmf"] as $key => $coupon)
872 $this->coupon_obj->setId($coupon[
"pc_pk"]);
873 $this->coupon_obj->setCurrentCoupon($coupon);
875 $tmp_pobject =
new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i][
'pobject_id']);
877 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
879 $_SESSION[
"coupons"][
"bmf"][$key][
"total_objects_coupon_price"] += $price;
880 $_SESSION[
"coupons"][
"bmf"][$key][
"items"][] = $tmp_bookEntries[$i];
891 $tmp_bookEntries[$i][
"price_string"] = number_format( (
float) $tmp_bookEntries[$i][
"price"] , 2,
",",
".");
893 $bookEntries[] =
new Buchung($tmp_bookEntries[$i]);
894 $totalAmount += $tmp_bookEntries[$i][
"price"];
898 $tmp_bookEntries[$i][
"price_string"] = number_format( (
float) $tmp_bookEntries[$i][
"price"] , 2,
",",
".");
902 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
"coupons"][
"bmf"]);
904 if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
906 foreach ($coupon_discount_items as $item)
908 $item[
"price"] = number_format((
float)$item[
"discount_price"] , 2,
".",
"");
909 $bookEntries[] =
new Buchung($item);
910 $totalAmount += $item[
"discount_price"];
914 $totalAmount = number_format((
float)$totalAmount , 2,
".",
"");
915 $values = array(
"betrag" => $totalAmount,
"buchungen" => $bookEntries);
916 $bookingList =
new BuchungsListe($this->user_obj->getId(), $values);
919 $resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
920 $result = $resultObj->ergebnis;
926 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
927 $this->tpl->touchBlock(
"stop_floating");
928 $error = $this->lng->txt(
'pay_bmf_server_error_code') .
" " .
$result->code .
": " .
$result->kurzText .
"<br>\n" .
$result->langText;
938 else if (
$result->code == -507 ||
945 else if (
$result->code == -701 ||
957 $error .=
"<br>\n" . $this->lng->txt(
'pay_bmf_server_error_sysadmin');
965 $external_data = array();
966 $external_data[
'voucher'] = $resultObj->buchungsListe->buchungen[$b++]->belegNr;
967 $external_data[
'transaction_extern'] = $resultObj->buchungsListe->kassenzeichen;
968 $external_data[
'street'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse).
' '.utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
969 $external_data[
'po_box'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
970 $external_data[
'zipcode'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
971 $external_data[
'city'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
972 $external_data[
'country'] = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
974 parent::__addbookings($external_data);
979 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'pay_bmf_your_order'));
980 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'pay_bmf_thanks'));
981 $this->tpl->touchBlock(
"stop_floating");
985 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bmf_credit_card.html',
'Services/Payment');
987 if ($this->ilias->getSetting(
"https") != 1)
989 $this->tpl->setCurrentBlock(
"buyed_objects");
990 $link = $this->ctrl->getLinkTargetByClass(
'ilshopboughtobjectsgui');
991 $this->tpl->setVariable(
"LINK_GOTO_BUYED_OBJECTS", $link);
992 $this->tpl->setVariable(
"TXT_GOTO_BUYED_OBJECTS", $this->lng->txt(
'pay_goto_buyed_objects'));
993 $this->tpl->parseCurrentBlock(
"buyed_objects");
995 $this->tpl->setVariable(
"TXT_CLOSE_WINDOW", $this->lng->txt(
'close_window'));
1000 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
'error'));
1001 $this->tpl->touchBlock(
"stop_floating");
1016 $cmd = $this->ctrl->getCmd();
1018 switch ($this->ctrl->getNextClass($this))
1022 if(!
$cmd = $this->ctrl->getCmd())
1024 $cmd =
'showPersonalData';
1043 $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"])));
1053 'kunde' => $customer
1056 $result = $this->_soapClient->call(
"anlegenKunde", $tmp,
"KundenstammdatenPflegeWS");
1071 $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"])));
1081 'kreditkarte' => $creditCard,
1082 'waehrungskennzeichen' =>
$bmfConfig[
"waehrungskennzeichen"]
1085 $result = $this->_soapClient->call(
"validierenKreditkarte", $tmp,
"KreditkartenzahlungWS");
1098 'Kunde' => $customer,
1099 'Kreditkarte' => $creditCard,
1100 'buchungsListe' => $bookingList,
1101 'lieferadresse' => $lieferadresse
1104 $result = $this->_soapClient->call(
"zahlenUndAnlegenKunde", $tmp,
"KreditkartenzahlungWS");
1119 $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"])));
1129 'eShopKundenNr' => $eShopCustomerNumber,
1130 'lieferAdresse' => $address,
1131 'bankverbindung' => $bank,
1132 'buchungsListe' => $bookingList
1135 $result = $this->_soapClient->call(
"abbuchenOhneEinzugsermaechtigung", $tmp,
"LastschriftWS");
1143 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Kunde');
1145 function Kunde ($customerNumber =
"", $values =
"")
1153 $this->EShopKundenNr = time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1154 if ($customerNumber !=
"")
1156 $this->EShopKundenNr = $customerNumber .
"_" . time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1162 $values =
$_SESSION[
"bmf"][
"personal_data"];
1165 if ($values[
"language"] != NULL)
1167 $this->sprache = $values[
"language"];
1169 if ($values[
"firstname"] != NULL)
1171 $this->vorname = utf8_decode($values[
"firstname"]);
1173 if ($values[
"lastname"] != NULL)
1175 $this->nachname = utf8_decode($values[
"lastname"]);
1177 if ($values[
"email"] != NULL)
1179 $this->EMailAdresse = utf8_decode($values[
"email"]);
1184 $this->rechnungsAdresse = $address;
1189 return $this->EShopKundenNr;
1196 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Adresse');
1202 $values =
$_SESSION[
"bmf"][
"personal_data"];
1205 if (is_array($values))
1207 if ($values[
"street"] != NULL)
1209 $this->strasse = utf8_decode($values[
"street"]);
1211 if ($values[
"house_number"] != NULL)
1213 $this->hausNr = utf8_decode($values[
"house_number"]);
1215 if ($values[
"po_box"] != NULL)
1217 $this->postfach = utf8_decode($values[
"po_box"]);
1219 if ($values[
"country"] != NULL)
1221 $this->land = utf8_decode($values[
"country"]);
1223 if ($values[
"zipcode"] != NULL)
1225 $this->PLZ = utf8_decode($values[
"zipcode"]);
1227 if ($values[
"city"] != NULL)
1229 $this->ort = utf8_decode($values[
"city"]);
1238 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Kreditkarte');
1244 $values =
$_SESSION[
"bmf"][
"credit_card"];
1247 if (is_array($values))
1249 if ($values[
"karteninhaber"] != NULL)
1251 $this->karteninhaber = utf8_decode($values[
"karteninhaber"]);
1253 if ($values[
"kartenpruefnummer"] != NULL)
1255 $this->kartenpruefnummer = utf8_decode($values[
"kartenpruefnummer"]);
1257 if (is_array ($values[
"kreditkartenNr"]) &&
1258 count($values[
"kreditkartenNr"]) == 4)
1260 for ($i = 1; $i <= count($values[
"kreditkartenNr"]); $i++)
1262 $this->kreditkartenNr .= utf8_decode($values[
"kreditkartenNr"][
"block_".$i]);# .
"-";
1264 # $this->kreditkartenNr = substr($this->kreditkartenNr, 0, strlen($this->kreditkartenNr)-1);
1266 if (is_array($values[
"gueltigkeit"]) &&
1267 $values[
"gueltigkeit"][
"monat"] !=
"" &&
1268 $values[
"gueltigkeit"][
"jahr"] !=
"")
1270 $this->gueltigkeit = utf8_decode($values[
"gueltigkeit"][
"monat"]);
1271 $this->gueltigkeit .= utf8_decode($values[
"gueltigkeit"][
"jahr"]);
1280 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Lastschrift');
1284 $this->EShopKundenNr = time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1285 if ($customerNumber !=
"")
1287 $this->EShopKundenNr = $customerNumber .
"_" . time() .
"_" . substr(md5(uniqid(rand(),
true)), 0, 4);
1295 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'Bankverbindung');
1301 $values =
$_SESSION[
"bmf"][
"debit_entry"];
1304 if (is_array($values))
1306 if ($values[
"kontoinhaber"] != NULL)
1308 $this->kontoinhaber = utf8_decode($values[
"kontoinhaber"]);
1310 if ($values[
"kontoNr"] != NULL)
1312 $this->kontoNr = utf8_decode($values[
"kontoNr"]);
1314 if ($values[
"BLZ"] != NULL)
1316 $this->BLZ = utf8_decode($values[
"BLZ"]);
1325 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');
1334 $this->haushaltsstelle =
$bmfConfig[
"haushaltsstelle"];
1338 $this->objektnummer =
$bmfConfig[
"objektNr"];
1341 if (is_array($values))
1343 if ($values[
"object_title"] != NULL)
1345 $buchungstext = utf8_decode($values[
"object_title"]);
1346 if(strlen($buchungstext) > 16)
1348 $buchungstext = substr($buchungstext,0,15).
'...';
1351 $this->buchungstext = $buchungstext;
1353 if ($values[
"price"] !=
"")
1355 $this->betrag = (float)$values[
"price"];
1363 if ($voucherNumber != NULL)
1365 $this->belegNr = $voucherNumber;
1371 return $this->belegNr;
1377 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment',
'nsPrefix' =>
'ns2',
'type' =>
'BuchungsListe');
1388 $this->bewirtschafterNr =
$bmfConfig[
"bewirtschafterNr"];
1390 if (
$bmfConfig[
"waehrungskennzeichen"] != NULL)
1392 $this->waehrungskennzeichen =
$bmfConfig[
"waehrungskennzeichen"];
1394 $this->faelligkeitsdatum = date(
"Y-m-d") .
"T" . date(
"H:i:s") .
"Z";
1395 if (
$bmfConfig[
"kennzeichenMahnverfahren"] != NULL)
1397 $this->kennzeichenMahnverfahren =
$bmfConfig[
"kennzeichenMahnverfahren"];
1400 $inst_id_time = $ilias->getSetting(
'inst_id').
'_'.$userId.
'_'.substr((
string) time(),-3);
1401 $this->EShopTransaktionsNr = $inst_id_time.substr(md5(uniqid(rand(),
true)), 0, 4);
1403 if (is_array($values))
1405 if ($values[
"betrag"] != NULL)
1407 $this->betrag = (float)$values[
"betrag"];
1409 if ($values[
"buchungen"] != NULL)
1411 $this->buchungen = $values[
"buchungen"];
1417 return $this->EShopTransaktionsNr;
1423 if ($kassenzeichen != NULL)
1425 $this->kassenzeichen = $kassenzeichen;
1431 return $this->kassenzeichen;
1438 var
$OBJTypeNS = array (
'namespace' =>
'http://www.bff.bund.de/ePayment' ,
'type' =>
'LieferAdresse');
1444 $values =
$_SESSION[
"bmf"][
"personal_data"];
1447 if (is_array($values))
1449 if ($values[
"firstname"] != NULL)
1451 $this->vorname = utf8_decode($values[
"firstname"]);
1453 if ($values[
"lastname"] != NULL)
1455 $this->nachname = utf8_decode($values[
"lastname"]);
1457 if ($values[
"street"] != NULL)
1459 $this->strasse = utf8_decode($values[
"street"]);
1461 if ($values[
"house_number"] != NULL)
1463 $this->hausNr = utf8_decode($values[
"house_number"]);
1465 if ($values[
"po_box"] != NULL)
1467 $this->postfach = utf8_decode($values[
"po_box"]);
1469 if ($values[
"country"] != NULL)
1471 $this->land = utf8_decode($values[
"country"]);
1473 if ($values[
"zipcode"] != NULL)
1475 $this->PLZ = utf8_decode($values[
"zipcode"]);
1477 if ($values[
"city"] != NULL)
1479 $this->ort = utf8_decode($values[
"city"]);