#jan123459371

1 messages ยท Page 1 of 1 (latest)

stray ginkgoBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

rapid sail
#

that is the invoice

#

if I submit 164.20 as refund_amount I get the first error.

If I submit 214.20 as refund_amount I get the second error.

Invoice is in status "paid"

#

first request:
{
"invoice": "in_1OgQOiFbb57yWjuKuSbgXYnR",
"lines": {
"0": {
"type": "invoice_line_item",
"quantity": "2",
"invoice_line_item": "il_1OgQOiFbb57yWjuKurSMt8gG"
}
},
"refund_amount": "16420",
"memo": "USt-IdNr: DEPROVIDER | Leistungszeitraum: Mai 2024"
}

#

second request:

#

{
"lines": {
"0": {
"type": "invoice_line_item",
"quantity": "2",
"invoice_line_item": "il_1OgQOiFbb57yWjuKurSMt8gG"
}
},
"invoice": "in_1OgQOiFbb57yWjuKuSbgXYnR",
"refund_amount": "21420",
"memo": "USt-IdNr: DEPROVIDER | Leistungszeitraum: Mai 2024"
}

stray ginkgoBOT
rapid sail
#

Hi, may I get a reaction? ๐Ÿ™‚

autumn sandal
#

Sure, we're taking a look

clever minnow
#

hi! I'm taking over this thread. give me a few minutes to catchup.

rapid sail
#

yes.

this one also

#

req_4bYqiDQz7yVj8B

clever minnow
#

hum... I agree this is a big strange. looking into this...

rapid sail
#

it has something to do with the used customer balance. But I cannot find the "applied balance" in the invoice object to put it back as credit_amount

clever minnow
#

if you substract the two you get the balance used

rapid sail
#

but balance is negative

#

starting_balance

#

should be positive if it can be used for paying ๐Ÿ˜‰

#

or am I wrong?

clever minnow
rapid sail
#

its not explained ๐Ÿ˜‰

#

starting_balance does not occur in the text ๐Ÿ˜‰

clever minnow
#

the link I shared explains the difference between a positive balance and negative balance

rapid sail
#

doesnt work

#

but let me check

#

man

#

i get nuts

#

I submit this in "create" of creditnotes

#

that is what arrives in the API log

clever minnow
#

can you share the request ID (req_xxx)?

rapid sail
#

req_aq0xKqhkTsiiW0

#

$data = [
'invoice' => $invoice->id,
'lines' => $lineItems,
'memo' => "{$vatKey}: {$vatValue->value} | {$performancePeriodKey}: {$performancePeriodValue->value}",
];

if ($invoice->paid)
{
array_push($data, ['refund_amount' => $invoice->amount_paid]);
array_push($data, ['credit_amount' => $invoice->ending_balance - $invoice->starting_balance]);
var_dump($data);
}

$creditNote = $stripe->creditNotes->create($data);

#

code in PHP

clever minnow
#

yes there are multipls issues here

rapid sail
#

ok. Sorry. Wrong code

#

need to push it by key

#

One more question

#

I use connect accounts and customer

#

the refund I created of an Invoice which was created as issuer (the connect account) is withdrawn from my bank account not from the bank account of the connect account

clever minnow
#

is the invoice created on the platform account or on the connected accoutn directly?

rapid sail
#

on the plattform account

#

but with connected account as issuer

clever minnow
#

then if you refund it, the funds will be taken from the platform account

rapid sail
#

and if I create the invoice on the connected account by invoices->create($data, 'account' => 'acc_afdmksljl') it will be withdrawn from the connect accounts bank account?

autumn sandal
#

Which bank account?

#

Their external bank account for payouts?

rapid sail
#

yes

autumn sandal
#

No, we wouldn't use that to pay invoices

rapid sail
#

wasnt my question

#

my question was, what happens in case of refunds

autumn sandal
#

You're talking about creating a new invoice and withdrawing funds. Why would we withdraw funds from an external account in a refund?

rapid sail
#
  1. invoices->create($data, 'account' => 'acc_afdmksljl') >>> create invoice on connected account
#
  1. refund that invoice.
#

Question from which bank account is the fund withdrawn to pass it to the customer

autumn sandal
#

The payment would be refunded to the method used to pay the invoice

#

We'd either:

  • Charge the cus_xxx default PM
  • You'd bring the customer on-session to collect payment details from them
rapid sail
#

no

#

not my question

#

I asked from which bank account the fund for the refund is taken

#

customer has already paid it ๐Ÿ˜‰

autumn sandal
#

It'd depend on the type of Connect payment. Direct I assume?

rapid sail
#

destination charge

autumn sandal
#

You'd need to reverse the transfer from the conncted account

rapid sail
#

but it only works if the invoice is created on the connected account or can it be done if I create the invoice on plattform account by specifing the connected account as issuer?

#

I dont use the payment intents

autumn sandal
#

What only works? You're describing 2 completely separate payment flows here

rapid sail
#

that is question man

#

I dont get completely for which case the answer

#

is

autumn sandal
rapid sail
#

I know that

autumn sandal
rapid sail
#

thats why I said, I dont use payment intent. But the page you sent outlines the refunds only for payment intents ๐Ÿ˜‰

autumn sandal
#

But you would be refunding a Payment Intent

#

Anyway, I've honestly no idea what you're asking me. Can you share some examples that demonstrate the problem you're trying to solve?

#

Equally, all of this can be simulated in test mode to understand how funds flow through various Connect scenarios

rapid sail
#

i am in test mode

#

I try to explain again

autumn sandal
#

It'd be way easier if you create an example Invoice that mirrors the scenario you describe

rapid sail
#

currently I am creating invoices on the plattform account with the connected account specified as issuer

autumn sandal
#

Then I can see the exact parameters you're pasisng

rapid sail
#

all my invoices on my environment

autumn sandal
#

You can send me a in_xxx ID from your Stripe account

rapid sail
#

sec

#

in_1OgRzOFbb57yWjuKZ0OrPPXW

#

that one must be refunded. But passing the money from connected bank account to customers. NOT from plattforms bank account to customer

autumn sandal
#

Yeah I mean you can't really do that initial refund from the connected account directly. It's a destination charge, so ultimately platform is liable for the refunds and then they 'recoup' fund from the connected account by reversing the associated charge: https://stripe.com/docs/connect/charges#destination:~:text=flow diagrams below).-,Your%20account%20balance%20is%20debited%20for%20the%20cost%20of%20the%20Stripe%20fees%2C%20refunds%2C%20and%20chargebacks.,-Send%20the%20balance

Learn how to create a charge and split payments between your platform and your sellers or service providers when you accept payments.

rapid sail
#

ok

#

and what about stripe fees?

autumn sandal
#

Stripe fees are non-refundable

rapid sail
#

ah yeah

#

that sounds correct for me ๐Ÿ˜„ (application fee refund)

#

because the refunds target is the cutomer... And the application fee is subtracted from the amount the customer paying to the connected account ๐Ÿ˜‰

autumn sandal
#

Yes, ultimately the platform would decide whether the refund the application fee

rapid sail
#

i see

#

but its not logical

#

doc says, if "refund_app_fee" is true it is refunded to the connected account

autumn sandal
#

That is correct, yes

rapid sail
#

but that is not the goal if I try to refund a payment from a customer to a connected account

#

if I refund that

#

lets say the customer pays 100โ‚ฌ. Then I get a cut of 10โ‚ฌ and the connected account gets 90โ‚ฌ

#

if I refund that then 10โ‚ฌ need to be passed to the customer not to the connected account

autumn sandal
#

If you choose to refund the full 100โ‚ฌ payment then then customer will receive the full 100โ‚ฌ payment from the platform balance

#

At that point the connected account still has the 90โ‚ฌ transfer (minus the app fee)

rapid sail
#

90โ‚ฌ is already minus the app fee

autumn sandal
#

You can reverse that back to the platform to cover the (most) refund

rapid sail
#

ok

autumn sandal
#

Optionally you can reverse the application fee back to the connected account

#

Either way, whatever you decide to refund to the customer will come from your platform balance

rapid sail
#

in what scenario is that relevant? With that I am paying the customer 100โ‚ฌ and the connected account 100โ‚ฌ

autumn sandal
#

In some platform scenarios it might be, not all. Perhaps the refund was unrelated to the connected account (an error by the platform), so they want to return the fee to the connected account

#

Do you have a specific question?

rapid sail
#

not for now