#yogeshp-refund

1 messages · Page 1 of 1 (latest)

sacred wave
versed pike
#

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

sacred wave
versed pike
#

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?

sacred wave
versed pike
#

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

sacred wave
#

the Connect Account ID wasn't passed correctly

#

in your request

versed pike
#

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?

fleet magnet
#

Hey there! Just stepping in since @sacred wave had to leave - Can you show me the full code snippet for your retrieve request?

versed pike
#

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

fleet magnet
#

and what is the code you used to create the payment intent?

versed pike
#

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

fleet magnet
#

It'd be helpful to see that code snippet as well - I want to see if you're also passing in any options there

versed pike
#

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) {

fleet magnet
#

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

versed pike
#

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"}}

fleet magnet
#

Can you tell me the actual payment intent ID?

versed pike
#

ok

#

pi_3JgtTlRYQMCSYt8r0omIsT6z

fleet magnet
#

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);

versed pike
#

ok I need to pass the requestOptions there

#

let me check this

versed pike
#

Thank you very much Karbi for your help

#

I am successfully able to refund the payment