         icon.clipsToBounds = true
         return icon
     }
-
+    
     func clearDiscountIcon() {
         discountIcon?.removeFromSuperview()
         discountIcon = nil
     }
-
+    
     func clearIconImageView() {
         iconImageView?.removeFromSuperview()
         iconImageView = nil
     }
-
+    
     func clearOverviewBrief() {
         overviewBrief = nil
         if let verStackView = verStackView, verStackView.subviews.count == 2 {
             verStackView.subviews.last?.removeFromSuperview()
         }
     }
-
+    
     func buildAndAddIconImageView() {
         let imageView: UIImageView = UIImageView()
         self.iconImageView = imageView

import UIKit

class PXOneTapSummaryRowView: UIView {

    typealias Handler = () -> Void

    enum RowType {
        case discount
        case charges
        case generic
    }

    static let DEFAULT_HEIGHT: CGFloat = 16
    static let TOTAL_ROW_DEFAULT_HEIGHT: CGFloat = 52
    static let MARGIN: CGFloat = 8
    private var data: PXOneTapSummaryRowData
    private var titleLabel: UILabel?
    private var iconImageView: UIImageView?
    private var valueLabel: UILabel?
    private var discountIcon: UIImageView?
    private var verStackView: UIStackView?
    var overviewBrief: UILabel?
    var heightConstraint = NSLayoutConstraint()
    var valueLabelTopConstraint = NSLayoutConstraint()
    var valueLabelCenterYConstraint = NSLayoutConstraint()

    init(data: PXOneTapSummaryRowData) {
        self.data = data
        super.init(frame: CGRect.zero)
        render()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    open func getData() -> PXOneTapSummaryRowData {
        return data
    }

    func getTotalHeightNeeded() -> CGFloat {
        return getRowHeight() + getRowMargin()
    }

    open func getRowMargin() -> CGFloat {
        return data.isTotal ? PXLayout.ZERO_MARGIN : PXLayout.XXS_MARGIN
    }

    open func getRowHeight() -> CGFloat {
        if data.isTotal {
            return !UIDevice.isSmallDevice() ? PXOneTapSummaryRowView.TOTAL_ROW_DEFAULT_HEIGHT : PXOneTapSummaryRowView.TOTAL_ROW_DEFAULT_HEIGHT - 4

            brief.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 5)
        ])
    }
    
    func buildDiscountIcon() -> UIImageView {
        let icon = UIImageView()
        discountIcon = icon
