cloudpayments/CloudPayments-SDK-iOS

paymentFormWillHide and paymentFormDidHide do not get called when X button is clicked card form

Opened this issue · 0 comments

  • Open a simple card form
  • Click X button to close
 private func openPaymentPage(model: CloudPaymentsViewModel.PaymentModel) {

        let paymentData = PaymentData()
            .setAmount(model.amount)
            .setCurrency(model.currency)
            .setAccountId(model.userId)
            .setEmail(model.email)
            .setPayer(model.payerData)

        let configuration = PaymentConfiguration.init(
            publicId: model.publicKey,
            paymentData: paymentData,
            delegate: self,
            uiDelegate: self,
            scanner: nil,
            showEmailField: true,
            useDualMessagePayment: true,
            disableApplePay: true,
            disableYandexPay: true)

        let formVC = PaymentForm.present(with: configuration, from: self)
    }

Below is your code which closes that form and it doesn't have the calls of that delegate methods

self.closeButton.onAction = { [weak self] in
            guard let self = self else {
                return
            }
            let parent = self.presentingViewController
            self.dismiss(animated: true) {
                if let parent = parent {
                    if !self.configuration.disableApplePay || !self.configuration.disableYandexPay {
                        PaymentForm.present(with: self.configuration, from: parent)
                    }
                }
            }
        }

It would be great to have also in the delegate method a property which will indicate which exact form was closed PaymentCardForm or PaymentProcessingForm or others