#billhyuou

1 messages · Page 1 of 1 (latest)

fast sapphireBOT
tropic saddle
#

i have ios code: class PaymentViewController: UIViewController {
// Your other view controller code here

func initiatePayment() {
    // Call your server to create a Payment Intent with the necessary details,
    // including 3DS support. The server will return the client secret.

    let clientSecret = "YOUR_CLIENT_SECRET_FROM_SERVER"

    // Create a PaymentIntentParams object
    let paymentIntentParams = STPPaymentIntentParams(clientSecret: clientSecret)

    // Optionally, set additional parameters if needed
    paymentIntentParams.paymentMethodId = "YOUR_SELECTED_PAYMENT_METHOD_ID"

    // Confirm the Payment Intent
    STPPaymentHandler.shared().confirmPayment(withParams: paymentIntentParams, authenticationContext: self) { (status, paymentIntent, error) in
        switch status {
        case .succeeded:
            // Payment succeeded, handle success scenario
            break
        case .failed:
            // Payment failed, handle failure scenario
            break
        case .canceled:
            // Payment canceled by the user, handle cancel scenario
            break
        default:
            break
        }
    }
}

}

#

but i need android code, but i can't find be related to code

keen hawk
#

What are you trying to do?

tropic saddle
#

use 3ds test and verify

#

Can I provide an Android code according to the iOS code

#

ios code is class PaymentViewController: UIViewController {
// Your other view controller code here

func initiatePayment() {
    // Call your server to create a Payment Intent with the necessary details,
    // including 3DS support. The server will return the client secret.

    let clientSecret = "YOUR_CLIENT_SECRET_FROM_SERVER"

    // Create a PaymentIntentParams object
    let paymentIntentParams = STPPaymentIntentParams(clientSecret: clientSecret)

    // Optionally, set additional parameters if needed
    paymentIntentParams.paymentMethodId = "YOUR_SELECTED_PAYMENT_METHOD_ID"

    // Confirm the Payment Intent
    STPPaymentHandler.shared().confirmPayment(withParams: paymentIntentParams, authenticationContext: self) { (status, paymentIntent, error) in
        switch status {
        case .succeeded:
            // Payment succeeded, handle success scenario
            break
        case .failed:
            // Payment failed, handle failure scenario
            break
        case .canceled:
            // Payment canceled by the user, handle cancel scenario
            break
        default:
            break
        }
    }
}

}

keen hawk
tropic saddle
#

yes

#

If the user has 3ds, they can directly call SDK for payment

#

Can you provide an Android code based on the iOS code

keen hawk
tropic saddle
#

ok i try,thanks

keen hawk
#

Happy to help!