#clutch-guy_ach-failures

1 messages ยท Page 1 of 1 (latest)

warm swiftBOT
#

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

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

wraith tartanBOT
restive pendant
#

Hi ๐Ÿ‘‹ can you share the ID of the request that returned that error?

#

It should have an req_ prefix.

pine frigate
#

Checking

#

Hmm I don't see a request. I shared the Payout id of the failed ACH

restive pendant
#

Sorry, I'm very confused by that statement. The object ID that was shared is a Payment(Charge) object, not a Payout object.

#

If you're looking in your dashboard for the request logs, you'll need to adjust the default filters to show GET reqeusts instead of (or in addition to) POST requests.

pine frigate
#

Okay, yes. That would be a payment object.

#

I am trying out the workbench, where would I see the Request Id? Sharing a screenshot of what I am seeing for this payment

restive pendant
#

Logs

pine frigate
#

Here's the Payment Intent request id: req_khomGitkIYlFCU

#

From what I'm seeing

restive pendant
#

That's not what I'm looking for. But maybe I'm not understanding what you're trying to do.

Your initial message included an error that would have been returned when you made a request to retrieve a Payment(Charge) object, that's the request log I'd be interested in seeing.

#

Oh I see, you can't filter by resource ID like that. GET requests don't get those details indexed.

pine frigate
#

Yes, I would like the Payment object to get the payout transaction. Here's some more code illustrating how we use it

                            // Look up the ID for the original charge - that's what is stored in the transaction table, not the refund ID.
                            var refund = new Api.RefundService().Get( payoutTransaction.SourceId, null, new Api.RequestOptions() { } );
                            string originalChargeId = refund.ChargeId;

                            var trans = GetInvoiceTransaction( query, refund.ChargeId, refund.Amount, PayoutTransactionTypes.FailedCharge );
                            if( string.IsNullOrWhiteSpace( trans.Error ) == false )
                                errors.Add( trans.Error );
                            else {
                                // Get the reversed pending balance transaction so the Stripe fee for the failed ACH can be calculated.
                                var charge = new Api.ChargeService().Get( trans.InvoiceTransaction.BillingProviderReferenceCode );
                                var balanceTransaction = new Api.BalanceTransactionService().Get( charge.BalanceTransactionId );

                                var toStripe = ( decimal )( ( payoutTransaction.Fee + balanceTransaction.Fee ) / 100.0 );

                                payoutTransactionsGeneric.Add( new PayoutTransaction(
                                    PayoutTransactionTypes.FailedACH,
                                    originalChargeId,
                                    originalChargeId,
                                    payoutTransaction.Created,
                                    ( decimal )( payoutTransaction.Amount / 100.0 ),
                                    -toStripe,
                                    payoutTransaction.Description
                                ) );
                            }
#

Does that help or am I still unclear?

wraith tartanBOT
restive pendant
#

Let me try asking a different way.

var refund = new Api.RefundService().Get( payoutTransaction.SourceId, null, new Api.RequestOptions() { } );
This is the line that throws an error, right?

#

Can you share your Account ID?

pine frigate
#

Yes, that's the one

#

I am sorry, but where would I find that?

#

The AccountId that is?

restive pendant
#

The ID of your Stripe Account, it should have an acct_ prefix.

#

I'm trying to see the failed request so I can see what account it was made from. The most common cause I see for the error you mentioned is that you're trying to retrieve an object that doesn't existing in your account.

#

You mentioned you hardcoded an example ID, does that match the account and mode that your request is being made in?

pine frigate
#

Gotcha. Where would I find the account id? The Developers tab opens this

restive pendant
#

Switch to the Shell tab, and try to run stripe accounts retrieve

pine frigate
#

Thank you

acct_18ypkbDOwYADn7R8

bronze path
#

๐Ÿ‘‹ hopping in here since toby has to head out soon

pine frigate
#

Hello Karbi

bronze path
#

You're getting an error because your code is currently attempting to look for a Refund with the ID py_3P7hpkDOwYADn7R80YNuZtKM - but that won't work because that's not a Refund object. Instead you need to be listing all Refunds and pass in py_3P7hpkDOwYADn7R80YNuZtKM as the Charge ID (https://docs.stripe.com/api/refunds/list#list_refunds-charge)

pine frigate
#

To put it another way, that would help me retrieve failed ACH transactions as they would be listed when I retrieve all refunds?

bronze path
#

Ah, so you're actually just trying to find all failed ACH payments?

pine frigate
#

What we are trying to do is reconcile payouts. So we get the payout id, and then intend to retrieve all the associated transactions. In this case, it is a failed ACH payment. The code I shared above, worked with the old bank elements but since we just switched over to Payment Elements, it failed with the exception

#

So yes, we will need to work with all the failed ACH payments 1 at a time

bronze path
pine frigate
#

Aha!

#

That's something I can run with. Let me try

bronze path
#

๐Ÿ‘

pine frigate
#

Will let you know if anything comes up. Thanks!