#walter_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/1460985605851844848
๐ 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.
- walter_code, 6 days ago, 51 messages
Hi!
I'm trying to implement the 3DS for a saved payment card on SwiftUI. To help you understand what I'm trying to do, I was able to do that in Android using:
======
...
paymentLauncher = PaymentLauncher.create(activity = this, publishableKey = userHandler.settings.paymentPublishableKey!!, stripeAccountId = null) { result ->
handlePaymentResult(result)
}
...
val params = ConfirmPaymentIntentParams.createWithPaymentMethodId(
paymentMethodId = storedPmId,
clientSecret = clientSecret
)
paymentLauncher.confirm(params)
======
Now, I'm trying to do that in SwiftUI, here's what I'm doing:
====
On my view:
.paymentConfirmationSheet(isConfirmingPayment: $showPayment, paymentIntentParams: create3DSPaymentParams(), onCompletion: { (paymentHandlerActionStatus, paymentIntent, error) in
Log("Finished Payment: (String(describing: error?.localizedDescription))")
})
private func create3DSPaymentParams() -> STPPaymentIntentConfirmParams {
if let secret = payment3dsAuth?.action?.ClientSecret,
let storedPaymentMethodId = payment3dsAuth?.storedPaymentMethodId {
Log("secret: \(secret)")
Log("storedPaymentMethodId: \(storedPaymentMethodId)")
let intent = STPPaymentIntentConfirmParams(clientSecret: secret)
intent.paymentMethodId = storedPaymentMethodId
return intent
}
else {
Log("Error!!")
return STPPaymentIntentConfirmParams(clientSecret: "")
}
}
This payment3dsAuth object is my object for parsing the information from the backend call.
This is the logs that I'm getting, the popup is not shown at all:
OrderConfirmationView.create3DSPaymentParams(): secret: pi_3SpEcM4mW9PhCCJk0YWTNwR2_secret_eidHVm7SnRBFkeOGfN0J55lP0
OrderConfirmationView.create3DSPaymentParams(): storedPaymentMethodId: pm_1SpDEu4mW9PhCCJkQqWG2lQ6
LOG ANALYTICS: stripeios.paymenthandler.confirm.started - [(key: "payment_method_type", value: "card"), (key: "payment_method_id", value: "pm_1SpDEu4mW9PhCCJkQqWG2lQ6"), (key: "intent_id", value: "pi_3SpEcM4mW9PhCCJk0YWTNwR2"), (key: "action_id", value: "8E0F8103-AA5D-4459-B98A-2B41BD378DEB")]
LOG ANALYTICS: stripeios.payment_intent_confirmation - [(key: "source_type", value: "unknown"), (key: "pay_var", value: "paymentsheet"), (key: "ocr_type", value: "none"), (key: "company_name", value: "Intoit"), (key: "apple_pay_enabled", value: 1)]
LOG ANALYTICS: stripeios.paymenthandler.confirm.finished - [(key: "status", value: "failed"), (key: "payment_method_type", value: "card"), (key: "payment_method_id", value: "pm_1SpDEu4mW9PhCCJkQqWG2lQ6"), (key: "intent_id", value: "pi_3SpEcM4mW9PhCCJk0YWTNwR2"), (key: "error_type", value: "invalid_request_error"), (key: "error_code", value: ""), (key: "duration", value: 1.1754659414291382), (key: "action_id", value: "8E0F8103-AA5D-4459-B98A-2B41BD378DEB")]
OrderConfirmationView.body: Finished Payment: Optional("There was an unexpected error -- try again in a few seconds")
I'm pretty sure that I'm doing something wrong, could you help me?
Sorry for the long text, I'm trying to give as much context as possible
๐ Hi there, just taking a look now
thanks!
Hmm, I'm not seeing anything obvious wrong, but this might take a while to dig into properly, so it would probably better if you sent this in to my team so we can take a proper look. You can do so at https://support.stripe.com/contact/email?topic=api_integration
do you need more information or what I sent is enough?
If you can find any relevant request IDs (req_xxx) related to your attempts, this might also help https://support.stripe.com/questions/finding-the-id-for-an-api-request
ok, I'll try to find that, thanks!
am I using the correct objects?
I was in doubt because in Android it's called PaymentLauncher and in iOS I only use the paymentConfirmationSheet modifier
so, shouldn't I be using a payment sheet or something like that?
Hey there, are you following the guide to enable saved payment methods via customer session in the mobile payment element, or another guide you can point me to?
eg: https://docs.stripe.com/payments/mobile/accept-payment-embedded?platform=ios&type=payment&ui-framework=swiftui#enable-saved-cards
When you say "implement the 3DS for a saved payment card" do you mean request 3ds for extra authentication, or are you trying to handle 3ds when prompted for it by the issuer?