小编Cha*_*tis的帖子

设置 Stripe 结帐会话的描述

我按照他们的要求开发了年底的最后一个 Stripe 模块,但自从我提出之后,我就没有再在 Stripe 中提供任何描述和客户姓名。

你知道我怎样才能把它再放一次吗?

这是我的 PHP 代码:

 try { 
    $session = \Stripe\Checkout\Session::create([ 
        'payment_method_types' => ['card'],
        'customer_email' => $email,
        'line_items' => [[ 
            'price_data' => [ 
                'product_data' => [ 
                    'name' => $custom['item_name'], 
                    'metadata' => [ 
                        'pro_id' => $custom['item_name'] 
                    ] 
                ], 
                'unit_amount' => (isset($custom['amountTotal']) ? $custom['amountTotal'] : $custom['amount'])*100, 
                'currency' => $custom['currency_code'], 
            ], 
            'quantity' => 1, 
            'description' => $custom['item_name'], 
        ]], 
        'mode' => 'payment', 
        'success_url' => $url, 
        'cancel_url' => $request->cancel,
        ], ['stripe_account' => $_SESSION['param']->stripeUID]); 
}catch(Exception $e) {  
    $api_error = $e->getMessage();  
} 
 
if(empty($api_error) && …
Run Code Online (Sandbox Code Playgroud)

php stripe-payments

1
推荐指数
1
解决办法
3360
查看次数

标签 统计

php ×1

stripe-payments ×1