#shaharyar-ilyas_api

1 messages ¡ Page 1 of 1 (latest)

swift dragonBOT
#

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

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

celest sableBOT
#

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.

dull crystal
#

Code when i charge fee from connected account for each manul payout:

#
    const application_fee_amount =
      calculatePayoutApplicationFeeAmount(amountInCents);
    const fund_received = amountInCents - application_fee_amount;

    const charge = await stripe.charges.create({
      amount: application_fee_amount,
      currency: CURRENCY,
      source: account_id,
      metadata: {
        payment_source: account_id,
        payment_reason: "instant-payout-fee",
        description: `Collect instant payout fee from - ${account_id}`,
      },
    });

    const payout = await stripe.payouts.create(
      {
        currency: CURRENCY,
        amount: fund_received,
        method: "instant",
        metadata: {
          user_id,
          account_id,
          application_fee_amount,
          instant_payout_fee_charge_id: charge.id,
        },
      },
      {
        stripeAccount: account_id,
      }
    );```
tranquil pier
#

Hi there! Have you considered charging the payout fee only after the payout has succeeded?

dull crystal
#

no

#

could i refund this charge

#

?

#

@tranquil pier

tranquil pier
#

The issue here is that your platform's balance is currently negative

#

So you can only refund this charge when your balance in GBP is positive

dull crystal
#

can i add amount in platform which will available to withraw instantaly

tranquil pier
dull crystal
#

i have instant_available balance is 200 pound but still can't able to refund

tranquil pier
#

instant_available is for instant payouts

#

You'll want to look at available for gbp

dull crystal
#
      {
        "amount": 26701,
        "currency": "usd",
        "source_types": {
          "card": 26701
        }
      },
      {
        "amount": 0,
        "currency": "gbp",
        "source_types": {
          "card": 0
        }
      }
    ],
    "connect_reserved": [
      {
        "amount": 0,
        "currency": "usd"
      },
      {
        "amount": 3774,
        "currency": "gbp"
      }
    ],
    "instant_available": [
      {
        "amount": 20073,
        "currency": "gbp",
        "source_types": {
          "card": 20073
        }
      }
    ],
    "livemode": false,
    "pending": [
      {
        "amount": 0,
        "currency": "usd",
        "source_types": {
          "card": 0
        }
      },
      {
        "amount": 20567,
        "currency": "gbp",
        "source_types": {
          "card": 20567
        }
      }
    ]```
#

i think have enough

tranquil pier
#
        "amount": 0,
        "currency": "gbp",
        "source_types": {
          "card": 0
        }
      }```
dull crystal
#

can i instant amount to be available for testing

tranquil pier
dull crystal
#

Thanks a lot it will helpfull

#

const charge = await stripe.charges.create({
amount: application_fee_amount,
currency: "gbp",
source: accountId,
metadata: {
payment_source: accountId,
payment_reason: "instant-payout-fee",
description: Collect instant payout fee from - ${accountId},
},
});

const refund = await stripe.refunds.create({
  amount: charge.amount,
  charge: charge?.id,
});
#

i'm using this code it work perfectly

#

but when i manually refund charge amount from dashboard it will throw error

celest sableBOT
dull crystal
#

Hi, @left igloo I'm facing issue on refund charge

left igloo
#

what error are you seeing?

dull crystal
#

The recipient of this transfer does not have sufficient funds in their Stripe balance to reverse this amount.

#

this charge is created using below code:

      amount: application_fee_amount,
      currency: "gbp",
      source: accountId,
      metadata: {
        payment_source: accountId,
        payment_reason: "instant-payout-fee",
        description: `Collect instant payout fee from - ${accountId}`,
      },
    }); ```
#

@left igloo

#

are you there?

left igloo
#

so you're trying do refund an account debit?

dull crystal
#

Yes

#

?

left igloo
#

i'm still looking into this

dull crystal
#

Okay

#

How long will it take?

left igloo
#

hrm, pretty certain it's because the connected account doesn't have sufficient funds in it's balance at the moment

dull crystal
#

I need to refund this amount to that connected account

left igloo
#

i understand you need to refund this amount to that connected account, maybe just try adding funds immediately to the connected account using the test card that bypasses the pending balance, then try refunding again to see what happens

dull crystal
#

Okay

#

Can I use the transfer api for payout fee to the platform account and then reverse that transfer if needed

#

Could you please share the doc

#

I saw the transfer api using for payout fee

#

But now I didn't find that doc

left igloo
#

since you're using instant payouts, i suggest you reach out via https://support.stripe.com/contact/email to see if you can use this beta : https://docs.stripe.com/connect/platform-pricing-tools

#

that way you can automatically collect the instant payout fees