#krishna_subscription-setupfee

1 messages · Page 1 of 1 (latest)

hushed sequoiaBOT
#

đź‘‹ 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/1230559799716872283

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

rough quailBOT
#

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.

lucid minnow
#

Hey @bright depot I don't understand what you call a "normal transaction". Can you give me an example of what someone pays today versus in a month?

bright depot
#

Normal transasction means one time transaction.

#

want to do one time transaction and at the same time start recurring from next month

lucid minnow
#

I'm really sorry but I don't get what that could mean.
If you charge me $10 today and then $10 in one month, then really you are starting a $10/month recurring subscription right now

bright depot
#

Suppose I want to charge user $10 as one time payment but from next month want to start recurring of $50 which will be for one year subscritpion

#

$10 will be one time payment not recurring.

lucid minnow
#

Would this be kind of a "paid trial"? Like you pay $10 now for a trial of the $50/year subscription?

bright depot
#

Kind of same.

lucid minnow
#

Okay so what you want to do is start the Subscription and its trial really immediately and you can have a "one-off invoiceItem" for that $10 fee. How to do this depends how you integrate. Do you use Checkout or the Subscriptions API directly?

#

krishna_subscription-setupfee

bright depot
#

Subscription API

lucid minnow
bright depot
#

add_invoice_items: [
{
price: '{{PRICE_ID}}',
},
],

#

is it?

lucid minnow
#

yes

#

try it in Test mode!

bright depot
#

waht to pass as PRICE_ID?

lucid minnow
#

the id of a Price that represents that $10.

bright depot
#

Do I need to crate price like same

const price = await stripe.prices.create(
      {
        unit_amount: intAmount,
        currency: currency.toLowerCase(),
        recurring: { interval: "month" },
        product: product.id,
      },
      {
        stripeAccount: stripeAcId,
      }
    );
lucid minnow
#

yes

#

I mean not recurring since it's a one-time, but otherwise yes

bright depot
#

So need to create product also ?

#

So there will be 2 product and 2 price?

lucid minnow
#

yes

#

you are clearly charging for different things here so it's important to model them as their own Product and Price

bright depot
#

Okay got it. But how long that $10 will be charged. How can I manage that?

#

I want to charge $10 for 1 month and $50 for remaining months

lucid minnow
#

Please try it first, I can see you're confused and just seeing the subscription should help.
The $10 is charged once as a one-time fee, then the Subscription would be on a trial period until next month where it would charge $50 each month. That's exactly what you described I think

bright depot
#

Yes I want same.

#

But as I read document:
Add an extra charge on a subscription’s first invoice
Include a one-time charge to the first subscription invoice using add_invoice_items:

lucid minnow
#

yes but you're doing a trial period

bright depot
#

Isn't it like first month $50 + $10 then remaining month only $50?

lucid minnow
#

really just try it as a developer, this will be much faster

hushed sequoiaBOT
bright depot
#

Trying

#

pi_3P6yYxDBfYojrB0W04qnBOE8

#

charged same $50

#

const product = await stripe.products.create(product_name, {
stripeAccount: bank_info.stripe_account_id,
});

      const product_1 = await stripe.products.create(product_name, {
        stripeAccount: bank_info.stripe_account_id,
      });

      // Create price
      const price = await stripe.prices.create(
        {
          unit_amount: intAmount,
          currency: currency.toLowerCase(),
          recurring: { interval: "month" },
          product: product.id,
        },
        {
          stripeAccount: bank_info.stripe_account_id,
        }
      );

      const price_1 = await stripe.prices.create(
        {
          unit_amount: '10',
          currency: currency.toLowerCase(),
          product: product_1.id,
        },
        {
          stripeAccount: bank_info.stripe_account_id,
        }
      );
small bobcat
#

Hello! I'm taking over and catching up...

bright depot
#

// Create subscription
const subscription = await stripe.subscriptions.create(
{
customer: customer.id,
items: [{ price: price.id }],
add_invoice_items: [
{
price: price_1.id,
},
],
payment_behavior: "default_incomplete",
payment_settings: {
save_default_payment_method: "on_subscription",
},
expand: ["latest_invoice.payment_intent"],
application_fee_percent: +service_fee,
cancel_at: sub_end_date,
description: title,
},
{
stripeAccount: bank_info.stripe_account_id,
}
);

lucid minnow
#

you forgot to do the trial like I explained.

#

and really: try it on your own account with Connect first, look at the real Subscription and the resulting Invoice in the Dashboard to understand it.

#

(leaving to Rubeus, just nudging you to try things slowly to grasp them)

bright depot
#

Where to add trial?

small bobcat
bright depot
#

pi_3P6yjxDBfYojrB0W1OtfMGc5

#

Sir, Can you please check will this trial run for 30 days and then regular payment of $50 will start

small bobcat
#

Yep, looks like it.

bright depot
#

Yes sir. I did test clock

#

next payment has been of $50

small bobcat
#

And what's what you wanted, right?

bright depot
#

Yes sir.

#

Done whatever I wanted

#

Thank you so much for your help

small bobcat
#

We're happy to have helped you!

bright depot
#

@lucid minnow Thank you

#

Have a nice day

#

bye