Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added setup for payment method management widget #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shivam25092001
Copy link
Contributor

ADDED

  • Payment Method Management Widget

REMOVED

  • Payment Method Management FullScreen View

SCREENSHOTS

Screenshot 2024-10-18 at 5 52 37 PM Screenshot 2024-10-18 at 5 52 56 PM Screenshot 2024-10-18 at 5 55 29 PM

RECORDING

Screen.Recording.2024-10-18.at.5.55.44.PM.mov

public func presentPaymentManagementSheet(viewController: UIViewController, configuration: PMMConfiguration, completion: @escaping (PaymentMethodManagementSheetResult) -> ()) {
let pmManagement = PaymentMethodManagement(ephemeralKey: PaymentSession.ephemeralKey ?? "", configuration: configuration)
pmManagement.presentPaymentMethodManagementView(from: viewController, completion: completion)
public func getPaymentMethodManagementWidget(frame: CGRect, onAddPaymentMethod: (() -> Void)?, completion: @escaping (PaymentMethodManagementResult) -> ()) -> UIControl {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect approach don't use a function to get widget, use widget UIView Directly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UIView/Control

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but that would become asymetric to how we consume the paymentSheet. If that's ok then this is just a wrapper function, we can eliminate that

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct this is different from payment sheet, lets eliminate the wrapper function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 👍

print("-- exit widget")
DispatchQueue.main.async {
if let view = RNViewManager.sharedInstance.rootView {
let reactNativeVC: UIViewController? = view.reactViewController()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are adding widget view to a UIViewController and then dismissing it, try to just remove the view

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants