#william-issuing-transaction-refund
1 messages · Page 1 of 1 (latest)
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.
- william-microdeposit-fail, 1 day ago, 7 messages
- _durrell, 1 day ago, 6 messages
@sterile sorrel let's chat here!
Stripe::Issuing::Transaction::TestHelpers.refund(
'ipi_1OPAspQs45zu1z8TKRSeEI9p',
{ refund_amount: 1000 },
{ stripe_account: 'acct_1OKQGbQs45zu1z8T' }
)
What error do you get?
That Issuing transaction id is on that account, so I don't know why it's erroring out.
Stripe::APIError: An unknown error occurred
from /Users/.../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/stripe-10.3.0/lib/stripe/stripe_client.rb:715:in `handle_error_response'
Taking a look at the error on my end
The event that created that Issuing Transaction is here: https://dashboard.stripe.com/acct_1OKQGbQs45zu1z8T/test/events/evt_1OPAspQs45zu1z8TsMXEpoLa
If you omit refund_amount when creating the refund, do you receive the same error?
william-issuing-transaction-refund
If I do that, then I get this error:
WARNING: 'stripe_account' should be in opts instead of params.
Stripe::InvalidRequestError: Received unknown parameter: stripe_account
Ah, i think that's because you need to keep an empty opts
So your code would look something like this:
Stripe::Issuing::Transaction::TestHelpers.refund( 'ipi_1OPAspQs45zu1z8TKRSeEI9p', { }, { stripe_account: 'acct_1OKQGbQs45zu1z8T' } )
If I try what you have above I'm back to:
Stripe::APIError: An unknown error occurred
Okay, so I see the transaction was created due to a test-mode force capture (vs. approving an authorization, which would create a transaction automatically)
Because of this, there's no authorization , which is what's likely causing the error. Are you able to create an unlinked refund instead? https://stripe.com/docs/issuing/purchases/transactions?issuing-capture-type=refunds
You can see a sample at the bottom of this section; you'll want to pass along the card ID you initially used when creating the force capture and an amount.