#priya_code

1 messages ยท Page 1 of 1 (latest)

lilac oreBOT
#

๐Ÿ‘‹ 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.

slow kelp
craggy junco
#

we need in ios app

slow kelp
#

Then there's links on the same page for iOS

craggy junco
#

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");
}

slow kelp
#

OK, and what happens if you run that code?

lilac oreBOT
craggy junco
#

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

cloud mauve
#

Hey! Taking over for my colleague.

craggy junco
#

okay

cloud mauve
#

Could you please highlight what method is available in Android and not in IOs ?

craggy junco
#

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
    }
}

)

cloud mauve