#haluk1195_api

1 messages ¡ Page 1 of 1 (latest)

prime stormBOT
#

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

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

lost gyro
quaint fableBOT
shut pilot
#

Hello! To clarify, are you trying to do this via the API or the Dashboard? Are you a developer?

lost gyro
#

this was the email i had received

#

I am a developer, but i want to be able to do this in the UI as well

shut pilot
lost gyro
#

ok can you help with the developer story then?

shut pilot
#

We're focused on building integrations, the API, webhooks, things like that here.

#

Yeah, what's your question?

lost gyro
#

How do i generate a refund that will create that email for a customer via API

shut pilot
#

Note that a lot of emails aren't sent in test mode.

lost gyro
#

so that 750 was sent in test mode

#

and that refund api only allows refunds on charges, not on payouts

shut pilot
#

Not sure what you mean by refunding a payout. What's the ID of the payout you're trying to refund?

lost gyro
#

i meant refunding a user's "Invoice credit balance"

#

the customer id for which i was able to create the Refund for credit balance was:
cus_PaWOFqov8LuOdR

#

(in test mode)

shut pilot
#

Do you have the ID of the Refund you created?

lost gyro
#

i think it was more of a fund_cash_balance + balance_transactions flow

#

(Even though in the email it does say "Complete refund")

shut pilot
#

Although I'm not sure if the refund functionality is available in the API...

lost gyro
shut pilot
#

I'm still not seeing the refund you're talking about. How much did you refund?

lost gyro
#

its in the event data

#

but why TestHelpers...? how would i make this request out in prod

shut pilot
#

That's a test helper because that's something the Customer/bank would initiate on their end. The test helper allows you to test that happening in test mode. In live mode you would need to go through the bank to make that happen.

lost gyro
#

wait why

shut pilot
#

Why what?

lost gyro
#

why would the Customer or bank transfer my money to a customer's account to then send them an email for a "Payout (Refund as stripe likes to call it)"

shut pilot
#

Let's back up. What are you doing in the Dashboard to make this happen exactly?

lost gyro
#

i can't remember :/

#

was a month ago

#

but basically what i'm trying to do is payout user's for their service (something like uber)

shut pilot
lost gyro
#

ugh thats not what i did last time and it was simpler than that

shut pilot
#

The APIs/features you're using aren't appropriate to pay out money to service providers. You need to use Connect for a use case like that.

lost gyro
#

so anything wrong with just doing:
stripe.Refund.create(
amount=250099,
currency="usd",
customer='cus_NPX8jZD9Rhzhoj',
instructions_email="foo@gmail.com",
origin="customer_balance",
)

shut pilot
#

To clarify, this "refund" is actually a payout for services rendered?

lost gyro
#

correct

#

ok now i think i got it

shut pilot
#

You need to use Connect.

lost gyro
shut pilot
#

While this will probably technically work, it's likely against our terms of service and may even be illegal. I strongly recommend you don't do this.

lost gyro
#

heheheheh

#

ok one thing i'd like to understand is what does "Fund cash balance" do

shut pilot
#

Not sure I understand your question... it funds the cash balance. Can you ask a more specific question?

lost gyro
#

ok why is it only available in testmode and not in production?

shut pilot
#

Because funding the cash balance in live mode like this would involve an incoming bank transfer.

lost gyro
#

yes but if i already have money on my stripe account can't the account get funded through my stripe account

shut pilot
#

No, not to their cash balance.

lost gyro
#

ok then, when would it be appropriate to use "Fund cash balance" in prod?

#

ah okay first paragraph

#

ty

shut pilot
#

Again, you need to use Connect, not this.