#mahi_96911
1 messages · Page 1 of 1 (latest)
hi there!
how are you accepting payment in your app? with the PaymentSheet or something else?
own design card payment
but what are you using exactly then? Payment Element, Card Element, Checkout Session... ?
can you share a link to the documentation you are following?
first
STPAPIClient.shared.publishableKey = self.response1?.reponseData.paymentdata.api_id
next
STPAPIClient.shared.createPaymentMethod(with: paymentMethodParams) { (paymentMethod, error) in
in this success i could call
main = clieent secret
let paymentHandler = STPPaymentHandler.shared()
paymentHandler.handleNextAction(forPayment: main , with: self, returnURL: nil) { status, paymentIntent, handleActionError in
sure
extension StripePopupVC: STPAuthenticationContext {
func authenticationPresentingViewController() -> UIViewController {
return self
}
above delegate open the secure page but not closed automatically
how to close automatically the secure page
you have to register a custom URL scheme in your app, use that in the returnUrl to the SDK function, and set up a function in your AppDelegate to handle the scheme, to have the redirect be automatic
i have register custom url in app info
in my app delegate :
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
let stripeHandled = StripeAPI.handleURLCallback(with: url)
if (stripeHandled) {
print("111")
return true
} else {
print("222")
// This was not a Stripe url – handle the URL normally as you would
}
return false
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
if let url = userActivity.webpageURL {
let stripeHandled = StripeAPI.handleURLCallback(with: url)
if (stripeHandled) {
print("333")
return true
} else {
print("444")
// This was not a Stripe url – handle the URL normally as you would
}
}
}
return false
}
above is correct or wrong
you don't pass returnUrl though, you pass nil
in appdeleegate?
paymentHandler.handleNextAction(forPayment: main , with: self, returnURL: nil)
that should be returnURL:"my-app-scheme://payment-complete" for instance.
no, in the SDK call to do 3DS.
no
instead of?
not sure what you're asking?
any sample return url
well I posted one just above
but like there's no sample, you have to set this up
you set up a custom URL scheme in your app : https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app
then assuming you created that as e.g "my-app-scheme" then you pass a returnUrl like :"my-app-scheme://payment-complete" for instance"
okay, Thank you