#tibbian-ACH

1 messages ยท Page 1 of 1 (latest)

lavish briar
#

Hi there, give me a moment to take a look.

acoustic owl
#

of course, I hope this is a fun one to crack, if the dashboard can do it then surely the API can too!

lavish briar
#

Huh yeah I actually don't think we return this via the API, which I admit I'm a bit surprised by.

#

It may be one of the gaps in our legacy ACH flow

acoustic owl
#

where is the dashboard looking? I'm willing to hit up another endpoint, it doesn't have to be available through the charges API or anything like that

lavish briar
#

The Dashboard doesn't use the same codebase as the API

#

So it isn't necessarily compatible

#

There are certain Dashboard-only features

#

Like I said, I wouldn't expect this to be one. I would think we would update the balance transaction

#

To reflect the proper fee amount

#

I'll file feedback internally about this

#

But I don't see a way to surface it currently. The fee will always be associated with the balance transaction.

acoustic owl
lavish briar
#

@acoustic owl can you do me a favor and retrieve txn_1KshnpA74xMpD4hDsNP4h9Ui

#

I think that is the balance transaction of the failure

#

And I am curious what the fees show in that

acoustic owl
#

๐Ÿ‘€

#

how'd you find it? This indeed looks like what I was after

{
    "id": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
    "object": "balance_transaction",
    "amount": -1450,
    "available_on": 1651536000,
    "created": 1650954193,
    "currency": "usd",
    "description": "REFUND FOR FAILED PAYMENT (Account Funding)",
    "exchange_rate": null,
    "fee": 388,
    "fee_details": [
        {
            "amount": 388,
            "application": null,
            "currency": "usd",
            "description": "Stripe processing fees",
            "type": "stripe_fee"
        }
    ],
    "net": -1838,
    "reporting_category": "charge_failure",
    "source": "pyr_1KshnpA74xMpD4hD2GZViqwP",
    "status": "pending",
    "type": "payment_failure_refund"
}
lavish briar
#

So you can grab every balance transaction ID if you export the "All transactions" tab of your Dashboard

#

So it looks like on the payment failure we actually pull the fee out of the payment refund when we reverse the transfer

#

Didn't realize that

#

This still isn't easy to grab via the API

#

But I think it is a weird edge case of fees with ACH + Destination charges

acoustic owl
#

Interesting, is there a way to get pyr_1KshnpA74xMpD4hD2GZViqwP from py_1Krd7sA74xMpD4hDpZdjYPrf?

lavish briar
#

Err sorry you already have the payment

#

So you just want the refund

#

But basically you would go OG charge --> transfer --> destination_payment --> refund

acoustic owl
#

๐Ÿ‘€

#

Wait the balance_transaction you found is on the refund and there's the OG charge, right? But OG charge --> refunds is blank...
OG charge: py_1Krd7sA74xMpD4hDpZdjYPrf
refund: pyr_1KshnpA74xMpD4hD2GZViqwP
balance transaction with fee: txn_1KshnpA74xMpD4hDsNP4h9Ui
https://api.stripe.com/v1/refunds/pyr_1KshnpA74xMpD4hD2GZViqwP

{
    "id": "pyr_1KshnpA74xMpD4hD2GZViqwP",
    "object": "refund",
    "amount": 1450,
    "balance_transaction": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
    "charge": "py_1Krd7sA74xMpD4hDpZdjYPrf",
    "created": 1650954193,
    "currency": "usd",
    "description": "Payment failure refund",
    "metadata": {},
    "payment_intent": null,
    "reason": null,
    "receipt_number": null,
    "source_transfer_reversal": null,
    "status": "pending",
    "transfer_reversal": null
}
brave gate
#

Hi ๐Ÿ‘‹ I'm stepping in and it's really busy. Give me a minute to catch up

acoustic owl
#

you guys should have stayed on IRC, much quieter there lol

brave gate
#

Yeah but no threading, really hard to keep up

lavish briar
#

Oh wait

#

I misunderstood

#

I thought it was on the refund for the transfer

#

But that is actually just the refund on the platform

acoustic owl
#

At this point we've boiled down the question to
"Interesting, is there a way to get pyr_1KshnpA74xMpD4hD2GZViqwP from py_1Krd7sA74xMpD4hDpZdjYPrf"

and that should be possible because I can see py_1Krd7sA74xMpD4hDpZdjYPrf as the charge on the pyr_1KshnpA74xMpD4hD2GZViqwP refund

#

yet the OG charge has no refunds in the response, what gives?

#

I think I found it!

lavish briar
#

What outputs when you retrieve py_1Krd7sA74xMpD4hDpZdjYPrf?

acoustic owl
#

but check this out!
https://api.stripe.com/v1/refunds?charge=py_1Krd7sA74xMpD4hDpZdjYPrf

{
    "object": "list",
    "count": 1,
    "data": [
        {
            "id": "pyr_1KshnpA74xMpD4hD2GZViqwP",
            "object": "refund",
            "amount": 1450,
            "balance_transaction": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
            "charge": "py_1Krd7sA74xMpD4hDpZdjYPrf",
            "created": 1650954193,
            "currency": "usd",
            "description": "Payment failure refund",
            "metadata": {},
            "payment_intent": null,
            "reason": null,
            "receipt_number": null,
            "source_transfer_reversal": null,
            "status": "pending",
            "transfer_reversal": null
        }
    ],
    "has_more": false,
    "url": "/v1/refunds"
}
lavish briar
#

Ohh you listed refunds for the charge

#

Smart!

#

Weird it doesn't just show up when retrieving the charge

#

...

#

I think that is likely the best workaround for now

#

I'll still file feedback

#

But that should get you there

acoustic owl
#

thank you, yep all I have to do to see my fee is expand the balance transaction
https://api.stripe.com/v1/refunds?charge=py_1Krd7sA74xMpD4hDpZdjYPrf&expand[0]=data.balance_transaction

{
    "object": "list",
    "count": 1,
    "data": [
        {
            "id": "pyr_1KshnpA74xMpD4hD2GZViqwP",
            "object": "refund",
            "amount": 1450,
            "balance_transaction": {
                "id": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
                "object": "balance_transaction",
                "amount": -1450,
                "available_on": 1651536000,
                "created": 1650954193,
                "currency": "usd",
                "description": "REFUND FOR FAILED PAYMENT (Account Funding)",
                "exchange_rate": null,
                "fee": 388,
                "fee_details": [
                    {
                        "amount": 388,
                        "application": null,
                        "currency": "usd",
                        "description": "Stripe processing fees",
                        "type": "stripe_fee"
                    }
                ],
                "net": -1838,
                "reporting_category": "charge_failure",
                "source": "pyr_1KshnpA74xMpD4hD2GZViqwP",
                "status": "pending",
                "type": "payment_failure_refund"
            },
            "charge": "py_1Krd7sA74xMpD4hDpZdjYPrf",
            "created": 1650954193,
            "currency": "usd",
            "description": "Payment failure refund",
            "metadata": {},
            "payment_intent": null,
            "reason": null,
            "receipt_number": null,
            "source_transfer_reversal": null,
            "status": "pending",
            "transfer_reversal": null
        }
    ],
    "has_more": false,
    "url": "/v1/refunds"
}
lavish briar
#

๐ŸŽ‰

acoustic owl
#

thanks for your help! I really like it when computers make sense

lavish briar
#

Me too ๐Ÿ™‚

#

Glad we figured it out

acoustic owl
#

๐Ÿ™