#mauliks_code
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/1232656106812211230
๐ 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.
- mauliks_code, 1 day ago, 20 messages
- mauliks_api, 4 days ago, 37 messages
Hi, let me help you with this.
Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_sCVxyxNehoTNYb
I am following same code from here: https://docs.stripe.com/terminal/payments/collect-payment?terminal-sdk-platform=ios&lang-ios=objc#confirm-payment
Are you confirming the PaymentIntent on the device? Because I see that the request was sent from the backend.
I am using simulator for testing
Are you able to collect the Payment Method prior to confirming?
by this method collectPaymentMethod ?
yes collectPaymentMethod method gives me no errors
after this I am calling capturePaymentIntent method with above result's stripeId
to this endpoint confirm: https://api.stripe.com/v1/payment_intents/%@/confirm
It needs to be: collectPaymentMethod -> confirmPaymentIntent -> capturePaymentIntent
but confirmPaymentIntent give error
payment_intent_unexpected_state
You cannot confirm this PaymentIntent because it's missing a payment method. You can either update the PaymentIntent with a payment method and then confirm it again, or confirm it again directly with a payment method or ConfirmationToken.
I don't see that a Payment Method is ever added to this PaymentIntent. Could you please share the complete code?
you're missing steps, you never confirm the PaymentIntent. https://docs.stripe.com/terminal/payments/collect-payment?terminal-sdk-platform=ios#confirm-payment
code is too long to send here so sent as file
you jump straight from collectPaymentMethod to capturePaymentIntent, you're missing the part of actually confirming the PaymentIntent.
hold ON
please select Object C code
my be for objective code is not there
my code is just copy from the above URL
it is there.
ok I added this missing piece of code... sorry for this ๐ฆ
but now I got this error:
capture failed: Error Domain=com.stripe-terminal-ios.example Code=2000 "Missing secret in ConnectionToken JSON response" UserInfo={NSLocalizedDescription=Missing secret in ConnectionToken JSON response}
is it missing here: https://api.stripe.com/v1/payment_intents/%@/confirm?
no it means there's something wrong with how you set up the ConnectionToken endpoint and code that calls it
you set capture_method:"automatic" when creating the PaymentIntent
the call to capturePaymentIntent
SCPPaymentIntentParameters *params = [[[SCPPaymentIntentParametersBuilder alloc] initWithAmount:100 currency:@"usd"] build:¶mError];
here?
yes but it says readOnly @property (nonatomic, readonly) SCPCaptureMethod captureMethod;
so I can not set
you can, just give it a try
if it's not possible, then you'd need to create the PaymentIntent on the backend instead of the frontend
ok then you need to create it on the backend instead
๐ฆ
ok after this, what can I skip?
Create a PaymentIntent
Collect a payment method
Confirm the payment
from these
I have to leave sorry, and the Discord channel is closed for the next few hours.
hopefully this has been helpful!
ok take care