亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Braintree 中的托管字段給出錯誤“無法確定付款方式”PHP Laravel

Braintree 中的托管字段給出錯誤“無法確定付款方式”PHP Laravel

PHP
嚕嚕噠 2022-10-28 09:43:46
誰能解釋我如何在 Laravel 中使用托管字段進行有效的 Braintree 付款。我試圖自己查看文檔,但無法使其正常工作。我在控制器中創建了要發送到視圖的令牌,例如:$gateway = new \Braintree\Gateway([            'environment' => config('services.braintree.environment'),            'merchantId' => config('services.braintree.merchantId'),            'publicKey' => config('services.braintree.publicKey'),            'privateKey' => config('services.braintree.privateKey')        ]);$paypalToken = $gateway->ClientToken()->generate();return view('checkout')->with(['paypalToken' => $paypalToken]);這是我處理付款的方法:        $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            ]          ]);        if ($result->success) {            $transaction = $result->transaction;            $order = $this->addToOrdersTablesPaypal(                $email,                $firstName.' '.$lastName,                null            );            return redirect()->route('confirmation.index')->with('success_message', 'Thank you! Your payment has been successfully accepted!');        } else {            $order = $this->addToOrdersTablesPaypal(                $email,                $firstName.' '.$firstName,                $result->message            );            return back()->withErrors('An error occurred with the message: '.$result->message);        }誰能幫助我,了解缺少什么?
查看完整描述

1 回答

?
牧羊人nacy

TA貢獻1862條經驗 獲得超7個贊

我解決了它,我實際上找到了一種解決方法,我必須為托管字段創建一個控制器,并且它有效。



查看完整回答
反對 回復 2022-10-28
  • 1 回答
  • 0 關注
  • 97 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號