#AlexElba
1 messages · Page 1 of 1 (latest)
Collect address: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-billing_address_collection
Collect phone:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-phone_number_collection
Collect Custom fields:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-custom_fields
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am bit confused how to pass custom field
$session = \Stripe\Checkout\Session::create([
'payment_method_types' => ['card'],
'client_reference_id' => $userInfo->id,
'line_items' => [
[
'price_data' => [
'currency' => $currency,
'unit_amount' => $price,
'product_data' => [
'name' => 'Subscription',
],
],
'quantity' => 1,
],
],
'mode' => 'subscription',
'billing_address_collection' => 'required',
'custom_fields' => [ 'dropdown' =>
[
'label' => 'Investment Focus',
'key' => 'investment_focus',
'type' => 'dropdown',
'options' => [['label'=>'XX', 'value'=>'YYY']],
'optional' => true,
],
],
'success_url' => $successUrl,
'cancel_url' => $cancelUrl,
]);
as dropdown
I get error unknown parameter custom_fields