#Ahsan Khan
1 messages · Page 1 of 1 (latest)
In which step are you retrieving the Payment Intent? Any Doc you are following?
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?
That's the PaymentIntent's clientSecret
it's inside the PaymentIntent object when you created in backend
This one highlighted?
yep
ok so i have 1 more question
Sure
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?
Are you sure you are from the same Stripe Account? ie. How did you initialized the SDK?
đź‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
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
(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)
"paymentIntent": {
"id": "pi_3NpcqEC5sd7OOJiO0xY0uwKs”,
"client_secret": "pi_3NpcqEC5sd7OOJiO0xY0uwKs_secret_w47vKkvznWyKCIY5XitGd6i4Q",
}
these values return upon creating payment Intent
"stripeId": "acct_1NPovIFtVGHhNK4J",
"strikpeKey": "sk_test_51M2ctlC5sd7OOJiOZZ1c3135nAm2nBieaoyUj7NMwTO9NlHuEb2D7aNsbTijaGKI7foS4u455LHFzNkIhSZGgErA00tGu4588o"
?
sorry @sharp junco I thought that @rancid pelican was still with you, will be there shortly
what's the error you're getting?
can you see my above thread?
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
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
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.
I have already created one by using this api
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.
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
sounds good
are you the one writing the code of the backend server, this "/v1/kiosk/token" code?
yes
please share what that code looks like and I'll tell you what's wrong with it
ok wait
curl https://api.stripe.com/v1/terminal/connection_tokens
-u sk_test_51M2ctlC5sd7OOJiOZZ1c3135nAm2nBieaoyUj7NMwTO9NlHuEb2D7aNsbTijaGKI7foS4u455LHFzNkIhSZGgErA00tGu4588osk_test_51M2ctlC5sd7OOJiOZZ1...kIhSZGgErA00tGu4588o:
-X "POST"
using simple this api with a secret key
to create connection token
that seems ok. And then you use the resulting connectiontoken on the frontend?
yes
then it will work
Can you keep this thread open? I will test the complete cycle in the next hour and will show you the logs