#Pravin-Refund
1 messages · Page 1 of 1 (latest)
Hi there, please use the doc to get started https://stripe.com/docs/refunds#api
we have done payment using charge api
its generate payout like py_1KdBUxAlnu7mVSWlel7HGGz3
will it support in above refund api?
yup, refund API accepts charge ID as well, see https://stripe.com/docs/api/refunds/create#create_refund-charge
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok thank you
i am getting below error
com.stripe.exception.InvalidRequestException: No such payment_intent: 'py_1KdBUxAlnu7mVSWlel7HGGz3'; code: resource_missing; request-id: req_WHMFoof3fIvgUJ
i tried like below :
public static void main(String[] args) {
Stripe.apiKey = "sk_test_51G6RI8Alnu7mVSWlQtbEs02GDlE2CXtorWp72BopNuOdlto75OWg4TDP2gCsYCy3E089y1zmYo4m1dloXx85ykGH00kRPpz1YQ";
//py_1KdBUxAlnu7mVSWlel7HGGz3
RefundCreateParams params =
RefundCreateParams.builder().setPaymentIntent("py_1KdBUxAlnu7mVSWlel7HGGz3").build();
Refund refund = null;
try {
refund = Refund.create(params);
} catch (StripeException e) {
e.printStackTrace();
}
System.out.println(refund);
}
@mental rain please help
it should be RefundCreateParams.builder().setCharge because you are passing a charge ID
thank you for suggesting
let me try
it was my big blunder @mental rain
Thank you for your help
it worked for me
cool! happy to help!