#Ronit
1 messages · Page 1 of 1 (latest)
pi_3NNWy14DfIvvXFPZ1WL3b3BC
And do you have the Request ID (req_xxx) that generated that error?
i don't have the backend server access so is there any other option?
Or can you share the code you wrote that generated that error?
yes sure
STPAPIClient.shared.retrievePaymentIntent(withClientSecret: "passing client secret", completion: { (paymentIntent, error) in
if let error = error {
// Handle the error
print("Error retrieving payment intent: (error)")
} else if let paymentIntent = paymentIntent {
// Handle the payment intent
print("Payment intent: (paymentIntent)")
let paymentIntents = paymentIntent
// Check the status of the payment intent
if paymentIntent.status == .succeeded {
// Payment intent is verified and successful
print("Payment intent is verified and successful")
} else {
// Payment intent is not verified or not successful
print("Payment intent is not verified or not successful")
}
}
})
here i am passing client secret that are created on backend
The PaymentIntent was created on a connected accout, so you are missing the Stripe-Account header: https://stripe.com/docs/connect/authentication
ohk
let me check and let you know
Payment intent: <StripePayments.STPPaymentIntent: 0x10d6226e0; stripeId = pi_3NNXAr4DfIvvXFPZ1ucaQG1y; amount = 120500; canceledAt = nil; captureMethod = Optional("automatic"); clientSecret = <redacted>; confirmationMethod = Optional("automatic"); countryCode = nil; created = 2023-06-27 08:22:57 +0000; currency = usd; description = nil; lastPaymentError = nil; linkSettings = nil; livemode = false; nextAction = nil; paymentMethodId = nil; paymentMethod = nil; paymentMethodOptions = nil; paymentMethodTypes = Optional(["card_present"]); receiptEmail = nil; setupFutureUsage = Optional("off_session"); shipping = nil; sourceId = nil; status = Optional("requires_payment_method"); unactivatedPaymentMethodTypes = []>
getting this error
Can you share your code or the request ID?
This doesn't look like an error to me
isn't this just your code logging the PaymentIntent print("Payment intent: (paymentIntent)")?
yes this print shows this log that i sent with require payment method
So it's not an error message. Your API request worked, and we retruned the PaymentIntent which has a requires_payment_method status.
ohk but this log is not showing as verified successfully
That's true. But if you look at the PaymentIntent in your dashboard here https://dashboard.stripe.com/test/payments/pi_3NNXAr4DfIvvXFPZ1ucaQG1y:
- You created the PaymentIntent
- And then... nothing. So it's expected that it's in
requires_payment_methodstatus
Are you making an iOS app? Are you using the PaymentSheet to accept payments?
yes i m making ios app and want to use physical card tap and pay option
which documentation link are you following?
Looks like you correct did step 1 (create the PaymentIntent). Now you need to do step 2 (Collect a payment method)
Terminal.shared.retrievePaymentIntent(clientSecret: MembershipAPIRouter.stripe_Client_Secret!) { retrieveResult, retrieveError in
if let error = retrieveError {
print("retrievePaymentIntent failed: (error)")
}
else if let paymentIntent = retrieveResult {
print("retrievePaymentIntent succeeded: (paymentIntent)")
if paymentIntent.status == .requiresPaymentMethod {
// Payment intent requires a payment method
Terminal.shared.collectPaymentMethod(paymentIntent) { collectResult, collectError in
if let error = collectError {
print("collectPaymentMethod failed: (error)")
} else if let paymentIntent = collectResult {
print("collectPaymentMethod succeeded")
if let paymentMethod = paymentIntent.paymentMethod,
let card = paymentMethod.cardPresent {
// Perform business logic on the card
}
// Confirm the payment intent to complete the payment
Terminal.shared.confirmPaymentIntent(paymentIntent) { confirmResult, confirmError in
if let error = confirmError {
print("confirmPaymentIntent failed: \(error)")
} else if let confirmedPaymentIntent = confirmResult {
print("confirmPaymentIntent succeeded: \(confirmedPaymentIntent)")
// Process the payment
}
}
}
}
}
}
}
this are my code i had implemented but there is error at retrievepayment method "Type of expression is ambiguous without more context"
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Could you please share more context about this error? Where do you see it?
Could you please share a screenshot?
Not very familiar with iOS, but I found a similar error message on Stackoverflow here: https://stackoverflow.com/questions/40894582/type-of-expression-is-ambiguous-without-more-context-swift
This happens when you have a function with wrong argument names.
But your code looks simiar to the one I see in the documentation.
Which version of stripe-ios are you using?
Also which Terminal device do you have?
pod 'StripeTerminal', '2.0'
If if you try to log the client_secret, just before calling retrievePaymentIntent, what do you see?
string client secret
so you do see the client secret as expected?
yes it is coming in that string
Got it, then I'm not sure. I would recommend to contact stripe support direct here: https://support.stripe.com/contact
Make sure to include all relevant information, like PaymentIntent ID, your code, the exact error message, etc. And they should be able to help.
ok