68 $this->deb->createInvoice();
70 foreach ($this->sc as $i)
75 $ilias_tid = $this->ilUser->getId() .
"_" . $tid;
79 $bo->setPobjectId( isset($i[
'pobject_id']) ? $i[
'pobject_id'] : 0 );
80 $bo->setCustomerId( $this->ilUser->getId() );
81 $bo->setVendorId( $pod[
'vendor_id'] );
82 $bo->setPayMethod($this->paytype);
83 $bo->setOrderDate(time());
87 $bo->setDuration($i[
'duration']);
88 $bo->setPrice($i[
'price_string']);
92 $bo->setVatRate( $i[
'vat_rate'] );
93 $bo->setVatUnit( $i[
'vat_unit'] );
95 $bo->setTransactionExtern($tid);
99 $product_name = $i[
'object_title'];
100 $duration = $i[
'duration'];
101 $amount = $i[
'price'];
103 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
104 $save_adr = (int) ilPaymethods::_EnabledSaveUserAddress($this->paytype) ? 1 : 0;
107 $bo->setStreet($this->ilUser->getStreet(),
'');
109 $bo->setZipcode($this->ilUser->getZipcode());
110 $bo->setCity($this->ilUser->getCity());
111 $bo->setCountry($this->ilUser->getCountry());
116 $bo->setAccessExtension($this->sc[
'extension']);
120 if ( $i[
'typ'] ==
'crs')
122 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
123 $this->deb->createInvoiceLine( 0, $product_name .
" (" . $duration.
")", 1, $amount );
124 $products[] = $product_name;
128 $cp->sendNotification($cp->NOTIFY_ACCEPT_SUBSCRIBER, $this->ilUser->getId());
131 $inv = $this->deb->bookInvoice();
132 $invoice_number = $this->deb->getInvoiceNumber();
134 $attach = $this->deb->getInvoicePDF($inv);
135 $this->deb->saveInvoice($attach,
false);
136 $lng->loadLanguageModule(
'payment');
137 $this->deb->sendInvoice($lng->txt(
'pay_order_paid_subject'),
138 $this->ilUser->getFullName() .
",\n" .
139 str_replace(
'%products%', implode(
", ", $products), $lng->txt(
'pay_order_paid_body')) ,
140 $this->ilUser->getEmail(),
141 $attach, $lng->txt(
'pays_invoice') .
"-" . $invoice_number
143 $this->cart->emptyShoppingCart();
setTransaction($a_transaction)
static _getObjectData($a_id)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjId($a_id)