0
如何存儲唯一$payment->transaction_id = Input::get('transact');
沒有更多transaction_id
應與相同數量的存儲商店獨特的價值到數據庫laravel 4.2
請給我建議。
public function ddclback()
{
if(Input::get('statuscode') == 2){
//Save data into the Database
$payment = new Payment;
$payment->order_id = Input::get('orderid');
$payment->amount = (Input::get('base_amount', 0))?Input::get('base_amount'):Input::get('amount');
$payment->amount = $payment->amount/100;
$payment->cc_fee = Input::get('processing_fee', 0);
$payment->payment_type = 'CCD-'.Input::get('currency');
$payment->currency = Input::get('currency');
$payment->exchange_rate = $this->getExchangeRate(Input::get('currency'));
$payment->gateway = 'DIBS';
$payment->payment_date = date('Y-m-d'); //\Carbon\Carbon::today()->toDateString();
$payment->card_type = Input::get('paytype');
$payment->transaction_id = Input::get('transact');
$payment->customer_ip = $_SERVER['REMOTE_ADDR'];
$payment->save();
Order::ccid(Input::get('orderid'));
Order::upord(Input::get('orderid'));
}
}
Dhaval什麼,我猜測這$費付款> TRANSACTION_ID =輸入::獲得( '辦理');是通過dibs後端它應該來獨特的Bt有時它是調用5次相同的事務ID不知道爲什麼有任何想法 – Jimmy
你應該檢查從這個函數被調用的位置的代碼。 –
如何檢查數據庫中是否存在order_id,並且transaction_id是否存在,它將只保存同一代碼中的一個數據 – Jimmy