本文整理汇总了PHP中Payment::pay方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::pay方法的具体用法?PHP Payment::pay怎么用?PHP Payment::pay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::pay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pay
/**
* Returns the pay page url or the merchant js file.
*
* @param unknown $params
* @param unknown $salt
* @throws Exception
* @return Ambigous <multitype:number string , multitype:number Ambigous <boolean, string> >
*/
function pay($params, $salt)
{
if (!is_array($params)) {
throw new Exception('Pay params is empty');
}
if (empty($salt)) {
throw new Exception('Salt is empty');
}
$payment = new Payment($salt);
$result = $payment->pay($params);
unset($payment);
return $result;
}
示例2: Payment
<?php
$list = new Payment();
$orderList = explode("*", $list->OrderQueueList());
for ($i = 0; $i < $list->orderLimit(); $i++) {
$orderDetails = explode(";", $orderList[$i * 3 + 2]);
echo "<div class='orderListSel'>" . $orderList[$i * 3] . "\n\t\t\t\t\t\t\t\t\t <div class='orderDetails hide'>\n\t\t\t\t\t\t\t\t\t <p>Table " . $orderList[$i * 3 + 1] . "</p>";
$sum = 0;
for ($j = 0; $j < count($orderDetails) - 1; $j++) {
$orderPrettyList = explode("-", $orderDetails[$j]);
echo "<span class='left'>" . $orderPrettyList[0] . "</span><span class='right'>" . $orderPrettyList[1] . " X " . $orderPrettyList[2] . "</span><br/>";
$sum += $orderPrettyList[1] * $orderPrettyList[2];
}
echo "<hr/>\n\t\t\t\t\t\t\t\t\t <span class='left'><b>Total</b></span><span class='right'>\$" . $sum . "</span>\t\n\t\t\t\t\t\t\t\t\t <p class='mt65'><button class='btn btn-success pay' id='payment" . $orderList[$i * 3 + 1] . "'>Pay</button></p>\n\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t </div>";
}
if (isset($_REQUEST['tabidNoti']) && $_REQUEST['tabidNoti'] != "") {
$list->pay($_REQUEST['tabidNoti']);
}
?>
</div>
<div id="itemList" class="orderList"></div>
</div>
<div class="clear"></div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
示例3: function
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('sendmail/{name?}', function ($name = 'guest') {
Mail::queue('emails.welcome', ['name' => $name], function ($message) {
$message->from('hoge@hugahuga.com')->to('someone@example.com')->subject('Welcome');
});
return "Welcome メッセージを {$name} に送りました";
});
Route::get('send_message/{message}', function (Messenger $messenger, $message) {
return $messenger->send($message);
});
Route::get('pay/{money}', function ($money) {
return \Payment::pay($money);
})->where('money', '[0-9]+');
Route::get('reminder/{id}', 'UsersController@SendReminderEmail');
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
//
});
示例4: Payment
if ($validation->passed()) {
$payment = new Payment();
$room_price = $payment->get_room($user->data()->RoomID)->room_price;
if (!$payment->check_paid(Input::get('PaidMonth'), $user->data()->ID)) {
//echo 'Not yet paid';
if (!$payment->check_pend_payment(Input::get('PaidMonth'), $user->data()->ID)) {
//echo '<br>Paying';
$add_payment = new Payment(array('payment_type' => Input::get('TypeOfPay'), 'payment_regisdate' => TheDate(), 'payment_month' => Input::get('PaidMonth'), 'student_id' => $user->data()->ID, 'payment_amt' => $room_price, 'receipt_no' => Input::get('ReceiptNo'), 'payed' => true));
$add_payment->add_payment();
$month_number = Input::get('PaidMonth') != 12 ? Input::get('PaidMonth') + 1 : 1;
$add_payment = new Payment(array('payment_type' => Input::get('TypeOfPay'), 'payment_regisdate' => TheDate(), 'payment_month' => $month_number, 'student_id' => $user->data()->ID, 'payment_amt' => $room_price, 'payed' => false));
$add_payment->add_payment();
$payment->check_all_paid($user->data()->ID);
} else {
//echo 'There is an entry';
if (!$payment->pay(Input::get('PaidMonth'), $user->data()->ID, Input::get('ReceiptNo'))) {
echo 'An error occurred';
}
$add_payment = new Payment(array('payment_type' => Input::get('TypeOfPay'), 'payment_regisdate' => TheDate(), 'payment_month' => Input::get('PaidMonth') + 1, 'student_id' => $user->data()->ID, 'payment_amt' => $room_price, 'payed' => false));
}
}
if (Input::get('TypeOfPay') == 'deposit') {
$payment = new Payment();
$Slip = "Print.php";
$Writer = fopen($Slip, 'w');
$content = $payment->print_slip($user->data()->ID);
fwrite($Writer, $content);
fclose($Writer);
$payment->activate_payment_tracker($user->data()->ID, $user->data()->RoomID);
Redirect::to('Print.php');
}