#brel_unexpected

1 messages · Page 1 of 1 (latest)

clever knollBOT
#

đź‘‹ Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1351176838176571422

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

sacred canopyBOT
hot nimbus
#

Hi there đź‘‹ on the settings page you're on, is there a gray box near the top saying?

Some settings are hidden
Settings that affect live integration are hidden in test mode.

If so, those settings can't be changed just for testmode. You can only change them for both modes. To test different settings there you will likely want to spin up a sandbox to test in:
https://docs.stripe.com/sandboxes

This guide outlines Stripe Sandboxes, an isolated test environment for safely testing Stripe functionality without affecting live data. It describes use cases such as simulating transactions without real money and managing isolated testing environments for teams. The guide also provides instructions for managing sandboxes in the Stripe Dashboard...

thick moon
#

Is not a problem for me changing them both for test and live

#

I just want to change

#

Everything is disabled

#

I was able to change them in live

#

thank you

hot nimbus
#

Any time! Glad that pointed you in the right direction.

thick moon
#

One other question

#

For catching unpaid subscriptions which webhooks should I listen?

#

is just subscription.updated?

#

Or there is any specific webhook for when subscription goes in unpaid?

hot nimbus
#

subscription.updated is the best one for that, specifically watching for when status changes to unpaid.

thick moon
#

ok thank you

clever knollBOT
thick moon
#

Stripe::Subscription.create(
customer: current_user.customer.customer_stripe_id,
items: [{ price: params[:price_id] }],
default_payment_method: params[:payment_method_id],
promotion_code: params[:promotion_code_id],
metadata: { property_id: property.id }
)

Currently I am creating the subscription like this. But the problem is that even if customer has a payment mthod that does not have funds this does not return any error and marks the subscriptin as incomplete. In fact I dont want the subscription to be created at all and instead return an error. What can I do?

unique pond
thick moon
#

please refer to my last message

#

It does not have to do with this.

#

I am asking for Create Subscription

#

Does not have to do with update

#

How can I make create subscription return me an erro message and not create the scubsription if payment fails

#

I dont want to have incomplete subscriptions

unique pond
#

You would need to control that and either use the settings above to cancel the subscriptions or cancel them yourself.

Alternatively, you can collect the payment method first and then decide to create the subscription: https://docs.stripe.com/payments/save-and-reuse

However, the second option is not recommended as it's not a lean integration.

thick moon
#

Please don't refer to the old conversation

#

Refer only on this message please:

Stripe::Subscription.create(
customer: current_user.customer.customer_stripe_id,
items: [{ price: params[:price_id] }],
default_payment_method: params[:payment_method_id],
promotion_code: params[:promotion_code_id],
metadata: { property_id: property.id }
)

Currently I am creating the subscription like this. But the problem is that even if customer has a payment mthod that does not have funds this does not return any error and marks the subscriptin as incomplete. In fact I dont want the subscription to be created at all and instead return an error. What can I do?

#

I am asking just for the api to create the subcription

unique pond
thick moon
#

ok thank you

unique pond
#

Did it work? Did you try?

thick moon
#

yes, it worked thank you

unique pond
#

Great to hear

thick moon
#

Is it common to handle the subscription creating this way?

#

with error_if_incomplete?

unique pond