#Ahsan Khan

1 messages · Page 1 of 1 (latest)

cinder carbonBOT
rancid pelican
#

In which step are you retrieving the Payment Intent? Any Doc you are following?

sharp junco
#

Terminal.getInstance().retrievePaymentIntent(clientSecret,
new PaymentIntentCallback() {
@Override
public void onSuccess(PaymentIntent paymentIntent) {
// Placeholder for collecting a payment method with paymentIntent
}

@Override
public void onFailure(TerminalException exception) {
  // Placeholder for handling exception
}

}
})

#

what client secret will pass here in this method?

rancid pelican
#

That's the PaymentIntent's clientSecret

#

it's inside the PaymentIntent object when you created in backend

sharp junco
#

This one highlighted?

rancid pelican
#

yep

sharp junco
#

ok so i have 1 more question

rancid pelican
#

Sure

sharp junco
#

Ok, So When I pass the "client_secret" in Terminal.getInstance().retrievePaymentIntent(clientSecret) function mentioned in the below screenshot. It returns this error mentioned in the second screenshot. So What could be the problem here?

rancid pelican
#

Are you sure you are from the same Stripe Account? ie. How did you initialized the SDK?

cinder carbonBOT
hexed ginkgo
#

đź‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

sharp junco
#

yes from Same stripe account

#

Terminal.initTerminal(
applicationContext, LogLevel.VERBOSE, TokenProvider(), TerminalEventListener()
)

#

Initialize terminal this way

#

and in TokenProvider(), I call backend api to retrieve connection Token

rancid pelican
#

(please post here the payment intent id in text pi_xxx, and the account id whose you used its secret key to create the Connection Token in backend, then my colleague will continue to assist)

sharp junco
#

"paymentIntent": {
"id": "pi_3NpcqEC5sd7OOJiO0xY0uwKs”,
"client_secret": "pi_3NpcqEC5sd7OOJiO0xY0uwKs_secret_w47vKkvznWyKCIY5XitGd6i4Q",
}

#

these values return upon creating payment Intent

#

"stripeId": "acct_1NPovIFtVGHhNK4J",
"strikpeKey": "sk_test_51M2ctlC5sd7OOJiOZZ1c3135nAm2nBieaoyUj7NMwTO9NlHuEb2D7aNsbTijaGKI7foS4u455LHFzNkIhSZGgErA00tGu4588o"

#

?

hexed ginkgo
#

sorry @sharp junco I thought that @rancid pelican was still with you, will be there shortly

#

what's the error you're getting?

sharp junco
#

can you see my above thread?

hexed ginkgo
#

I don't see any errors related to terminal

#

on this PI

#

all I can see is that you're trying to capture the PaymentIntent without providing a Payment Method

sharp junco
#

Please check the latest one

#

It returned this client secret
"client_secret": "pi_3NpozwC5sd7OOJiO1cMYeVcx_secret_wAuKSbR6S1dGndgRv7UzhR5Oe",

#

Now in the next process I am using this terminal method to retrieve paymentIntent

#

Terminal.getInstance().retrievePaymentIntent(clientSecret)

#

and it returns this error inside retrievePaymentIntent callback
@Override
public void onFailure(TerminalException exception) {
// Placeholder for handling exception
}

#

//No such payment Intent

cinder carbonBOT
orchid lichen
#

You create that PaymentIntent on a connected account, which means you also need to create the ConnectionToken on the connected account as well(using the Stripe-Account option) so that the SDK can access it.

sharp junco
#

I have already created one by using this api

orchid lichen
#

ah right sorry

#

you actually do not need to do that. I misread, you are using Destination charges.

#

so you'd just create the ConnectionToken without Stripe-Account and it works.

sharp junco
#

I didn't get you. What am I doing wrong here?

#

My use Case.

  • The customer will donate the amount.
  • The application will detect its fees. I mean application_fee_amount
  • The remaining will be transferred to the connected account after stripe platform fee
orchid lichen
#

sounds good

#

are you the one writing the code of the backend server, this "/v1/kiosk/token" code?

sharp junco
#

yes

orchid lichen
#

please share what that code looks like and I'll tell you what's wrong with it

sharp junco
#

ok wait

sharp junco
#

using simple this api with a secret key

#

to create connection token

orchid lichen
#

that seems ok. And then you use the resulting connectiontoken on the frontend?

sharp junco
#

yes

orchid lichen
#

then it will work

sharp junco
#

Can you keep this thread open? I will test the complete cycle in the next hour and will show you the logs