0

I have completed the payment through stripe successfully in my java code. But the refund throwing error as "No such charge: ch_1G....."

Map<String, Object> params = new HashMap<>();
params.put("charge",chargeID);
Refund refund = Refund.create(params);
Zoe
  • 27,060
  • 21
  • 118
  • 148
  • I’m not using Stripe with Java, but to issue refunds I had to also pass in an amount to refund, and it had to be less than or equal to the original transaction amount. – Alan P. Apr 22 '20 at 21:20

1 Answers1

0

Usually this error is encountered when you've mixed up multiple API keys (for example if you have a separate dev or test account), or if you're making charges for connected accounts and you haven't provided the same account authentication on a subsequent request.

If you're trying to refund a Charge for a connected account, make sure you supply the RequestOptions in your call. Otherwise, double check your API keys match what was used to create the Charge.

Nolan H
  • 6,205
  • 1
  • 5
  • 19