#Bryan Millón

1 messages · Page 1 of 1 (latest)

fading brookBOT
coral terrace
#

This is my code

pale harbor
#

What error are you getting?

coral terrace
#

I don't know what parameter is missing

#

I've been searching in documentation, but i don't found anything

#

i copied the example code that stripe has in the documentation too, but doesn't work

pale harbor
#

Ahhh, okay. Do you have a request ID? I think the field you need to add is type but I'm not sure yet.

Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request

coral terrace
#

Yes i have the rquest ID

#

I found that but i don't know what type is required

pale harbor
#

What's the whole code that shows type? I have no idea where that screenshot is coming from or what request is looking for type

coral terrace
#

That screenshot is from the dashboard

#

This is my code

#

I copied that code from the examples

#

From here

#

but doesn't work

pale harbor
#

What object is type on? The error indicates you didn't pass type when you should have, so can you look at the dashboard where you took that screenshot and discern which object it's missing from?

coral terrace
#

{
"error": {
"code": "parameter_missing",
"doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
"message": "Missing required param: type.",
"param": "type",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_sbuMRBMvYX9Muh?t=1669159017",
"type": "invalid_request_error"
}
}

Learn more about error codes and how to resolve them.

pale harbor
coral terrace
#

sorry, i sent the message before read it

#

{
"line_items": {
"0": {
"price_data": {
"unit_amount": "2000",
"currency": "usd",
"product_data": {
"name": "T-shirt"
}
},
"quantity": "1"
}
},
"cancel_url": "http://localhost:3000/",
"shipping_address_collection": {
"allowed_countries": {
"0": "US",
"1": "CA"
}
},
"success_url": "http://localhost:3000/checkout-success",
"mode": "payment",
"shipping_options": {
"0": {
"shipping_rate_data": {
"display_name": "Free shipping",
"fixed_amount": {
"currency": "usd",
"amount": "0"
},
"delivery_estimate": {
"minimum": {
"value": "5",
"unit": "business_day"
},
"maximum": {
"value": "7",
"unit": "business_day"
}
}
}
}
},
"payment_method_types": {
"0": "card"
},
"type": <required>
}

pale harbor
#

What's the request ID for that request?

coral terrace
#

req_sbuMRBMvYX9Muh

#

Do you mean this ID?

trim herald
#

Hi 👋

coral terrace
#

Hi👋

coral terrace
trim herald
#

I'm looking as well

#

Wait I think I've found it

#

You need to specify the shipping_options.shipping_rate_data.type

#

Even though the only current option is fixed_amount

coral terrace
#

I tried specifying inside the object shipping_rate_data

#

but in my function fixed_amount is already there

#

look

trim herald
#

That isn't what is needed

#

The type: fixed_amount is required

#

It doesn't matter if you pass the fixed_amount hash, you still need to provide the type enum

coral terrace
#

Is already working, thank you for help me

trim herald
#

🎉