Laravel Cashier Stripe无法保存客户地址信息求助
Stripe托管结账流程:客户地址无法保存至Stripe
环境信息
- Laravel版本:v10.48.22
- cashier/stripe版本:v15.4.3
问题详情
订阅功能及Stripe账单页面均正常工作,但通过托管结账流程传递的客户地址信息未被Stripe保存。已确认所有地址字段在发送前均已正确填充,但Stripe测试模式下创建的新客户日志中,address字段为null。
当前结账流程代码
$user = $request->user(); return $user->newSubscription(config('stripe.product'), $plan) ->allowPromotionCodes() ->checkout([ 'success_url' => route('success'), 'cancel_url' => route('dashboard'), 'customer' => [ 'address' => [ 'line1' => $user->street, 'line2' => $user->company, 'city' => $user->city, 'postal_code' => $user->plz, 'country' => $user->country, 'state' => $user->state, ], 'name' => $user->name, 'email' => $user->email, ], ]);
Stripe客户日志(地址为空)
{ "object": { "id": "cus_R5bYAaOTUyIhBz", "object": "customer", "address": null, "balance": 0, "created": 1729773631, "currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, "email": "mosuqeg@mailinator.com", "invoice_prefix": "B079FB88", "invoice_settings": { "custom_fields": null, "default_payment_method": null, "footer": null, "rendering_options": null }, "livemode": false, "metadata": { }, "name": "Kuame Greer", "phone": null, "preferred_locales": [ ], "shipping": null, "tax_exempt": "none", "test_clock": null } }
Webhook日志(功能正常)
2024-10-24 14:40:32 --> customer.created [evt_1QDQL6LkBjrUprZrDsqUbpIS] 2024-10-24 14:40:32 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQL6LkBjrUprZrDsqUbpIS] 2024-10-24 14:40:59 --> charge.succeeded [evt_3QDQLVLkBjrUprZr3pODaVpl] 2024-10-24 14:40:59 --> checkout.session.completed [evt_1QDQLXLkBjrUprZrZJfRgmM4] 2024-10-24 14:40:59 <-- [200] POST http://localhost:8000/stripe/webhook [evt_3QDQLVLkBjrUprZr3pODaVpl] 2024-10-24 14:40:59 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLXLkBjrUprZrZJfRgmM4] 2024-10-24 14:40:59 --> payment_method.attached [evt_1QDQLXLkBjrUprZrK7ZSntor] 2024-10-24 14:40:59 --> customer.updated [evt_1QDQLXLkBjrUprZrROH0loqv] 2024-10-24 14:40:59 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLXLkBjrUprZrK7ZSntor] 2024-10-24 14:40:59 --> customer.subscription.created [evt_1QDQLXLkBjrUprZr8apagy2E] 2024-10-24 14:41:00 --> customer.subscription.updated [evt_1QDQLXLkBjrUprZrJtNlNzrE] 2024-10-24 14:41:00 --> payment_intent.succeeded [evt_3QDQLVLkBjrUprZr3UMdJy8Y] 2024-10-24 14:41:00 --> payment_intent.created [evt_3QDQLVLkBjrUprZr3WAiZ3Tf] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLXLkBjrUprZrROH0loqv] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLXLkBjrUprZr8apagy2E] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLXLkBjrUprZrJtNlNzrE] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_3QDQLVLkBjrUprZr3UMdJy8Y] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_3QDQLVLkBjrUprZr3WAiZ3Tf] 2024-10-24 14:41:00 --> invoice.created [evt_1QDQLYLkBjrUprZrGFq5uaiy] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLYLkBjrUprZrGFq5uaiy] 2024-10-24 14:41:00 --> invoice.finalized [evt_1QDQLYLkBjrUprZr1jWBUzxo] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLYLkBjrUprZr1jWBUzxo] 2024-10-24 14:41:00 --> invoice.updated [evt_1QDQLYLkBjrUprZr0mMUimgL] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLYLkBjrUprZr0mMUimgL] 2024-10-24 14:41:00 --> invoice.paid [evt_1QDQLYLkBjrUprZrdJWCKNyP] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLYLkBjrUprZrdJWCKNyP] 2024-10-24 14:41:00 --> invoice.payment_succeeded [evt_1QDQLYLkBjrUprZrWgc2e6sz] 2024-10-24 14:41:00 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQLYLkBjrUprZrWgc2e6sz] 2024-10-24 14:41:58 --> billing_portal.session.created [evt_1QDQMULkBjrUprZr9S3iWOPj] 2024-10-24 14:41:58 <-- [200] POST http://localhost:8000/stripe/webhook [evt_1QDQMULkBjrUprZr9S3iWOPj]
提问
请问我哪里操作有误?感谢您的帮助。
内容的提问来源于stack exchange,提问作者Raphael W
相关产品推荐
相关产品推荐

