PaymentButtonContainer
@objc(PPCPaymentButtonContainer)
@objcMembers
class PaymentButtonContainer
extension PaymentButtonContainer : CALayerDelegate, CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSCoding, NSObjectProtocol, PaymentButtonDelegate, Sendable, UIAccessibilityIdentification, UIActivityItemsConfigurationProviding, UIAppearance, UIAppearanceContainer, UICoordinateSpace, UIDynamicItem, UIFocusEnvironment, UIFocusItem, UIFocusItemContainer, UILargeContentViewerItem, UIPasteConfigurationSupporting, UIPopoverPresentationControllerSourceItem, UIResponderStandardEditActions, UITraitChangeObservable, UITraitEnvironment, UIUserActivityRestoring, __UITraitChangeObservable
A container UI element that groups all the PayPal buttons (PayPal, PayLater, Credit). PaymentButtonContainer provides PayPal buttons with the ability to modify the PayPalButtonUI, PayPalCreditButtonUI, and PayLaterButtonUI, their attributes, and implement the PaymentButtonContainerDelegate
-
When the button’s eligibility status changes
Declaration
Swift
func button(_ button: PaymentButton, changedEligibilityStatus status: PaymentButtonEligibilityStatus)
Parameters
button
the PaymentButton instance that calls the delegate function
-
Update payLaterButtonUI the attributes programmatically and override the values.
Declaration
Swift
func configurePayLaterButton(with configuration: PayLaterButtonUIConfiguration)
-
Update payPalButtonUI the attributes programmatically and override the values.
Declaration
Swift
func configurePayPalButton(with configuration: PayPalButtonUIConfiguration)
-
Update payPalCreditButtonUI the attributes programmatically and override the values.
Declaration
Swift
func configurePayPalCreditButton(with configuration: PayPalCreditButtonUIConfiguration)
-
A closure provided to create an order based on an action item.
Declaration
Swift
var createOrder: CheckoutConfig.CreateOrderCallback?
-
init(payPalButtonUIConfiguration:
payPalCreditButtonUIConfiguration: payLaterButtonUIConfiguration: delegate: ) Initializer to configure the container button
Declaration
Swift
init(payPalButtonUIConfiguration: PayPalButtonUIConfiguration = .init(), payPalCreditButtonUIConfiguration: PayPalCreditButtonUIConfiguration = .init(), payLaterButtonUIConfiguration: PayLaterButtonUIConfiguration = .init(), delegate: PaymentButtonContainerDelegate? = nil)
-
A closure that gets executed when Checkout was approved.
Declaration
Swift
var onApproval: CheckoutConfig.ApprovalCallback?
-
When the button has finished.
Declaration
Swift
func onButtonFinish(_ button: PaymentButton)
Parameters
button
the PaymentButton instance that calls the delegate function
-
When the button starts before checkout process.
Declaration
Swift
func onButtonStart(_ button: PaymentButton)
Parameters
button
the PaymentButton instance that calls the delegate function
-
A closure that gets executed when Checkout was cancelled.
Declaration
Swift
var onCancel: CheckoutConfig.CancelCallback?
-
A closure that gets executed when Checkout fails.
Declaration
Swift
var onError: CheckoutConfig.ErrorCallback?
-
A closure that gets executed when shipping was changed.
Declaration
Swift
var onShippingChange: CheckoutConfig.ShippingChangeCallback?
-
Configures the callback closures.
Declaration
Swift
func setup(createOrder: CheckoutConfig.CreateOrderCallback? = nil, onApproval: CheckoutConfig.ApprovalCallback? = nil, onCancel: CheckoutConfig.CancelCallback? = nil, onError: CheckoutConfig.ErrorCallback? = nil, onShippingChange: CheckoutConfig.ShippingChangeCallback? = nil)
Parameters
createOrder
Callback to either supply an order token or order details to the Checkout SDK.
onApproval
This will be called when the transaction has been approved.
onCancel
This will be called when transaction has been cancelled.
onError
This will be called when an error cannot be recovered from, and the transaction has been cancelled.
onShippingChange
This will be called when the user selects a new shipping address or shipping method.
-
Returns a container that includes a single PayPal button only.
Declaration
Swift
static let withPayPalButtonOnly: PaymentButtonContainer