#priya_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/1342114921768292424
๐ 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.
- priya_code, 3 hours ago, 16 messages
What have you tried and what isn't working as you expect? The steps are here, mostly: https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=android#confirm-payment
we need in ios app
Then there's links on the same page for iOS
but dont have like that method sepparately like android
we have a udated payment intent and next step we need to confirm that payment
for below step :
self.confirmCancelable = Terminal.shared.confirmPaymentIntent(collectPaymentMethodPaymentIntent) { confirmResult, confirmError in
if let error = confirmError {
print("confirmPaymentIntent failed: (error)")
} else if let confirmedPaymentIntent = confirmResult {
print("confirmPaymentIntent succeeded")
// Notify your backend to capture the PaymentIntent
if let stripeId = confirmedPaymentIntent.stripeId {
APIClient.shared.capturePaymentIntent(stripeId) { captureError in
if let error = captureError {
print("capture failed: (error)")
} else {
print("capture succeeded")
}
}
} else {
print("Payment collected offline");
}
OK, and what happens if you run that code?
let sendParam: [String: Any] = [
"api_key": self.getkey,
"amount": finalTotalAmt,
"trans_amount": finalTransferAmt,
"action": "UpdatePaymentIntent",
"payment_intent": PayMentIntentIId ?? ""
let updateURL = NEW_BASE_URL // Ensure this is the correct API URL
AF.request(updateURL, method: .post, parameters: sendParam, encoding: URLEncoding.default, headers: headers)
.responseJSON { response in
print("๐ฉ Raw Response: \(response)")
switch response.result {
case .success(let value):
if let responseValue = value as? [String: Any],
let paymentIntentObject = responseValue["object"] as? String,
paymentIntentObject.lowercased() == "payment_intent",
let clientSecret = responseValue["client_secret"] as? String,
let paymentIntentID = responseValue["id"] as? String {
print("โ
Client Secret: \(clientSecret)")
print("โ
Payment Intent ID: \(paymentIntentID)")
self.updatedestination = 2
print("๐ updatedestination set to 2")
if let savedCollectResult = UserDefaults.standard.value(forKey: "collectResultKey") {
print("Retrieved collect result:", savedCollectResult)
Terminal.shared.confirmPaymentIntent(savedCollectResult as! PaymentIntent) { confirmResult, confirmError in
if let error = confirmError
we have update payment intent like above steps then how to confirm because confirm need collect result
userdeafault does not work
Hey! Taking over for my colleague.
okay
Could you please highlight what method is available in Android and not in IOs ?
And could you point to what step are you blocked in this guide:
https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=ios
val cancelable = Terminal.getInstance().confirmPaymentIntent(
paymentIntent,
object : PaymentIntentCallback {
override fun onSuccess(paymentIntent: PaymentIntent) {
// Placeholder handling successful operation
}
override fun onFailure(e: TerminalException) {
// Placeholder for handling exception
}
}
)
Here is the IOs version of that function:
https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=ios#confirm-payment