#clutch-guy_ach-failures
1 messages ยท Page 1 of 1 (latest)
๐ 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.
Hi ๐ can you share the ID of the request that returned that error?
It should have an req_ prefix.
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.
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
Logs
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.
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?
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?
Yes, that's the one
I am sorry, but where would I find that?
The AccountId that is?
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?
Gotcha. Where would I find the account id? The Developers tab opens this
Switch to the Shell tab, and try to run stripe accounts retrieve
Thank you
acct_18ypkbDOwYADn7R8
๐ hopping in here since toby has to head out soon
Hello Karbi
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)
To put it another way, that would help me retrieve failed ACH transactions as they would be listed when I retrieve all refunds?
Ah, so you're actually just trying to find all failed ACH payments?
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
For ACH I don't believe we reflect failures as refunds anymore and that's why your code it not working. The negative balance transaction is reflected as a failure_balance_transaction on the original charge/payment object (see https://docs.stripe.com/api/charges/object#charge_object-failure_balance_transaction)
๐
Will let you know if anything comes up. Thanks!