#Ronit

1 messages · Page 1 of 1 (latest)

red kettleBOT
gentle jackal
#

Hi there!

#

Can you share the PaymentIntent ID (pi_xxx)?

cold bluff
#

pi_3NNWy14DfIvvXFPZ1WL3b3BC

gentle jackal
#

And do you have the Request ID (req_xxx) that generated that error?

cold bluff
#

i don't have the backend server access so is there any other option?

gentle jackal
#

Or can you share the code you wrote that generated that error?

cold bluff
#

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

gentle jackal
cold bluff
#

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

gentle jackal
#

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)")?

cold bluff
#

yes this print shows this log that i sent with require payment method

gentle jackal
#

So it's not an error message. Your API request worked, and we retruned the PaymentIntent which has a requires_payment_method status.

cold bluff
#

ohk but this log is not showing as verified successfully

gentle jackal
#

Are you making an iOS app? Are you using the PaymentSheet to accept payments?

cold bluff
#

yes i m making ios app and want to use physical card tap and pay option

gentle jackal
#

which documentation link are you following?

cold bluff
gentle jackal
#

Looks like you correct did step 1 (create the PaymentIntent). Now you need to do step 2 (Collect a payment method)

cold bluff
#

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"

proven berry
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

proven berry
cold bluff
#

yes sure

#

i am seeing in Terminal.shared.retrievePaymentIntent method

proven berry
#

Could you please share a screenshot?

cold bluff
#

yes sure

#

here is screenshot

gentle jackal
#

Which version of stripe-ios are you using?

#

Also which Terminal device do you have?

cold bluff
#

pod 'StripeTerminal', '2.0'

gentle jackal
#

If if you try to log the client_secret, just before calling retrievePaymentIntent, what do you see?

cold bluff
#

string client secret

gentle jackal
#

so you do see the client secret as expected?

cold bluff
#

yes it is coming in that string

gentle jackal
#

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.

cold bluff
#

ok