#bloemy_best-practices

1 messages ยท Page 1 of 1 (latest)

weak topazBOT
#

๐Ÿ‘‹ 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/1278921986281705495

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

amber hedge
#

Hi there, so you want to keep the most of the funds and only transfer a fraction to the seller?

neat locust
#

hey Jack - I have a second question I'll post in the thread already but we can answer it after - appreciate your help here!
Yes that is exactly it, I only want to transfer a fraction, say 10, 15%

#

(Second question - can answer after)
Got a second question. I initially built my Stripe webhook to listen to invoice.paid, invoice.payment_failed, customer.subscription.updated and customer.subscription.deleted

Initially everything was paid by credit card only, and so my main logic is based on invoice.paid - i.e whne someone pays, I move their subscription expiration date forward.

The problem is I have now started accepting more and more manual invoices for larger payments, and this has created an issue: when I issue a manual invoice for a subscription, that account's subscription doesn't get moved forward since the invoice did not get paid yet.

WHat is the best practice around this? What event should I actually be using?

amber hedge
neat locust
#

So does transfer_data[amount] work on subscriptions? Because these are not one time payments, these are all subscriptions I use

#

as for the invoice API, yes, I am already marking them as paid, but here is the thing: when I issue an invoice it might only get paid 20 days from now. In the meantime they should already have access to my platform though, and I don't want to have to manually mark it as padi before they paid, because then I lose all track of the payments

amber hedge
#

So you don't want your user to use your service until the invoice is paid?

weak topazBOT
neat locust
#

yes I do want them to be able to use it, that's the point - I basically need to already automatically move them forward even before they paid, but I ened to find the right webhook event for this

#

and thanks for amount_precent!!

#

and with a subscription, is there a way to do a one-time payment only? i.e at first payment only?

#

Third question (last one I promise :D), we are starting to support multiple countries now, but we want pricing to be in local currency. What we saw is that you then get charged an extra fee for conversion back to USD. For instance if we will get Australian customers, is there a way to avoid that fee if we are happy to keep AUD in a bank account, or do we need to simply create a new Australian based Stripe account?

#

thanks a lot !

topaz wyvern
neat locust
#

when I meant one time payment I meant a percentage of the first payment of the subscription to go to a reseller. E.g my sub is 1000$ a year, and I want 100$ to go to my reseller, but only the first year

#

Could I set amount_percent to 10% and then move it to 0% after the first payment? would that do the job?

topaz wyvern
#

as for the invoice API, yes, I am already marking them as paid, but here is the thing: when I issue an invoice it might only get paid 20 days from now. In the meantime they should already have access to my platform though, and I don't want to have to manually mark it as padi before they paid, because then I lose all track of the payments

Earlier you mentioned that you issue a manual invoice for a subscription - can you share an example to illustrate what you're doing specifically?

neat locust
#

Sorry, I just mean that I basically create a subscription, but instead of charging a card, I choose to generate an invoice for them to pay
The invoice gets sent to their email and they pay by bank transfer - sometimes through Stripe, sometiems out of band
But it is net 30 so they have 30 days to pay

topaz wyvern
#

ah, so you mean you use collection_method="send_invoice"?

neat locust
#

yes !

topaz wyvern
#

gimme a while to test it out

neat locust
#

thanks!

topaz wyvern
#

if you're using collection_method=send_invoice, i think the way to go about it is to listen for the subscription status changes instead. If the subscription status is active, you would provision services, if the subscription status moves to unpaid then you shouldl stop provisioning services. There are settings in the Dashboard that allow you to configure what the Subscription status should move into after it is past due.

I think this page gives a good sense for what to use each Subscription status for : https://docs.stripe.com/billing/subscriptions/webhook

neat locust
#

hey, thanks. The link does not work, but that does make sense overall, if I can rely on that

topaz wyvern
#

oh bah, sorry it was missing an s

neat locust
topaz wyvern
#

when I meant one time payment I meant a percentage of the first payment of the subscription to go to a reseller. E.g my sub is 1000$ a year, and I want 100$ to go to my reseller, but only the first year
Could I set amount_percent to 10% and then move it to 0% after the first payment? would that do the job?

My recommendation here is to listen for the invoice.paid event : https://stripe.com/docs/billing/subscriptions/webhooks#events and check. the billing_reason : https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason. The first payment for a subscription is subscription_create - you would then create a Transfer : https://docs.stripe.com/api/transfers/create (remember to include source_transaction) for the amount you want to transfer to the connected account

Learn to use webhooks to receive notifications of subscription activity.

neat locust
#

that makes sense - much easier. Thanks.

topaz wyvern
#

we are starting to support multiple countries now, but we want pricing to be in local currency. What we saw is that you then get charged an extra fee for conversion back to USD. For instance if we will get Australian customers, is there a way to avoid that fee if we are happy to keep AUD in a bank account, or do we need to simply create a new Australian based Stripe account?

going through this question now ๐Ÿ‘€

#

you're a US platform?

neat locust
#

yes US

#

for Canada we ended up creating a separate Canadian account because we were accepting CAD payments on US but we were being charged so much. It seems like for a US account you can't have secondary bank accounts...

topaz wyvern
#

assuming that you are a US platform - yes, the only option is to create a new Autralian based Stripe account.

AU (and a few other countries) Stripe accounts have the option to accept alternative currency payouts (some other currencies). US Stripe accounts unfortunately can't do so at the moment.

See https://docs.stripe.com/payouts/alternative-currencies and select the country

Learn how to pay out in currencies other than your primary currency.

neat locust
#

Ok, thanks for clariyfing. Much appreciated. And is there a good way to manage if I just want to use one webhook for all of my multiple Stripe accounts, if we're going to have one per country? Currently for Canada nad US the way I do it is I try to do constructEvent on the signature with both my US and Canadian key, but that doesn't seem like a scalable solution

topaz wyvern
#

add a query parameter to your webhook URL and then use the appropriate key to check the signature?

#

e.g. ?country=US

neat locust
#

ohhh you're able to do that?! jeeeez that's nice. Thanks !

#

I mean yeah, makes total sense lol

topaz wyvern
#

your server should be able to handle this