#mauliks_cancel-terminal-action
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/1234849129704849449
๐ 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, 8 messages
- mauliks_code, 3 days ago, 35 messages
- mauliks_code, 5 days ago, 42 messages
- mauliks_code, 5 days ago, 56 messages
Hi there ๐ do you have more details on what you're seeing? It looks like that's a line to create a Payment Intent, do you see the request being made to Stripe at all?
yes I guess I can see in Logs
ID: req_uK1iP39gG5QUNE
my app is here as of now: - (void)reader:(nonnull SCPReader *)reader didRequestReaderInput:(SCPReaderInputOptions)inputOptions
app showing the swipe card on my UI
here user cancels the payment I mean goes back to previous screen
then come again and try to make payment
but app does not receives any response from [[SCPTerminal shared] createPaymentIntent:params completion:^(SCPPaymentIntent *createResult, NSError *createError) method
Hm, odd, the request you shared shows that a response is being sent.
yes for 1st time
Do you have log lines in success and error functions that get triggered when that function completes? Do you see any of those being hit?
Oh, are you seeing a requset ID being generated for the second time?
You can check your logs in your Stripe dashboard:
https://dashboard.stripe.com/logs?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
let me try again
ID: req_ps2jHeuIND8yRv
just created
now app is in - (void)reader:(nonnull SCPReader *)reader didRequestReaderInput:(SCPReaderInputOptions)inputOptions
waiting for card input
Swipe / Insert / Tap
now I will cancel and going to previous screen and will try again
[[SCPTerminal shared] createPaymentIntent:params completion:^(SCPPaymentIntent *createResult, NSError *createError)
{
if (createError)
now app is waiting for this method
to get response
this time I dont see new ID on logs
Yeah, I'm not seeing any evidence that a second request is being made by your app. Do you have logging in plave to make sure your app is getting back to the chunk of code that you think it is? Are you seeing any errors in your logs that could indicate why that method isn't running if it is being reached?
checking
I checked, all steps are repeated
nothing missing
app creates SCPPaymentIntentParameters without error
then calling [[SCPTerminal shared] createPaymentIntent:params completion:^(SCPPaymentIntent *createResult, NSError *createError)
and just waiting
I don't see any log lines in the failure block there, are you sure it isn't failing and not logging the returned error? (But I'm also not too familiar with iOS dev environments, so I may be misreading something)
yes sure each line is getting executed same way like 1st time
1st time I am getting response but not 2nd time
1st time after creating Payment Intent I cancel the process and again trying to create payment intent
and it got stuck
When you say you cancel the process, what does that mean? Are you canceling the reader action and seeing it leave the screen asking for input?
no, just remove the payment screen and re open it
So the reader never leaves the card input screen? If so, I think that may be why nothing is happening.
reader leaves the card input screen in my app
but I dont call any stripe API to notify this
more: the reader is in waiting state - (void)reader:(nonnull SCPReader *)reader didRequestReaderInput:(SCPReaderInputOptions)inputOptions
to tap card or input card to the reader to capture
yoare u understanding?
Kind of, but I have no idea why you'd be seeing that behavior. I have teammates looking at the thread to see if they can paint a more complete picture of what you're describing for me.
They confirmed what I was suspecting, that you need to actually cancel the terminal SDK action before requesting it take another action.
https://docs.stripe.com/terminal/payments/collect-payment?terminal-sdk-platform=ios#collect-cancel-collection
ok let me try
do I need to call this when user cancels while reader is in waiting state?
Yes
I dont think so because it does not make any difference
More details?
What code? What are you seeing? What logging is being triggered? Are you seeing any errors?
this URL suggest code
that one
Okay, and you seem to be using an M2, so I'm guessing you're referring to the programatic cancelation shown there rather than the customer initiated approach.
correct
That code isn't shown in the doc, so can you share what code you added?
I see, you added the customer initiated flow which doesn't work for readers without a screen like the M2
You need to cancel the action:
https://stripe.dev/stripe-terminal-ios/docs/Classes/SCPCancelable.html#/c:objc(cs)SCPCancelable(im)cancel:
I don't believe so.
Any time! Glad we were able to get you there!
1 more thing
just a minor one
self.collectCancelable = [[SCPTerminal shared] collectPaymentMethod:createResult completion:^(SCPPaymentIntent *collectResult, NSError *collectError)
during creating payment intent.
cancel click:
[self.collectCancelable cancel:^(NSError * _Nullable error)
{
}];
this is my code, is it ok ?
My teammate isn't seeing anything obvious jumping out at them. Is it functioning as you're expecting in your testing?
yes