How to automatically bill Customer B depending on Customer A's subscription charge on Stripe? - stripe-payments

We are looking for a way to bill one customer depending on how much another customer is charged weekly using Stripe Subscriptions. So the idea is to offer a weekly gym membership to full-time employees at city offices. The weekly fee will be $20 and we want the employees' company to contribute a certain amount to the weekly fee. For example, Customer A (employee) will pay $16 and Customer B (employee's Company) will pay the remaining $6. Is there a way to take Customer A's charge successful receipt and trigger Customer B's card to be charged automatically? The $20 subscription fee is not fixed as it will change depending on their usage ($20 is for 5 working days. If they use it for 3 days the total charge will be $12).

Since you are controlling Customer A's subscription and charge you can automate all of this. You indicated that you will change how much you charge Customer A each month. This is something that your code will handle and at that point it can automatically charge Customer B's card for the remainder of the fee.
Otherwise, you can use webhooks and listen for charge.succeeded events. Whenever Customer A has a successful charge, your webhook handler will find the corresponding Customer B in your database and create a Charge for the correct amount.

Related

Stripe Refund Monthly and Yearly

I have a question about refunding in this flow:
2 Subscriptions -> Monthly 5$, Yearly 45$
My refunding period is one hour. After one hour the button dissapears and you cannot refund anymore.
My problem is if the user buys monthly for 5$, and then imediately upgrades to Yearly it takes 40$ because of proliferations.
Then i have 2 payment intents that can be refunded in one hour(one for monthly and one for yearly).
And i need to keep them both in my DB and create logic to refund both 5$ monthly an 40$ yearly if the user wants the refund in that hour. Because if not, i will refund 40$ and the user looses 5$ if he executes this flow and i don't want him to loose money if he can refund in 1 hour range.
Is it okay to store both payment intents in DB and refund him like this?
Do you guys see something wrong about this flow or is it a better one?

Stripe Invoice Partial Payments

I'm trying to model a Stripe subscription where the collection method is send_invoice. However, I want to allow the customer to choose the amount they pay (ad-hoc, I believe its called), and then mark the invoice as paid when the total balance is received.
I can see that this is an option for ACH credit payments but only to handle mistakes from the customer. Is there any way to enable this for card payments on invoices too?
This isn't possible using Stripe out of the box. The Stripe hosted form for an Invoice does not allow the customer to input an amount of their choice. The amount listed on the Invoice is based on the parameters provided when creating the Invoice via the API.
You would need to create your own recurring logic to do the following as long as the full amount is not yet paid :
Get the ad-hoc amount your customer would like to pay. This would have to be via your own custom created form
Then create an Invoice for that ad-hoc amount
You would use webhooks to listen for the invoice.paid event to verify that the invoice is paid successfully. From the event details, you can retrieve the Invoice details and “link” it to the amount owed in the database for that customer.
Calculate the amount left unpaid
Example - I have a customer that owes me $100
Ask the customer how much they would like to pay. Customer decides that they want to pay $10.
Create an Invoice for $10.
After the invoice is successfully paid. Tie the Invoice details to the amount owed in the database.
Calculate the amount left.
Since there is still $90 left,
Ask the customer how much they would like to pay. Customer decides that they want to pay $90.
Create an Invoice for $90.
After the invoice is successfully paid. Tie the Invoice details to the amount owed in the database.
Calculate the amount left.
Mark the amount as fully paid in your database.

Stripe customer A pays customer B, we take a fee

I have an application, where customer A offers rooms and customer B can book a room.
In this case customer B books a room and pays customer A, so I dont hold the money on stripe. I take a cut and charge customer A once a month for all his successfull bookings.
I am not able to find information on this topic, is this even possible?
To sum it up once again:
As it is now -> Customer B books a room and the money goes to my stripe account, where I need to pay customer A myself. Also in this case I need to pay 2 x transaction fees: Customer B -> My Stripe -> Customer A.
If I hold the money myself on stripe, do I need to have PCI DSS? According to https://stripe.com/docs/security Stripe has it.
EDIT
I need a BaFin licence here in germany (even If I hold the money for 1 second). That is why I want to make it possible that customer B can pay customer A directly.
Did you take a look at Destination Charges? It may be what you are looking for.
In your case:
Your application would be the platform account
A would have a Custom Stripe account
B would be a Customer object
Each time B books a room, you create a Charge by specifying the parameter destination[account] which will be the Custom Stripe account identifier of A. At the same time you can specify the parameter destination[amount] that will be less than the Charge amount, and the difference will be your cut. the value that you will set for destination[amount] will be transfered to the Custom Stripe account of A.
I think that you can easily set the recurrence of the payout (i.e. Custom Stripe Account to actual bank account) from the dashboard.
What I wrote above is really just a rephrasing of Creating Destination Charges on Your Platform - Collecting platform fees applied to your case.
Zusatz
I don't think you need an authorization from the BaFin. This what Stripe is for (among other things). At least in France, one does not need an authorization from the equivalent authority, ACPR - Banque de France.

Recurring billing with Stripe - will Subscriptions suffice?

My application allows a customer to purchase credits for later in-app use.
I want to enable customers to buy credits throughout the month, and only get billed at the end of the month.
Should I be using a Stripe Subscription at an amount that equals the price of one credit, and change the quantity according to the number of credits the customer purchased?
(After a successful invoice - I'll reset the subscription quantity to 0)
Is there a better solution? Perhaps some clever method of using Stripe Checkout?
Your proposed approach sounds reasonable.
I've not tried it but an alternative I can think of would use a free plan and the Invoice Items part of the API.
Create a free plan with amount with amount field set to 0. As far as I can see from the docs, all the subscription lifecycle webhooks should be triggered for Customers who're subscribed to the plan.
Through the month, create InvoiceItems for the Customer. According to the docs, at the end of the billing cycle, those InvoiceItems are added to the customer's invoice.
Sometimes you want to add a charge or credit to a customer but only actually charge the customer's card at the end of a regular billing cycle. This is useful for combining several charges to minimize per-transaction fees or having Stripe tabulate your usage-based billing totals.
Beyond that, you'll want to consider if you should have Stripe generate/email your invoices.
I don't think this is the way to go, because subscriptions are billed the first time among other things.
The recommanded way is: stripe doc: Place a hold on a card
summary
You first ask authorization for a certain amount (the max amount). Eg: 1000$
Your custommer buy 50 credits in the month
At the end of the month you charge the customer for 50$ (it can not be greater that the maximum you authorized in the first step)
That's all :)

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