#yogeshp-refund
1 messages · Page 1 of 1 (latest)
hello, I assume you're using Stripe Connect, right?
1/ for refunding, you pass the Charge ID in the params, the API ref shows you that: https://stripe.com/docs/api/refunds/create#create_refund-charge
2/ can you share that request ID (req_123) you got in that error?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes I am using stripe connect
req_2A3KCKavAzxLpd
where can I get the Charge Id?
We can get it from paymentIntent retrieve but it gives me exception
you're making the request incorrectly, you created the PaymentIntent on the Connect account: https://dashboard.stripe.com/test/logs/req_QilLTYnc03ZaNW
Your GET request to retrieve it is not a Connect request, you're making it on the Platform account without the stripe_account paramter
whether we want request on connect account or platform account?
how to create the retrive request for connect account and what parameter we need to pass?
like I said earlier, you need the STRIPE-ACCOUNT header, this shows how you do it in your language: https://stripe.com/docs/connect/authentication#stripe-account-header
Yes I did the same In Stripe.apiKey = "{{PLATFORM_SECRET_KEY}}"; I passed the platform apikey and in requestOptions I passed the connected stripe account id
params.put("email", "person@example.edu"); I have not passed anything over here
I am not getting what I passed the wrong
let me send you what i have passed
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("acct_**********t8r").build();
or should I share my whole function?
Hey there! Just stepping in since @sacred wave had to leave - Can you show me the full code snippet for your retrieve request?
Stripe.apiKey = Stripe.apiKey ;
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("acct_***********8r").build();
Map<String, Object> params = new HashMap<>();
// params.put("email", payment.get);
Account account = Account.retrieve(payment.getStripeAccountId());
Customer customer = Customer.create(params, requestOptions);
customer.getLastResponse().requestId();
PaymentIntent paymentIntent1 =PaymentIntent.retrieve("pi_*******************T6z")
In stripe.apiKey has a platform api key
and what is the code you used to create the payment intent?
when I make the payment successfully i got the response in that response we have Payment intent id , I just used that id to get the payment Intent object
It'd be helpful to see that code snippet as well - I want to see if you're also passing in any options there
you want to check the create payment function?
Map<String, Object> params = new HashMap<>();
params.put("source", stripePaymentRequest.getStripeTokenData().getId());
params.put("amount", df.format(totalCost)); //
params.put("currency", "usd");
Charge charge = null;
try {
checkApiKey();
charge = Charge.create(params);
} catch (StripeException e) {
Sorry let me back up for a minute here - the code you sent over is creating a Charge, not a Payment Intent. I want to see what specifically you're passing in when you create the Payment Intent because you need to pass in the same request options when you also retrieve it
should I send you the response I get when the payment is successfull?
{"paymentIntent":{"id":"pi_************************",
"object":"payment_intent",
"allowed_source_types":["card"],
"amount":5000,
"canceled_at":null,"cancellation_reason":null,"capture_method":"automatic",
"client_secret":"pi_*******************T6z_secret_****************Ldc5o",
"confirmation_method":"automatic","created":1633362805,"currency":"usd",
"description":null,"last_payment_error":null,
"livemode":false,"next_action":null,"next_source_action":null,
"payment_method":"pm_*************26",
"payment_method_types":["card"],
"receipt_email":null,"setup_future_usage":null,"shipping":null,"source":null,"status":"succeeded"}}
Can you tell me the actual payment intent ID?
Okay, so that payment intent was created with your platform API keys, and with Request Options that set the Stripe Account to "acctXXXX8r". Therefore, when you retrieve it you need to pass in the same things. So your retrieve call needs to look more like this:
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("acctXXXX8r").build();
PaymentIntent paymentIntent1 =PaymentIntent.retrieve("pi***T6z", requestOptions);