I was looking at integrating the Razorpay checkout feature with iOS in Xcode and found the official documentation at https://razorpay.com/docs/payment-gateway/ios-integration/standard/. The documentation helps with integrating the Razorpay with UIViewController. The iOS app I am building does not make use of the storyboard and is strictly SwiftUI. I have looked at multiple ways of incorporating the UIViewController in SwiftUI which is totally possible with UIViewRepresentable but the code structure uses
struct ComponentName: UIViewRepresentable{}
But Razorpay SDK for iOS wants to implement RazorpayPaymentCompletionProtocol
to a class and not struct. How do I go about in using this in a strictly SwiftUI application?
You can use coordinators to manage the view controllers, and that coordinator will
RazorpayPaymentCompletionProtocol
.Example: