#joshglazebrook

1 messages ยท Page 1 of 1 (latest)

quartz oakBOT
edgy prawn
#

The subscription should be set to active when the first invoice is $0. paid status is only for the invoices.

#

Shouldn't the subscription be active?

snow oxide
#

Essentially i'm trying to follow this - https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=subscription#web-collect-payment-details

So the user registers, is presented with lets say 3 plans, chooses one, enters their payment info (paymentelement), then confirms/submits.

One of which is $0.00/month + $0.05/per unit used.

I create the subscription object for the customer, I'm setting paymentbehavior as "default_incomplete", as I want to collect the payment info after the user selects the subscription plan. But the subscription is automatically in the "active" state because the invoice is $0.00, even though I haven't collected their payment method.

subscriptionParams := &stripe.SubscriptionParams{
    Customer: teamEnt.StripeCustomerID,
    Items: []*stripe.SubscriptionItemsParams{
        {
            Price: stripe.String(reqParams.PriceID),
        },
    },
    PaymentSettings: &stripe.SubscriptionPaymentSettingsParams{
        SaveDefaultPaymentMethod: stripe.String("on_subscription"),
    },
    PaymentBehavior: stripe.String("default_incomplete"),
}
subscriptionParams.AddExpand("latest_invoice.payment_intent")

Then collect payment info via paymentelement, etc.

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

#

Only this price is $0.00, others are $49.99/month as an example and they start in the "incomplete" state.

quartz oakBOT
snow oxide
#

So in this case, I would immediately get the customer.subscription.created as technically its immediately paid for, but I haven't collected any payment methods from the customers for future one off charges or future invoices that will not be $0.00 nor completed a final "subscribe" action from the user which seems kinda weird.

viscid girder
#

๐Ÿ‘‹ catching up and gimme some time

#

$0.00/month + $0.05/per unit used.
How do you setup this Price?

#

Do you set it as metered usage or licensed usage?

snow oxide
#

So the way I was going about it was just having a standard priced product for the monthly fee. $0.00/month in this case. And then I have another product for the "unit" which I was just going to add as an invoice item for the upcoming invoice.

#

I think its similar to "flat rate + metered", but the flat rate in this case is $0.00/month. and the metered product is $0.05.

#

But because the flat rate is $0.00 in this case, creating that subscription automatically sets it to active?

viscid girder
snow oxide
#

So I want to have a flat rate + usage. But the lowest tier is a free flat rate + usage.

#

The user can change to a non free flat rate + usage plan. etc

viscid girder