#alan-bb-checkout-error

1 messages ยท Page 1 of 1 (latest)

thorn current
#

Copying this here:
(I dont need to retrieve it straight after, there is more logic inbetween, but I've isolated and tried this and it fails):

    Session session = null;
    try {
        Stripe.apiKey = Config.get().get("stripe_sk");
        logger.log(Level.SEVERE, "Connected Account: " + connectedAccountId);
        RequestOptions requestOptions = RequestOptions.builder()
                .setStripeAccount(connectedAccountId)
                .setApiKey(Config.get().get("stripe_sk"))
                .build();
        session = Session.create(params, requestOptions);
        Session retrieveSession= Session.retrieve(session.getId());
    } catch (StripeException se) {
        logger.log(Level.SEVERE, "Error", se);
        throw new Exception400("errorProcessingPayment");
    }

Error:
com.stripe.exception.InvalidRequestException: Invalid checkout.session id: cs_test_b1xCYFVzlR2kE1EFIXQ7TjVQ59sIOganrliuAQeOOnX7BY40qHx9ZmVJYj; request-id: req_NNHXMwcJnY01Pn

marsh parcel
#

thx ๐Ÿ™‚

thorn current
#

You created that Checkout Session using the Stripe-Account header so it was created on a connect account, but when you try and retrieve it you're not passing in the same Stripe-Account header. I think you need to pass in requestOptions in your retrieval code as well

marsh parcel
#

๐Ÿ˜ณ OMG yes, thank you! Run and tested, it works now!

thorn current
#

awesome ๐Ÿ™‚

marsh parcel
#

sorry, I am back.... now I am calling

#

Session session =
Session.retrieve(
order.orderPayment.providerProperties.get("sessionid"),
requestOptions
);

#

after the session has started and the user is on the Stripe checkout... but I get:

#

com.stripe.exception.InvalidRequestException: No such checkout session: 'cs_test_b1u1JHobbkDocyNkraeB9BjLivfMjZdcnFvdTvoglyOcURPrBLpWZpWEpV'; code: resource_missing; request-id: req_jcgMZgQwWcXTao

#

what is request-id?

vale juniper
#

Hello! I'm taking over for karbi, getting caught up, hang on...

#

Request IDs identify a specific Stripe API request and are very useful to provide here to get support.