Laravel 我可以使用带目的地费用的条带结账吗?

Laravel 我可以使用带目的地费用的条带结账吗?,laravel,stripe-payments,Laravel,Stripe Payments,我想知道是否有任何方法可以对使用新的条带结账系统的交易收取某种费用。在这个特殊的例子中,我使用了带有Livewire的Laravel8。在我的组件中,有一个函数绑定到一个名为SetTripSession的按钮 \Stripe\Stripe::setApiKey(env('STRIPE_SECRET')); $session = \Stripe\Checkout\Session::create([ 'payment_method_types'

我想知道是否有任何方法可以对使用新的条带结账系统的交易收取某种费用。在这个特殊的例子中,我使用了带有Livewire的Laravel8。在我的组件中,有一个函数绑定到一个名为SetTripSession的按钮

        \Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
        $session = \Stripe\Checkout\Session::create([
            'payment_method_types' => ['card'],
            'line_items' => [[
              'price_data' => [
                'currency' => 'usd',
                'product_data' => [
                  'name' => 'Custom Media',
                ],
                'unit_amount' => $this->toPennies($price),
              ],
              'quantity' => 1,
            ]],
            'mode' => 'payment',
            'success_url' => 'http://e68ec3e6b8b2.ngrok.io/',
            'cancel_url' => 'http://e68ec3e6b8b2.ngrok.io/',
            ],['stripe_account_id'=>$this->stripe_account_id]);
            $this->stripe_session_id = $session->id;
            Message::where('id',$message_id)->update(['stripe_session_id'=>$this->stripe_session_id ]);
            $this->emit('PayonStripe',['ssid'=>$session->id]);

    }
我设想添加如下代码,但在rquest期间,StripeAPI无法识别这些变量

  'transfer_data' => [
    'destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
  ],

对!!您可以在中设置这些选项:

许多参数在签出时以这种方式公开,例如支付意图的
元数据
,以及
subscription\u data
下订阅模式的类似数据

$session = \Stripe\Checkout\Session::create([
  'payment_method_types' => ['card'],
  'line_items' => [...],
  'mode' => 'payment',
  'success_url' => 'http://example.com/success',
  'cancel_url' => 'http://example.com/cancel',
  'payment_intent_data' => [
    'application_fee_amount' => 100, // optional
    'transfer_data' => [
      'destination' => 'acct_123',
    ],
  ],
]);