当前位置: 首页>>代码示例>>PHP>>正文


PHP Invoice::get_user_installment_payments方法代码示例

本文整理汇总了PHP中Invoice::get_user_installment_payments方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::get_user_installment_payments方法的具体用法?PHP Invoice::get_user_installment_payments怎么用?PHP Invoice::get_user_installment_payments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Invoice的用法示例。


在下文中一共展示了Invoice::get_user_installment_payments方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_payment_section

 public function get_payment_section($userid, $courseid, $slotid, $sum, $renew = null)
 {
     $list = "";
     //echo "Sum inside model: ".$sum."<br>";
     if ($userid != NULL) {
         $invoice = new Invoice();
         $user = $this->get_user_data($userid);
         $user->courseid = $courseid;
         $user->slotid = $slotid;
         $group_status = $this->is_group_member($userid);
         $installment_status = $invoice->is_installment_user($userid, $courseid);
         if ($installment_status == 0) {
             if ($group_status == 0) {
                 // Personal signup
                 $group_data = '';
                 $participants = 1;
                 $list .= $this->payment->get_payment_section($group_data, $user, $participants, null, 1, $sum, $renew);
             } else {
                 // Group member signup
                 $group_name = $this->get_user_group($userid);
                 $group_data = new stdClass();
                 $group_data->group_name = $group_name;
                 $group_data->courseid = $courseid;
                 $participants = 1;
                 $list .= $this->payment->get_payment_section($group_data, $user, $participants, null, 1, $sum, $renew);
             }
             // end else
         } else {
             $installment_obj = $invoice->get_user_installment_payments($userid, $courseid);
             $installment = array();
             $installment['period'] = 28;
             // days
             $installment['num_payments'] = $installment_obj->num;
             if ($group_status == 0) {
                 // Personal signup
                 $group_data = '';
                 $participants = 1;
                 $list .= $this->payment->get_payment_section($group_data, $user, $participants, $installment, 1);
             } else {
                 // Group member signup
                 $group_name = $this->get_user_group($userid);
                 $group_data = new stdClass();
                 $group_data->group_name = $group_name;
                 $group_data->courseid = $courseid;
                 $participants = 1;
                 $list .= $this->payment->get_payment_section($group_data, $user, $participants, $installment, 1);
             }
             // end else
         }
         // end else when it is installment user
     }
     // end if $userid != NULL
     return $list;
 }
开发者ID:sirromas,项目名称:medical,代码行数:54,代码来源:Payment_model.php

示例2: Mailer


//.........这里部分代码省略.........
                 $list .= "<span class='span8'>Transaction failed, please contact your bank for details.</span>";
                 $list .= "</div>";
                 $list .= "</div>";
                 $list .= "</div>";
             } else {
                 $card->transid = $status['trans_id'];
                 $card->auth_code = $status['auth_code'];
                 $list .= "<div class='panel panel-default' id='personal_payment_details'>";
                 $list .= "<div class='panel-heading'style='text-align:left;'><h5 class='panel-title'>Payment Details</h5></div>";
                 $list .= "<div class='panel-body'>";
                 $list .= "<div class='container-fluid' style='text-align:left;'>";
                 $list .= "<span class='span8'>Payment is successful. Thank you!</span>";
                 $list .= "</div>";
                 $list .= "</div>";
                 $list .= "</div>";
                 /*
                  echo "<br>-----Group users:----------------<br>";
                  print_r($group_users);
                  echo "<br>---------------------------------<br>";
                 */
                 if (count($group_users > 0)) {
                     foreach ($group_users as $userid) {
                         $slotid = $this->get_group_users_slot($userid);
                         $card->slotid = $slotid;
                         $user = $this->get_user_detailes($userid);
                         $card->userid = $userid;
                         $this->enroll->add_user_to_course_schedule($userid, $card);
                         $card->sum = round($group_sum / count($group_users), 2);
                         // Sum for every group participant
                         $this->add_payment_to_db($card);
                         // adds payment result to DB
                         $this->confirm_user($user->username);
                         $mailer->send_group_payment_confirmation_message($user);
                     }
                     // end foreach
                 }
                 // end if count($group_users > 0)
             }
             // end else
         }
         // end if $user_group!='' && $userid==''
     } else {
         // It is installment user - create subscription
         $user_payment_data = $this->get_user_payment_credentials($card->userid);
         $installmentobj = $invoice->get_user_installment_payments($card->userid, $card->courseid);
         $order = new stdClass();
         $order->cds_name = "{$firstname}/{$lastname}";
         $order->cds_address_1 = $card->bill_addr;
         $order->cds_city = $card->bill_city;
         $order->cds_state = "{$user_payment_data->state_code}";
         $order->cds_zip = $card->bill_zip;
         $order->cds_email = $card->email;
         $order->cds_pay_type = $cart_type_num;
         $order->cds_cc_number = $card->card_no;
         $order->cvv = $card->cvv;
         // add card cvv code to processor
         $order->cd_cc_month = $card->card_month;
         $order->cds_cc_year = $card->card_year;
         $order->sum = $card->sum;
         $order->item = $item;
         $order->group = 0;
         $order->userid = $card->userid;
         $order->courseid = $card->courseid;
         $order->payments_num = $installmentobj->num;
         $pr = new ProcessPayment();
         $subscriptionID = $pr->createSubscription($order);
         //echo "Subscription  ID: ".$subscriptionID."<br>";
         //die ('Stopped ...');
         if (is_numeric($subscriptionID)) {
             $this->add_subscription($card->userid, $card->courseid, $subscriptionID);
             $card->transid = $status['trans_id'];
             $card->auth_code = $status['auth_code'];
             $this->confirm_user($card->email);
             $this->add_payment_to_db($card);
             // adds payment result to DB
             $mailer->send_payment_confirmation_message($card);
             $list .= "<div class='panel panel-default' id='personal_payment_details'>";
             $list .= "<div class='panel-heading'style='text-align:left;'><h5 class='panel-title'>Payment Details</h5></div>";
             $list .= "<div class='panel-body'>";
             $list .= "<div class='container-fluid' style='text-align:left;'>";
             $list .= "<span class='span8'>Installment payment is successful. Thank you!.</span>";
             $list .= "</div>";
             $list .= "</div>";
             $list .= "</div>";
             $this->enroll->add_user_to_course_schedule($card->userid, $card);
         } else {
             $list .= "<div class='panel panel-default' id='personal_payment_details'>";
             $list .= "<div class='panel-heading'style='text-align:left;'><h5 class='panel-title'>Payment Details</h5></div>";
             $list .= "<div class='panel-body'>";
             $list .= "<div class='container-fluid' style='text-align:left;'>";
             $list .= "<span class='span8'>Installment payment failed, please contact your bank for details.</span>";
             $list .= "</div>";
             $list .= "</div>";
             $list .= "</div>";
         }
         // end else
     }
     // end else
     return $list;
 }
开发者ID:sirromas,项目名称:medical,代码行数:101,代码来源:Payment.php

示例3: Invoice

$card->cds_address_1 = 'Some address';
$card->cds_city = 'Come city';
$card->cds_state = 'AZ';
$card->cds_zip = '69002';
$card->cds_email = 'sirromas@gmail.com';
$card->cds_pay_type = '10';
// master card ..
$card->cds_cc_number = '5338555912435992';
$card->cds_cc_exp_month = '02';
$card->cds_cc_exp_year = '2018';
$card->userid = 11557;
$card->courseid = 53;
$card->sum = 256;
$invoice = new Invoice();
$payment = new Payment();
$installmentobj = $invoice->get_user_installment_payments($card->userid, $card->courseid);
$user_payment_data = $payment->get_user_payment_credentials($card->userid);
$order = new stdClass();
$order->cds_name = "{$user_payment_data->firstname} {$user_payment_data->lastname}";
$order->cds_address_1 = $card->cds_address_1;
$order->cds_city = $card->cds_city;
$order->cds_state = "{$user_payment_data->cds_state}";
$order->cds_zip = $card->cds_zip;
$order->cds_email = $card->cds_email;
$order->cds_pay_type = $card->cds_pay_type;
$order->cds_cc_number = $card->cds_cc_number;
$order->cd_cc_month = $card->cds_cc_exp_month;
$order->cds_cc_year = $card->cds_cc_exp_year;
$order->sum = $card->sum;
$order->item = 'Test item';
$order->group = 0;
开发者ID:sirromas,项目名称:medical,代码行数:31,代码来源:test_subs.php

示例4: Invoice

 function send_invoice($courseid, $userid)
 {
     $list = "";
     $file_invoice = new Invoice();
     $mailer = new Mailer();
     $user = $this->get_user_details($userid);
     $user->id = $userid;
     $user->first_name = $user->firstname;
     $user->last_name = $user->lastname;
     $user->courseid = $courseid;
     $user->invoice = $file_invoice->create_user_invoice($user, null, 1);
     $path = $file_invoice->invoice_path . "/{$user->invoice}.pdf";
     $user_installment_status = $file_invoice->is_installment_user($userid, $courseid);
     if ($user_installment_status == 0) {
         $installment = new stdClass();
         $cost = $file_invoice->get_personal_course_cost($courseid);
         $sum = $cost['cost'];
         $installment->sum = $sum;
     } else {
         $installment = $file_invoice->get_user_installment_payments($userid, $courseid);
     }
     // end else
     // State taxes section
     $tax_status = $this->is_course_taxable($courseid);
     if ($tax_status == 1) {
         $user_state = $this->get_user_state($userid);
         $tax = $this->get_state_taxes($user_state);
     } else {
         $tax = 0;
     }
     // end else
     if ($tax > 0) {
         $tax_sum = round($installment->sum * $tax / 100, 2);
         $installment->sum = round($installment->sum + $tax_sum, 2);
     }
     $query = "insert into mdl_invoice" . "(i_num," . "userid," . "courseid," . "i_sum," . "i_status," . "i_file," . "i_date) " . "values ('" . $user->invoice . "'," . "'" . $userid . "', " . "'" . $courseid . "'," . "'" . $installment->sum . "'," . "'0'," . "'" . $path . "'," . "'" . time() . "')";
     $this->db->query($query);
     $mailer->send_invoice($user);
     $list .= "Invoice has been sent.";
     return $list;
 }
开发者ID:sirromas,项目名称:medical,代码行数:41,代码来源:Invoice.php


注:本文中的Invoice::get_user_installment_payments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。