#piyushjain_error
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1390647296487719066
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- piyushjain_apple-pay-india, 1 day ago, 36 messages
- piyushjain_api, 2 days ago, 78 messages
Hi
I need to help for Stripe terminal
stripe terminal works with contactless like google pay and apple pay but when i tried with card its not completing.
What does 'not completing' look like? Is there an error thrown? What exaxctly are you trying and what isn't working?
No error. It’s just closing the stripe
The PI you shared is in a requires_payment_method state, is the reader prompting for a card?
Is this the ID of the reader that you're having issues with? tmr_GFzWZwgBQbz5Wm
Wait, this is a livemode Payment Intent and it seems like your integration is trying to call the present_payment_method endpoint: https://dashboard.stripe.com/logs/req_d4XoSen0DYBQGX
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
(you shouldn't be testing in livemode)
Let me check in my code
That endpoint won't work with live keys (see the error) so it's probably causing the reader to error out
This issue came in my production environment
Lives keys are required
Let me check the end point
Yes, but your code is making a call to an endpoint (https://docs.stripe.com/api/terminal/readers/present_payment_method) which doesn't work in livemode. It's a test mode helper for simulating card payments without a reader
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But as I said, you shouldn't be testing card payments with your live keys
I don't know, I don't have access to your code. I'm just looking at the logs of the reader to see what could be causing an issue. I'd recommend using test keys and a physical test card to try your payment flow end-to-end
pi_3Rh6yOPcCRWtyajj3hxlIvMI
can you please check if this payment done in testmode or live mode ?
I think you should be able to answer that by looking at the API response (livemode: true) or in the Dashboard
None, you call the process payment endpoint and the reader will prompt for the card. No other API should be necessary
Skip which call?
public String readerCreatePayment(String stripeKey, String rederId) {
try {
// Set Stripe API key
RequestOptions requestOptions = null;
if (stripeKey.startsWith("acc")) {
requestOptions = RequestOptions.builder().setApiKey(STRIPE_SECRET_KEY).setStripeAccount(stripeKey)
.build();
} else {
requestOptions = RequestOptions.builder().setApiKey(stripeKey).build();
}
// Retrieve the Reader resource
Reader reader = Reader.retrieve(rederId, requestOptions);
// Construct the parameters directly as a Map
String url = String.format(
"https://api.stripe.com/v1/test_helpers/terminal/readers/%s/present_payment_method",
reader.getId());
// Create the params (if no params, you can use an empty map)
Map<String, Object> params = new HashMap<>();
// Send the POST request using ApiResource.request
Reader updatedReader = ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class,
requestOptions);
// Print confirmation
System.out.println("Payment method presented successfully. Reader status: " + updatedReader);
return updatedReader.toString();
} catch (Exception e) {
// Handle exceptions
System.out.println("Error processing payment intent: " + e.getMessage());
return INPROGRESS;
}
}
Actually i am calling this after registerPayment
then i am checking status
Yes, don't call present_payment_method
Why? You should be doing this flow end-to-end with test keys. Testing live payments is against Stripe terms and you'll damage your merchant rep with card networks (by processing and refunding over and over)
in testing it worked right .. it just issue in production we need to skip present_payment_method right
so i just removed that ..
now it should work in production
If it works in test mode it should also work in live mode, yes
yeah in production i just skip https://api.stripe.com/v1/test_helpers/terminal/readers/%s/present_payment_method this api call
Well you shouldn't need that endpoint at all if you're using a physical card like in your screenshot
That's just for 'simulating' the card entry
Okay..