CheckoutConfig
@objc(PPCheckoutConfig)
@objcMembers
class CheckoutConfig
extension CheckoutConfig : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSCopying, NSObjectProtocol
Holds all the configuration values required by checkout experiences and checkout flows. Modified and provided by the merchant, to start the checkout flow desired.
-
The closure format for approvals
Declaration
Swift
typealias ApprovalCallback = (Approval) -> Void
-
The closure format for native to web authentication This is also known as a “step up”, as we are attempting to “step up” an auth session so a user will not need to login again
Declaration
Swift
typealias AuthStepUpCallback = (URI?, @escaping ((RedirectURI?, Error?) -> Void)) -> Void
-
The closure format for authentication
Declaration
Swift
typealias AuthenticationCallback = (@escaping (AuthToken?, Error?) -> Void) -> Void
-
The closure format for cancels
Declaration
Swift
typealias CancelCallback = () -> Void
-
The closure format for getting ECToken
Declaration
Swift
typealias CreateOrderCallback = (CreateOrderAction) -> Void
-
The closure format for errors
Declaration
Swift
typealias ErrorCallback = (ErrorInfo) -> Void
-
The closure format for logouts
Declaration
Swift
typealias LogoutCallback = () -> Void
-
The closure format for shipping changes
Declaration
Swift
typealias ShippingChangeCallback = (ShippingChange, ShippingChangeAction) -> Void
-
An object that allows us to set authentication traits like the merchant passed user email to streamline authentication
Declaration
Swift
var authConfig: AuthConfig
-
The clientID is a value that application engineers can receive after registering their application for use with PayPal’s services. Setup for this can be performed here: https://developer.paypal.com/developer/applications/create
Declaration
Swift
var clientID: String
-
Undocumented
Declaration
Swift
func copy(with zone: NSZone? = nil) -> Any
-
Called when creating order/requesting order ID from merchant createOrder passes a CreateOrderAction that can be used to either request the SDK to create an order or set the payToken with your order ID/pay token/EC token
Declaration
Swift
var createOrder: CheckoutConfig.CreateOrderCallback?
-
Currency code used for PaymentButton’s eligibility check
Declaration
Swift
var currencyCode: CurrencyCode?
-
Determines whether to show a button to copy debug payload into clipboard
Declaration
Swift
var debugEnabled: Bool
-
Two separate environments are usually set here, either
.sandbox
or.live
; seeEnvironment
documentation for more details on other environmentsDeclaration
Swift
var environment: Environment
-
An object that allows us to tweak the knobs and levers of the session to suit our development experience
Declaration
Swift
var environmentConfig: EnvironmentConfig
-
Undocumented
Declaration
Swift
init(clientID: String, createOrder: CheckoutConfig.CreateOrderCallback? = nil, onApprove: CheckoutConfig.ApprovalCallback? = nil, onShippingChange: CheckoutConfig.ShippingChangeCallback? = nil, onCancel: CheckoutConfig.CancelCallback? = nil, onError: CheckoutConfig.ErrorCallback? = nil, environment: Environment = .live)
-
Undocumented
Declaration
Swift
@available(*, deprecated, message: "`init(clientID:returnUrl: ...﹚` has been deprecated and will be removed in a future version of the SDK. Use `init(clientID: ...﹚` instead") convenience init(clientID: String, returnUrl: String, createOrder: CheckoutConfig.CreateOrderCallback? = nil, onApprove: CheckoutConfig.ApprovalCallback? = nil, onShippingChange: CheckoutConfig.ShippingChangeCallback? = nil, onCancel: CheckoutConfig.CancelCallback? = nil, onError: CheckoutConfig.ErrorCallback? = nil, environment: Environment = .live)
-
Optional merchant ID(s) for partners used for PaymentButton’s eligibility check. This is only used for partner, marketplaces, and cart solutions when they are acting on behalf of another merchant. For merchants acting on behalf of several merchants, pass each merchant ID into the array. For merchants action on behalf of a single merchant, you will only need to pass a single merchant ID into the array.
Declaration
Swift
var merchantIDs: [String]?
-
Called when the transaction has been approved.
Declaration
Swift
var onApprove: CheckoutConfig.ApprovalCallback?
-
Called when the authentication session needs to be passed from native to web
Declaration
Swift
var onAuthStepUp: CheckoutConfig.AuthStepUpCallback?
-
Undocumented
Declaration
Swift
var onAuthenticate: CheckoutConfig.AuthenticationCallback? { get set }
-
Called when the user has cancelled the transaction.
Declaration
Swift
var onCancel: CheckoutConfig.CancelCallback?
-
Called when an error cannot be recovered from, and the transaction has been cancelled
Declaration
Swift
var onError: CheckoutConfig.ErrorCallback?
-
Called if the user logs out. The transaction will allow the user to log in?
Declaration
Swift
var onLogout: CheckoutConfig.LogoutCallback?
-
Called when the user changes their shipping address from the paysheet
Declaration
Swift
var onShippingChange: CheckoutConfig.ShippingChangeCallback?
-
The EC-Token or Pay-Token or Order ID. This token type is generated in various ways by the merchant, in most cases, and sometimes by PayPal. Nonetheless, this token is required on the base configuration for normal operation.
Declaration
Swift
var payToken: String?
-
When the application needs to specify which view controller will be used to present the SDK’s experience. Failing this, the root most view controller currently being presented will be used.
Declaration
Swift
var presentingViewController: UIViewController?
-
Value to force a fallback to the Web Checkout experience instead of the Native experience.
Declaration
Swift
var showWebCheckout: Bool
-
Value sent to the payments web experience to determine what payment button should be rendered to the user in the case that the native SDK needs to fall back to the web based checkout flow.
This is a property to support the deprecated
payments/v1
web API. It is disregarded for both the native checkout flow and for users of thepayments/v2
web API.Declaration
Swift
var userAction: UserAction