本文整理汇总了PHP中Payment::ask方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::ask方法的具体用法?PHP Payment::ask怎么用?PHP Payment::ask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::ask方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Show the form for creating a new resource.
* GET /payment/create
*
* @return Response
*/
public function create()
{
setlocale(LC_MONETARY, "en_US");
$discount = Session::get('discount');
if (!$discount) {
$discount = 0;
}
$user = Auth::user();
$discount = $discount['percent'] * Cart::total();
$subtotal = Cart::total() - $discount;
$taxfree = Cart::total(false) - $discount;
$fee = $subtotal / getenv("SV_FEE") - $subtotal;
$tax = $subtotal - $taxfree;
$total = $fee + $tax + $subtotal;
if (!$total) {
return Redirect::action('HomeController@getIndex');
}
if ($user->profile->customer_vault) {
$param = array('report_type' => 'customer_vault', 'customer_vault_id' => $user->profile->customer_vault);
$payment = new Payment();
$vault = $payment->ask($param);
//return $vault;
return View::make('pages.public.checkout')->with('page_title', 'Checkout')->withUser($user)->with('products', Cart::contents())->with('subtotal', $subtotal)->with('service_fee', $fee)->with('tax', $tax)->with('cart_total', $total)->with('discount', $discount)->with('vault', $vault);
} else {
$vault = false;
return View::make('pages.public.checkout')->with('page_title', 'Checkout')->withUser($user)->with('products', Cart::contents())->with('subtotal', $subtotal)->with('service_fee', $fee)->with('tax', $tax)->with('cart_total', $total)->with('discount', $discount)->with('vault', $vault);
}
}
示例2: report
public function report()
{
//add security to avoid stealing of information
$user = Auth::user();
$club = $user->Clubs()->FirstOrFail();
$type = Input::get('expType');
$from = date('Ymd', strtotime(Input::get('expFrom')));
$to = date('Ymd', strtotime(Input::get('expTo')));
$payments = Payment::where('club_id', '=', $club->id)->with('player')->whereBetween('created_at', array($from, $to))->get();
$param = array('transaction_type' => 'cc', 'action_type' => 'refund,sale', 'condition' => 'pendingsettlement,complete,failed', 'club' => $club->id, 'start_date' => $from . '000000', 'end_date' => $to . '235959');
$payment = new Payment();
$transactions = $payment->ask($param);
//return $transactions;
//return json_decode(json_encode($transactions->transaction),true);
// return View::make('export.lacrosse.accounting.all')
// ->with('payments', $transactions->transaction);
//return json_decode(json_encode($transactions->transaction),true);
Excel::create('transactions', function ($excel) use($transactions) {
$excel->sheet('Sheetname', function ($sheet) use($transactions) {
$sheet->setOrientation('landscape');
// first row styling and writing content
$sheet->loadView('export.lacrosse.accounting.all')->with('payments', $transactions->transaction);
});
})->download('xlsx');
}
示例3: vaultEdit
public function vaultEdit($id)
{
$user = Auth::user();
$title = 'League Together - Settings';
$follow = Follower::where("user_id", "=", $user->id)->FirstOrFail();
$club = Club::find($follow->club_id);
if ($user->profile->customer_vault) {
$param = array('report_type' => 'customer_vault', 'customer_vault_id' => $user->profile->customer_vault, 'club' => $club->id);
$payment = new Payment();
$vault = $payment->ask($param);
}
if (isset($vault)) {
return View::make('app.account.settings.vaultEdit')->with('page_title', $title)->with('vault', $vault)->withUser($user);
}
return Redirect::action('AccountController@settings');
}
示例4: PaymentSuccess
public function PaymentSuccess($id)
{
$result = Session::get('result');
$user = Auth::user();
$participant = Participant::find($id);
$player = $participant->player;
$club = $participant->event->club;
$title = 'League Together - ' . $participant->event->club->name . ' Events';
if (!$result) {
return Redirect::action('AccountController@index');
}
$param = array('transaction_id' => $result->transactionid, 'club' => $club->id, 'action_type' => $result->type);
$payment = new Payment();
$transaction = json_decode(json_encode($payment->ask($param)), false);
$items = Cart::contents();
// Clean the cart
Cart::destroy();
return View::make('app.club.event.participant.checkout.success')->with('page_title', 'Payment Complete')->withUser($user)->with('products', $items)->with('result', $result)->with('transaction', $transaction->transaction);
}
示例5: error
public function error($param, $id, $playerid)
{
setlocale(LC_MONETARY, "en_US");
$club = Club::Find($id);
$user = Auth::user();
$player = Player::find($playerid);
$query = array('report_type' => 'customer_vault', 'customer_vault_id' => $user->profile->customer_vault, 'club' => $club->id);
$payment = new Payment();
$vault = json_decode(json_encode($payment->ask($query)), false);
//convert object to array
$dt = json_decode(json_encode($param), false);
//clean duplicates from array
//$club = array_unique($club);
//cart content
$items = Cart::contents();
$data = array('data' => $dt, 'vault' => $vault, 'products' => $items, 'club' => $club, 'player' => $player);
$mail = Mail::send('emails.receipt.error', $data, function ($message) use($user, $club) {
$message->to($user->email, $user->profile->firstname . ' ' . $user->profile->lastname)->subject("Payment Declined | {$club->name}");
foreach ($club->users()->get() as $value) {
$message->bcc($value->email, $club->name)->subject("Payment Declined - {$club->name}");
}
});
return $mail;
}
示例6: PaymentSuccessTeam
public function PaymentSuccessTeam($club, $id)
{
$result = Session::get('result');
$user = Auth::user();
$team = Team::find($id);
$club = Club::find($club);
$title = 'League Together - ' . $club->name . ' Teams';
if (!$result) {
return Redirect::action('AccountController@index');
}
/*
$param = array(
'report_type' => 'customer_vault',
'customer_vault_id' => $user->profile->customer_vault,
'club' => $club->id
);
$payment = new Payment;
$vault = $payment->ask($param);*/
//get transaction data from CF
$param = array('transaction_id' => $result->transactionid, 'club' => $club->id, 'action_type' => $result->type);
$payment = new Payment();
$transaction = json_decode(json_encode($payment->ask($param)), false);
$items = Cart::contents();
// Clean the cart
Cart::destroy();
return View::make('app.public.club.team.success')->with('page_title', 'Payment Complete')->withUser($user)->with('products', $items)->with('result', $result)->with('transaction', $transaction->transaction);
}