Size: a a a

2019 November 21

мн

мистер никитос... in Laravel Pro
😂
источник

OK

Oleg Komenda 👨‍💻... in Laravel Pro
Ребят, кто-то интегрировал ERC-20, делал смартконтракты и так далее...?
Попался заказ интерсный, но там много мути с криптой, впервые с ней работаю и не совсем ещё понимаю.
источник

A

Andrei in Laravel Pro
lol 14 bucks
источник

A

Andrei in Laravel Pro
public function payment(Request $request,$id){
       $products = ProductsModel::findorfail($id);
       $productPrice = $products->price;
       $this->payment_process($request,$productPrice);

   
       return view('pages/payment')->with(['products' => $products]);
   }

   public function payment_process(Request $request,$productPrice){
     

     
       \Stripe\Stripe::setApiKey('...');
       try {
           Charge::create ( array (
                   "amount" => $productPrice * 100,
источник

A

Andrei in Laravel Pro
I want to pass $productPrice variable from payment() method to the second method payment_process()
but it doesn't works
источник

A

Andrei in Laravel Pro
It returns me this error without letting me to fill the form and send the data
источник

A

Andrei in Laravel Pro
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'firstName' cannot be null (SQL: insert into order_details (`firstName`, lastName, email, country, address, address2, state, zip, `extrainformation`) values (?, ?, ?, ?, ?, ?, ?, ?, null))
источник

мн

мистер никитос... in Laravel Pro
Andrei
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'firstName' cannot be null (SQL: insert into order_details (`firstName`, lastName, email, country, address, address2, state, zip, `extrainformation`) values (?, ?, ?, ?, ?, ?, ?, ?, null))
So... I guess you are trying to pass null there =\
источник

x

x1dan in Laravel Pro
Andrei
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'firstName' cannot be null (SQL: insert into order_details (`firstName`, lastName, email, country, address, address2, state, zip, `extrainformation`) values (?, ?, ?, ?, ?, ?, ?, ?, null))
у тебя в таблице 9 значений, передаешь 8 как бы
источник

x

x1dan in Laravel Pro
а нее
источник

x

x1dan in Laravel Pro
глючит на ночь уже
источник

A

Andrei in Laravel Pro
I am not trying to send any null values
источник

A

Andrei in Laravel Pro
When I am trying to select a product to buy , it returns me that error
источник

мн

мистер никитос... in Laravel Pro
It's not possible to track this error without any actual code for this part. I dont see any mistakes in one you pasted before. Try to find where model OrderDetail is created or something
источник

WJ

Witty Judge in Laravel Pro
I don't know how to help you but I found one article with that issue. Maybe it will help you after reading
источник

WJ

Witty Judge in Laravel Pro
источник

RR

Roma Roma in Laravel Pro
Oleg Sika
Ребят. Немного не по теме. Но очень нужно решить задачу.
Есть вот такой массив

[
   0 => [
        'controller' => ['v1/user'],
        'role' => [1],
        'action' => ['read']
   ],
   1 => [
       'controller' => ['v1/user'],
       'role' => [1],
       'action' => ['create']
   ],
   2 => [
       'controller' => ['v1/user'],
       'role' => [1],
       'action' => ['update']
   ],
   3 => [
       'controller' => ['v1/user'],
       'role' => [2],
       'action' => ['read']
   ],
   4 => [
       'controller' => ['v1/user'],
       'role' => [2],
       'action' => ['create']
   ]
]
Нужно сделать такой

[
   0 => [
        'controller' => ['v1/user'],
        'role' => [1, 2],
        'action' => ['read']
   ],
   1 => [
       'controller' => ['v1/user'],
       'role' => [1, 2],
       'action' => ['create']
   ],
   2 => [
       'controller' => ['v1/user'],
       'role' => [1],
       'action' => ['update']
   ]
]
источник

RR

Roma Roma in Laravel Pro
А не то( ну ладно
источник

A

Andrei in Laravel Pro
public function payment(Request $request,$id){
       $products = ProductsModel::findorfail($id);
       $productPrice = $products->price;
       
       $this->payment_process($request,$productPrice);
       
   
       return view('pages/payment')->with(['products' => $products]);
   }

   public function payment_process(Request $request,$productPrice){
     
       $product = new OrderDetailsModel;
       
   /*    $this->validate($request, [
           'firstName' => 'required',
           'lastName' => 'required',
           'country' => 'required',
           'state' => 'required',
           'zip' => 'required',
           'address'=> 'required'        
       ]);*/
     
       
       $product->firstName = request('firstName');
       $product->lastName = request('lastName');
       $product->email = request('email');
       $product->country = request('country');
       $product->address = request('address');
       $product->address2 = request('address2');
       $product->state = request('state');
       $product->zip = request('zip');
       $product->extrainformation = 'null';
       $product->save();
       \Stripe\Stripe::setApiKey('...');
       try {
           Charge::create ( array (
                   "amount" => $productPrice * 100,
                   //(float)$request->input('getPrice') * 100,
                   "currency" => "usd",
                   "source" => 'tok_visa', // obtained with Stripe.js
                   "description" => "Test payment."
           ) );
           Session::flash ( 'success-message', 'Payment done successfully !' );
           return Redirect::back ();
       } catch ( \Exception $e ) {
           Session::flash ( 'fail-message', "Error! Please Try again." );
           return Redirect::back ();
       }
   
       return redirect('/')->with('success', 'Order Created');

   }
}
источник

A

Andrei in Laravel Pro
thats my full code from that 2 methods
источник