Stripe - Monthly notification for six month or annual subscriptions - stripe-payments

According to the Stripe docs if I have a monthly subscription I'll get an invoice.paid/payment_failed webhook telling me if the payment or successful or not
Then my understanding is that if I were to create an annual subscription, I'd only get one webhook each year notifying me on whether the new payment or successful or not...
My app works in such a way that if you have any sort of active subscription it'll give you access to more data, regardless if your subscription is paid monthly or every six months and so on... so, is there a way for me to get notified monthly about any active subscription regardless if they are every-six-months/annually paid?

Related

Stripe subscription set billing date as first of each month

I'm using Stripe Checkout flow to collect the users' payment details and automatically collect the subscription. I have also implemented webhooks to listen to checkout.session.completed so that I can edit the subscription. What I want is as follows:
Say, the user registers on January 15th. I'm using metered billing, so the user pays $0.00 on the first invoice.
In webhooks, I apply a trial period of 7 days to the subscription like so stripe.subscriptions.update([id], {trial_end: [seven_days_into_future]}). So the billing anchor date on the subscription becomes the 22nd of each month.
However, I would like to set the billing anchor date as the first day of each month. So I would like the user to receive the first invoice for January 22-31 (prorated), and then get invoices for full calendar months onwards.
How do I achieve that?
I cannot set the billing_cycle_anchor to the desired date because it accepts only now and unchanged values...
If you're working with already created subscriptions, then you'll need to add trial periods to shift the billing_cycle_anchor:
https://stripe.com/docs/billing/subscriptions/billing-cycle#using-a-trial-to-change-the-billing-cycle
If you know exactly how you want to structure your trial and billing_cycle_anchor at the time the subscription is being created, then you can future-date the billing_cycle_anchor during creation:
https://stripe.com/docs/billing/subscriptions/billing-cycle#new-subscriptions

Stripe appears to be billing twice for each Subscription

We are using Stripe subscription. In that if a user creates a Product then they can set the price suppose $9.99.
If the other users wants to subscribe the same product they have to pay $9.99. From the paid $9.99, the admin will get 2% and (2.9 + 0.30)% Stripe fee will be deducted and the remaining amount will be sent to the product creator's connect account.
The issue is if the user subscribe a product, a charge is created and the amount deducted from the subscriber. Then the invoice will generate and that time, again the amount will deduct from the subscriber a/c. Double time payment cuts from the subscriber's account.
I'm using destination-charges method to apply the charge and transfer the amount to creator's connect account for any subscription in the invoice.payment_succeeded webhook's method.
How to prevent 2nd time payment deduction?
enter image description here
Creating a subscription will generate an invoice that will charge for the upcoming period(they are charged in advance, so if you had also done a destination charge before creating the subscription, you are charging the customer twice — I assume that's what you mean?
What you probably want to do here is one of :
instead of doing a one-off destination charge or doing a transfer manually from a webhook handler, just set the application fee on the subscription so it's deducted from the invoice instead, by setting the destination of the funds and the application fee you keep :
https://stripe.com/docs/billing/subscriptions/connect#transfer
https://stripe.com/docs/api/subscriptions/create#create_subscription-application_fee_percent
if for some reason that is not an option and you still need to do a separate charge than the first invoice, maybe create the subscription with trial_end set until the next billing date, which will skip the first payment (sine you already processed it)
https://stripe.com/docs/api/subscriptions/create#create_subscription-trial_end

Stripe monthly subscription with annual payment?

What is the best way to subscribe my users to a plan that renews monthly yet bills yearly using stripe subscriptions, as i contacted Stripe's support and they said a plan with an interval of month and interval_count of 12 will not generate any events (ex: customer.subscription.updated event) until the end of the 12 months interval while i need these events to be generated on monthly basis.
The best solution here would be to subscribe the customer to a $0 monthly plan. This ensures that, each month, a new billing cycle starts and a new invoice is created. The invoice will be for $0 but send an invoice.created event to your webhook endpoint.
There, you can decide whether you need to bill the customer anything or not. If you don't, you simply ignore the event and the customer won't be charged anything. If you do, you will simply add an invoice item for the correct amount to this invoice. This is covered in the Invoices section of Stripe's documentation.
For the first invoice, you would add the invoice item first which means three steps:
Create the customer
Create the invoice item for the correct price
Create the subscription to the $0 monthly plan
The last step will automatically pull the invoice item in the invoice and charge them that amount as expected.
If you have follow up questions, I'd recommend talking to Stripe's support here.

Subscription Renewal Related

I was using your stripe payment gateway for a while then one day one thing came to my mind. I would like to explain it with an example.
Suppose I am a customer and subscribed to some app. So you will deduct that monthly charges every month. Now what happens is my card got empty and the subscription renewal date is near. As I was not having enough money in my card I got logged out from the app and stripe kept trying my card. Then to re-login to app I was asked to enter the card details again. Now this time I used another card and got logged in successfully as a new user on the app (as my status was marked as 'not renewed' in the database).
So now my questions are:
What will happen if I put some money in my previous card?
Will I get charged twice every month?
How can handle this equation?
Have you understood my point of view?
With Stripe, users (merchants) can set a retry schedule for recurring payments in their account settings: https://dashboard.stripe.com/account/recurring. There can be up to 3 retries after the initial attempt, each retry separated by 1 to 7 days from the previous one.
If all payment attempts fail, users can choose the final fate of the subscription:
cancel it automatically
mark it as unpaid
leave it as-is
If you update a customer with a new payment source, for each of the customer's current subscriptions, if the subscription is in the past_due state, then the latest unpaid, unclosed invoice for the subscription will be retried.

Stripe Implementation for subscriptions

Trying to engineer a payment system with stripe that will bill the customer on a weekly basis. The customer can have as many documents but each one is charged weekly. So if the customer has 2 documents he would have 2 charges every week until he canceled both or one of them. I would like to be able to have a detailed email invoice too.
Would the best way to do this would just keep updating the subscription quantity every time one is added or deleted. Or is there a better way to do this.
AKA: I am new to online payments
You can create the plan on Stripe with a validity of 7 days and subscribed the customer to that plan on the recurring basis. So the customer will be charged automatically every week.
For the quantity, you can change the quantity of subscription on stripe or you can subscribe a customer to different weekly plans(If you have different documents rate)
For sending an email just enable invoice email from admin setting and each time customer will pay an email will be sent.

Resources