为了账号安全,请及时绑定邮箱和手机立即绑定

未找到列:1054 Champ 'payment_gateway' inconnu dans

未找到列:1054 Champ 'payment_gateway' inconnu dans

PHP
慕姐8265434 2023-04-21 13:12:14
我参加了使用 laravel 的电子商务培训,我想通过 paypal 购物车进行在线支付,但它在payment_gateway表格订单领域给我错误,Column not found: 1054 Field 'payment_gateway' unknown in field list。你好,我参加了一个使用 laravel 的电子商务培训,我想通过 paypal 购物车进行在线支付,但它在payment_gateway表格订单领域给我错误,Column not found: 1054 Field 'payment_gateway' unknown in field list。checkoutController.php/**     * Store a newly created resource in storage.     *     * @param  \Illuminate\Http\Request  $request     * @return \Illuminate\Http\Response     */    public function paypalCheckout(Request $request)    {        // Check race condition when there are less items available to purchase        if ($this->productsAreNoLongerAvailable()) {            return back()->withErrors('Sorry! One of the items in your cart is no longer avialble.');        }        $gateway = new \Braintree\Gateway([            'environment' => config('services.braintree.environment'),            'merchantId' => config('services.braintree.merchantId'),            'publicKey' => config('services.braintree.publicKey'),            'privateKey' => config('services.braintree.privateKey')        ]);        $nonce = $request->payment_method_nonce;        $result = $gateway->transaction()->sale([            'amount' => round(getNumbers()->get('newTotal') / 100, 2),            'paymentMethodNonce' => $nonce,            'options' => [                'submitForSettlement' => true            ]        ]);        $transaction = $result->transaction;        if ($result->success) {            $order = $this->addToOrdersTablesPaypal(                $transaction->paypal['payerEmail'],                $transaction->paypal['payerFirstName'].' '.$transaction->paypal['payerLastName'],                null            );
查看完整描述

2 回答

?
九州编程

TA贡献1785条经验 获得超4个赞

打字的时候好像打错了payement_gateway => payment_gateway



查看完整回答
反对 回复 2023-04-21
?
慕侠2389804

TA贡献1719条经验 获得超6个赞

确保了:

1- 将 payment_gateway 添加到 Order 模型的可填充数组

2-payment_gateway 列在表“订单”列中...


查看完整回答
反对 回复 2023-04-21
  • 2 回答
  • 0 关注
  • 123 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信