#Dynelight

1 messages · Page 1 of 1 (latest)

tough flameBOT
crimson crane
#
customer = Stripe::Customer.create(
        description: "#{name} (Id: #{id})",
        coupon: coupon_stripe_id.presence,
        name: name,
        email: email_address
      )

      subscription = Stripe::Subscription.create(
        {
          customer: customer.id,
          items: [
            {
              price: self.plan.stripe_id
            }
          ],
          trial_period_days: 14
        }
      )
sterile spear
#

Do you have an example Subscription ID?

crimson crane
#

Yeah one sec

#

Like you can actually go to stripe and query it?

subtle hollow
#

We have internal tools that let us see what's going on with the Subscription as long as you provide us with the ID

crimson crane
#

price_0M99Dl85cJoRoAtCjH8xrBxg

subtle hollow
#

That's a Price ID - do you have a Subscription ID (should be something like sub_xxx)

crimson crane
#

sub_0MCWhu85cJoRoAtCmbGHUwqM

#

that's an ID that got cancelled

subtle hollow
#

👍 perfect let me take a look!

crimson crane
#

tyyy

subtle hollow
#

Do you have any code (maybe as part of your webhook handler) that cancels subscriptions?

crimson crane
#

I disabled my webhooks

#

And it's still being cancelled lemme try again

#

sub_0MCX9g85cJoRoAtCoeqCc2PE

#

yep... my custom weebhooks are disabled

#

I don't even explicitly handle customer.subscription.deleted

subtle hollow
crimson crane
#

Those are the defaults from my stripe integration library (the pay gem on rails)

#

But I can disable it

subtle hollow
#

Yeah try disabling it and see what happens

#

And just want to be clear - I'm not 100% sure this is because ofyour webhook, but what I can say for sure is that these cancellations are happening because something in your integration is making the request to cancel it (so it could be happening else where in your integration)

crimson crane
#

I disabled the pay gem's webhooks on stripe and it didn't delete that one

#

I wonder if there is something the pay gem is expecting that is forcing the cancelation

#

I'm not creating the subscriptions explicitly with the pay gem, I am with stripe. So maybe I should do it with the pay gem library

subtle hollow
#

Yeah I don't know anything about the specific library you're using, but it sounds like something about your usage of it is not aligning with what they expect

crimson crane
#

Okay it seems this is more on my side now. Thanks so much!