#samip_api

1 messages · Page 1 of 1 (latest)

junior prismBOT
#

👋 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/1239387741977055312

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

crystal osprey
#
      billing_address_collection: 'required',
      line_items: [
        {
          price: priceId,
          quantity: 1,
        },
      ],
      customer: customerId,
      mode: 'subscription',
      success_url: `someURL`,
      cancel_url: `someURL `,
      allow_promotion_codes: true,
      customer_update: {
        address: 'auto',
        name: 'auto',
      },
      subscription_data: {
        // billing_cycle_anchor: Math.floor(Date.now() / 1000) + 30,
        proration_behavior: 'none',
      },
    })```

This is my code currently for reference
proven dust
crystal osprey
#

req_Sa3li5toKca3cf

#

This was my last failed attempt

#

I have given my code for reference too

#

If I set the billing cycle anchor, it shows me that 0.00$ is due today and 0.10$ (product price) will be charged in the same date.

proven dust
crystal osprey
#

Let me create a new request right now and give you a new request I.

#

req_yGPgxJUQliSfhZ

#

The post body now has both billing cycle and the proration behaviour

proven dust
#

https://dashboard.stripe.com/test/logs/req_yGPgxJUQliSfhZ showed the billing_cycle_anchor to be 1715564032 (2024-05-13 01:33:52) which was ~30 seconds seconds after the creation request at 1715564003 (2024-05-13 01:33:23)

https://dashboard.stripe.com/test/subscriptions/sub_1PFnluGei7MrDZax1ZdsssLM looks expected to me.

The billing cycle is set to a few seconds later, i.e. the next invoice will be billed only the specified timestamp with reference to billing_cycle_anchor. The initial checkout session will show the amount at the time of creation, i.e. $0 at that point

crystal osprey
#

If I want it to be charged immediately as the customer enters their card on the screen and charge monthly thereafter. How do I configure my payload ?

#

If I send an empty subscription_data object it will add today's invoice and the next month's invoice and bill it to the customer.

Whereas, I want the customer to pay $0.10 today and then get charged in a recurring manner

#

This is what I see when I send an empty subscription object:

For your reference : req_WtH7Et4gYHvOr9

#

I want to charge the customer's card then and there?

proven dust
#

If you want to charge the customer today and charge month afterwards, there is no need to set subscription_data.billing_cycle_anchor and subscription_data.proration_behavior

#

Customer will be billed $0.10 every month afterwards

crystal osprey
#

The customer should be billed 0.10 today as well

proven dust
crystal osprey
#

That is what I am not being able to configure

#

It shows me 0.00 was paid today when I navigate to the customer

proven dust
crystal osprey
#

This was it

#

Is this mentioned anywhere in the checkout session page and I missed ?

proven dust
#

This isn't explicit mentioned for Checkout Session specifically. The minimum amount is applied to all payment integrations by Stripe

crystal osprey
#

Thank you very much. Solves this issue.