示例#1
0
文件: Payby.php 项目: miladr/payby
 /**
  * @param $amount
  * @param $type
  * @param $payment_id
  * @param $driver
  * @param $created_at
  * @param $parms
  * @return InvoiceModel
  */
 public function createInvoice($amount, $type, $payment_id, $driver, $created_at, $parms)
 {
     $invoice = InvoiceModel::where('type', '=', $type)->where('payment_id', '=', $payment_id)->where('driver', '=', $driver)->first();
     if (!is_null($invoice)) {
         return $invoice;
     } else {
         $invoice = new InvoiceModel();
         $invoice->amount = $amount;
         $invoice->type = $type;
         $invoice->payment_id = $payment_id;
         $invoice->driver = $driver;
         $invoice->created_at = $created_at;
         $invoice->status = 0;
         $invoice->parms = json_encode($parms);
         $invoice->save();
         return $invoice;
     }
 }
示例#2
0
文件: routes.php 项目: miladr/payby
<?php

Route::get('payby/test', function () {
    //test
    $invoice = \Miladr\Payby\Models\InvoiceModel::find(1);
    return Payby::getBankForm($invoice);
});
Route::get('payby/result/{drivername}', function () {
    $returnData = \Input::all();
    return Payby::processBankResult($drivername, $returnData);
});