#james_35976
1 messages · Page 1 of 1 (latest)
Hello james_35976, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• james_35976, 0 days ago, 5 messages
• james_35976, 1 days ago, 7 messages
• james-checkout-php, 1 days ago, 103 messages
• james_35976, 4 days ago, 18 messages
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
So what's the exact error message that you received?
Uncaught Error sending request to Stripe: (Status 400) (Request req_3PSDz6Osroxv4J) Received unknown parameter: shipping_address_collection[shipping_options]
Stripe\Exception\InvalidRequestException: Received unknown parameter: shipping_address_collection[shipping_options] in /var/www/html/MiniS/stripe/lib/Exception/ApiErrorException.php:38
array(10) {
["line_items"]=>
array(1) {
[0]=>
array(3) {
["currency"]=>
string(3) "USD"
["product_data"]=>
array(2) {
["name"]=>
string(45) "specific item(order note is required) Color:-"
["images"]=>
array(1) {
[0]=>
string(70) "https://www.thumbwholesale.com/MiniS/image/group/1274_1-1690485336.jpg"
}
}
["price_data"]=>
array(2) {
["unit_amount_decimal"]=>
int(100)
["quantity"]=>
int(1)
}
}
}
["mode"]=>
string(7) "payment"
["cancel_url"]=>
string(52) "https://www.iomu.com/stripeCancellation?oId=10007061"
["client_reference_id"]=>
string(8) "10007061"
["success_url"]=>
string(19) "success payment URL"
["automatic_tax"]=>
array(1) {
["enabled"]=>
bool(true)
}
["billing_address_collection"]=>
string(8) "required"
["custom_text"]=>
array(1) {
["shipping_address"]=>
string(8) "required"
}
["shipping_address_collection"]=>
array(2) {
["allowed_countries"]=>
array(1) {
[0]=>
string(2) "US"
}
["shipping_options"]=>
array(1) {
["shipping_rate_data"]=>
array(3) {
["display_name"]=>
string(12) "Shipping Fee"
["type"]=>
string(12) "fixed_amount"
["fixed_amount"]=>
array(2) {
["amount"]=>
int(0)
["currency"]=>
string(3) "USD"
}
}
}
}
["submit_type"]=>
string(3) "pay"
}
Ok, you got this error because you nested shipping_options in shipping_address_collection.
You should move shipping_options out and try again.
let me check the doc again
You did, check this request log https://dashboard.stripe.com/test/logs/req_3PSDz6Osroxv4J
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
i am so sorry I checked again. I did not notice the error
$payment['shipping_address_collection']['allowed_countries'][0] = 'US';
$payment['shipping_address_collection']['shipping_options']['shipping_rate_data']['display_name'] = 'Shipping Fee';
$payment['shipping_address_collection']['shipping_options']['shipping_rate_data']['type'] = 'fixed_amount';
$payment['shipping_address_collection']['shipping_options']['shipping_rate_data']['fixed_amount']['amount'] = (int)$shippingfee * 100;
$payment['shipping_address_collection']['shipping_options']['shipping_rate_data']['fixed_amount']['currency'] = 'USD';
There is not such parameter $payment['shipping_address_collection']['shipping_options']
All of your shipping_options are nested under shipping_address_collection. It should be on its own: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-shipping_options
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 got it.
Is there any way I can submit the sku withe item line?
so if customer change the quantity , i know which item was chaged ?
use line_items.price_data.product_data.metadata
?
Yup, you can set SKU under line_items.price_data.product_data.metadata
{
"shipping_options": {
"shipping_rate_data": {
"display_name": "Shipping Fee",
"type": "fixed_amount",
"fixed_amount": {
"amount": "100",
"currency": "USD"
}
}
}
Invalid array
I did checked 2 times , did not find any error😢
😭
shipping_options is an array of objects, but you're passing an object
That's what an array of shipping_options is for. Customer can choose one of the shipping options from the list you set!