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

[MBL-1305] Revert banner changes #2011

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ final class PostCampaignCheckoutViewController: UIViewController, MessageBannerV
self.title = Strings.Back_this_project()

self.messageBannerViewController = self.configureMessageBannerViewController(on: self)
self.messageBannerViewController?.delegate = self

self.configureChildViewControllers()
self.setupConstraints()
Expand Down Expand Up @@ -399,6 +400,19 @@ extension PostCampaignCheckoutViewController: PledgeViewControllerMessageDisplay

// MARK: - MessageBannerViewControllerDelegate

extension PostCampaignCheckoutViewController: MessageBannerViewControllerDelegate {
func messageBannerViewDidHide(type: MessageBannerType) {
switch type {
case .error:
// Pop view controller in order to start checkout flow from the beginning,
// starting with generating a new checkout id.
self.navigationController?.popViewController(animated: true)
default:
break
}
}
}

extension PostCampaignCheckoutViewController: PKPaymentAuthorizationViewControllerDelegate {
func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {
controller.dismiss(animated: true, completion: { [weak self] in
Expand Down