#nova-connect-oauth

1 messages ยท Page 1 of 1 (latest)

wicked cargoBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

rare sinew
#

nova-connect-oauth

#

๐Ÿ‘‹ I'm sorry I don't understand most of the question right now. What do you mean "test payout accounts" exactly?

torn scroll
#

๐Ÿ‘‹ A picture might help

wicked cargoBOT
torn scroll
#

This config won't let me continue. The account numbers are pulled from your 'Testing Stripe Connect' documentation. If I inspect the network call I get this

ocean olive
#

The error message mentioned it. Can you paste its content here ๐Ÿ™‚

torn scroll
#
{
    "error": {
        "code": "resource_missing",
        "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
        "message": "No such token: 'btok_1O7pG4Iw1p1PjYxmcLBNRikB'; a similar object exists in test mode, but a live mode key was used to make this request.",
        "message_code": "missing_resource_with_message_about_livemode",
        "param": "external_account",
        "request_log_url": "https://dashboard.stripe.com/logs/req_vQHHiMnr703MR3?t=1698886780",
        "type": "invalid_request_error"
    }
}
#

However this makes no sense. The picture above shows I am in test mode, and I have verified I am using a test mode key.

#

I should also add, the web page doesn't actually show the error. I have to inspect to see what went wrong, the page just spins for a bit then does/shows nothing.

ocean olive
torn scroll
#

If I am in live mode, why is there 'Test Mode' on the page*

ocean olive
#

Can you share the URL for me to double check?

torn scroll
#

If it helps, here is the code I am using.

    @Override
    public ResponseEntity<Void> initiateOauth2Authorization () throws AuthenticationException, InvalidRequestException, URISyntaxException
    {
        Map<String, Object> params = new HashMap<>();
        params.putAll(Map.of("scope", "read_write", "redirect_uri", this.connectRedirect));

        String url = OAuth.authorizeUrl(params, null);
        return ResponseEntity.status(HttpStatus.FOUND).location(new URI(url)).build();
    }

The URL returned from the code is

https://connect.stripe.com/oauth/authorize?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fapi%2Fv1%2Fstripe%2Foauth%2Fconnect&client_id=ca_IVPIlXPWG1btoakCoNBoyBCT63Hxw6a0&scope=read_write

And the test mode client ID is ca_IVPIlXPWG1btoakCoNBoyBCT63Hxw6a0

#

So at least to me, it looks like Oauth,authorizeUrl pulls the correct client ID automatically.

ocean olive
#

Okie I am trying to reproduce. When completing this form, do you see or use this "Skip this form" button?

torn scroll
#

I see the skip this form button yes. I do have an issue however where the account ID I get from connecting my account this way is incorrect.

#

Its a totally unrelated account ID, and creating a customer (and then immediately retrieving it) fails, and the customer is never created on the connected account.

#

That account ID is neither of my accounts (the platform, nor the test account)

ocean olive
#

Let's focus on this part

If i don't skip the form, I cannot proceed past the step where I add a payout address. The web call comes back telling me that the account token was made in test mode, but a live mode key was provided. At this point, I am unsure what I am doing wrong, and could use any help I can get.
I am trying to reproduce, 1 min

torn scroll
#

Understood. Both of these issues are preventing me from continuing, so im hoping they are related to me doing something wrong

ocean olive
#

I can get pass that page

torn scroll
#

With the exact bank account credentials I am using?

ocean olive
#

Don't think the information would change the mode

torn scroll
#

Is it possible that account/transit combination is the one that is broken then?

ocean olive
#

Not sure. Can you provide some screenshot about this?

If I skip the form, the return URL I provided is completely ignored and tells me that the URI needs to match exactly one of the uris specified in my application settings (it does)

torn scroll
#

One of them is (imho) a bug in stripe, caused by a bug in my code.

ocean olive
#

Glad to hear you sorted out! But what was it?

torn scroll
#

When you receive the oauth grant back from the stripe service, it can be parsed into an oauth token like this.

TokenResponse response = OAuth.token(ImmutableMap.of("grant_type", "authorization_code", "code", code), null);
JsonObject rawResponse = response.getRawJsonObject();
com.stripe.model.Account account = com.stripe.model.Account.retrieve(response.getStripeUserId());

The account ID from response.getStripeUserId was the one I was storing, expecting that to be connected stripe account. It is not, and the one I need to store is account.getId(). The bug however, is that I can still use the response.getStripeUserId value in my Stripe-Account header and it works perfectly fine (returns a 200 response, customer objects and everything).

#

However, anything created using that getStripeUserId call is ephemeral, and cannot be retrieved.

ocean olive
#

I see. So have it resolved your original question? It looks like you finished the Onboarding flow and reached the token exchange step successfully

torn scroll
#

I have just been using the skip this form

#

I still cannot add a payout account, but I can at least move forward if Stripe doesnt think the provided test account info is broken.