#domhacking

1 messages ยท Page 1 of 1 (latest)

upper valleyBOT
graceful edge
dense grotto
#

Hey @graceful edge , req_JVwRE4GvLDpAhv

#

That is of the payment intent

#

Sorry to be more clear that is from when I call the collectPaymentMethod

#

So the paymentIntent is created server-side

graceful edge
#

Yep, I can see that. I'm interested in the request that throws the error you shared

#

pi_3MjLBhFP59uQwdcO1FEJKUGU belongs to acct_1MTjblFP59uQwdcO. I'd guess you're attempting to use collectPaymentMethod using the keys of a different account

dense grotto
#

Not intentionally

graceful edge
#

Perhaps not, no! Just want to confirm that is correct

dense grotto
#

So sorry I am a bit confused. You can see that I doing calls from different accounts? e.g the create_token from one account and the payment_intent from another?

#

This is the request id for the attestation/bind: req_1oUy72inHIajZ3

#

Ok cool ๐Ÿ™‚

graceful edge
#

I can't see that no, but that's what I suspect as that's generally what that error indicates. I need to see the req_xxx for the error to confirm

dense grotto
#

yeah

graceful edge
#

Well, that req_xxx is from the same account and isn't an error

dense grotto
#

yup

#

so will the collectPaymentMethod show in the logs?

#

If I am calling the right account?

graceful edge
#

Well, it should yes

dense grotto
#

๐Ÿค”

#

OK

#

But I am not sure how I can be setting a different account if you can see the create_token is calling the right account.

#

How can the collectPayment be calling a different account?

graceful edge
#

I don't know, hard to theorise without more context and/or seeing code.

dense grotto
#

but looking at the documentation the only place to see the account is the StripeTerminalProvider

#

Is there a way I can share my code with you?

graceful edge
#

Yeah, just paste it here.

dense grotto
#

Just the relevant files? There are quite alot.

#

I will try

graceful edge
#

Just the part where you invoke the provider I guess

#

And the code that calls collectPaymentMethod

dense grotto
graceful edge
#

Can you share the usePostCreateConnectionTokenMutation function?

dense grotto
#

Our backend calls the /create_token

graceful edge
#

Can you share the backend code please?

dense grotto
#

I dont have access to it.

#

I mean I could ask someone in the team.

#

I have asked for it.

#

Will share when I have it.

#

Sorry if the code is tricky to read

graceful edge
#

Eh, this is very convluted

#

My guess is the connection token is being created with the wrong keys

#

i.e. when you initialise you backend Stripe client

dense grotto
#

But if you think that is the case how could I see the backend call on the logs?

#

I can see /v1/terminal/attestation/bind

#

But then I cannot see the collectPayments

graceful edge
#

Exactly, so somewhere in your code is using mismatching keys and/or a Stripe-Account header is being passed

#

Unfortunately it's too busy right now for me to filter through all that code and find the relevant parts. Can you pull them out?

dense grotto
#

Sorry I have another questions:

I can see the connection_tokens being called 3 times. Does that matter do you think? Will the /v1/terminal/attestation/bind Just take the latest secret key?

graceful edge
#

I don't think that's related to your current issue no

dense grotto
#

ok thanks

#

Hi @graceful edge , Sorry to bother you. I dont see anything to the network tab when the collectPaymentMethod is called which means that an api call is not made. Could this be due to the fact that this is a simulator and I need to set the test card details?

graceful edge
#

There may not be depending on your Terminal integration

dense grotto
#

I see in the example code that we need to setSimulator and test card details in the payemnt intent if that is handled in the front end.

#

We are using Tap to Pay Android

graceful edge
#

Do you have the code for your Terminal connection token yet?

dense grotto
#

StripeConfiguration.ApiKey = Constants.StripeAPIKey;
var options = new PaymentIntentCreateOptions
{
Amount = Utility.ConvertAmountToFlatInt(amount),
Currency = currency.ToLower(),
//Confirm = true,
Description = description,
PaymentMethodTypes = new List<String> { "card_present" }, //Card present
//PaymentMethod = "card",
CaptureMethod = "automatic", //Automatic capture type
Metadata = metaData
};

graceful edge
#

That's the Payment Intent creation

#

Not the Connection Token

dense grotto
#

Oh yes sorry

#

2 secs

#

public ConnectionToken? GetTerminalConnectionToken()
{
StripeConfiguration.ApiKey = Constants.StripeAPIKey;
var options = new ConnectionTokenCreateOptions { };
var service = new ConnectionTokenService();
var connectionToken = service.Create(options);
return connectionToken;
}

weary orbit
#

Hi! I'm taking over this thread.

#

I would recommend you to contact Stripe support directly who would have more time to investigate: https://support.stripe.com/contact
Make sure to include the exact error message you see, the PaymentIntent ID, and relevant code snippets.