OPPPaymentButton

@objc(OPPPaymentButton)
@MainActor
public class OPPPaymentButton : UIButton

Class that extends UIButton in order to esily integrate separate payment methods in the app.

By default button contains appropriate logo if a valid payment method is set. Button can be fully customized as common UIButton.

To create and submit a transaction, use OPPCheckoutProvider.presentCheckout(withPaymentBrand:loadingHandler:completionHandler:cancelHandler:) in button action method.

  • Payment brand for the transaction that is used to display an appropriate logo. Logo will be loaded automatically from the Server. To use your own image for a button, set it before initializing the payment brand.

    Declaration

    Swift

    @objc
    @MainActor
    public var paymentBrand: String { get set }
  • Creates and returns payment button initialized with the payment brand.

    Declaration

    Swift

    @objc
    @MainActor
    public required init(paymentBrand: String)

    Parameters

    paymentBrand

    Payment brand for the transaction.

    Return Value

    self.

  • Creates and returns payment button initialized with the payment brand.

    Declaration

    Swift

    @objc
    @MainActor
    public static func paymentButton(withPaymentBrand paymentBrand: String) -> Self

    Parameters

    paymentBrand

    Payment brand for the transaction.

    Return Value

    self.