VisaCheckoutButton
@interface VisaCheckoutButton : UIView
This is the main point of interaction for your customers. The user
will tap this button in order to initiate the Visa Checkout SDK’s
user interface. A VisaCheckoutButton can have a VisaCheckoutButtonStyle
for different visual rendering options.
You can use the onCheckout(profile:purchaseInfo:presenting:completion:)
method to provide information that
is used when the button is tapped by the user.
-
The
CheckoutButtonStyle
to use for rendering. This is used to contrast with lighter or darker background superviews.Declaration
Objective-C
@property (assign, readwrite, nonatomic) VisaCheckoutButtonStyle style;
Swift
var style: CheckoutButtonStyle { get set }
-
Undocumented
Declaration
Objective-C
- (void)onCheckoutWithPurchaseInfo:(VisaPurchaseInfo * _Nonnull)purchaseInfo completion:(VisaCheckoutResultHandler _Nonnull)completion DEPRECATED_MSG_ATTRIBUTE("Please use onCheckout(profile:purchaseInfo:presenting:completion:) instead") NS_SWIFT_NAME(onCheckout(purchaseInfo:completion:));
Swift
func onCheckout(purchaseInfo: PurchaseInfo, completion: @escaping VisaCheckoutResultHandler)
-
A method to set the purchase information, presenting view controller and the completion handler for Visa Checkout. For the presenting view controller, provide an instance of UIViewController that will be used to present Visa Checkout modally. When the Visa Checkout button is clicked by a user, VisaCheckout will use this view controller to call present(_:animated:completion:). This property is required to launch Visa Checkout. The UIViewController instance must be in your view hierarchy and must not already have a presentingViewController set because any additional calls to present(_:animated:completion:) will be ignored by UIKit. Typically, you will set this value to the view controller that contains your VisaCheckoutButton.
Declaration
Objective-C
- (void)onCheckoutWithProfile:(VisaProfile *_Nonnull)profile purchaseInfo:(VisaPurchaseInfo *_Nonnull)purchaseInfo presentingViewController: (UIViewController *_Nonnull)presentingViewController completion:(VisaCheckoutResultHandler _Nullable)completion;
Swift
func onCheckout(profile: Profile, purchaseInfo: PurchaseInfo, presenting presentingViewController: UIViewController, completion: VisaCheckoutResultHandler? = nil)
Parameters
purchaseInfo
The purchase information with various settings used to customize the Checkout experience.
presentingViewController
Instance of UIViewController that will be used to present Visa Checkout modally.
completion
A completion handler that is called when
VisaCheckout
is finished and has return context back to your app. -
Undocumented
Declaration
Objective-C
- (void)onCheckoutWithTotal:(VisaCurrencyAmount * _Nonnull)total currency:(VisaCurrency)currency completion:(void (^ _Nonnull)(VisaCheckoutResult * _Nonnull))completion DEPRECATED_MSG_ATTRIBUTE("Please use onCheckout(profile:purchaseInfo:presenting:completion:) instead") NS_SWIFT_NAME(onCheckout(total:currency:completion:));
Swift
func onCheckout(total: CurrencyAmount, currency: Currency, completion: @escaping (CheckoutResult) -> Void)
-
This returns card art for recognized returning users. Otherwise, this returns the mini button image.
Declaration
Objective-C
+ (UIImage *_Nonnull)miniButtonImage;
Swift
class func miniButtonImage() -> UIImage
-
A value indicating whether the Visa Checkout SDK is configured and ready to launch, The VisaCheckoutButton will be enabled when this property is true (and disabled when this property is false).
Declaration
Objective-C
@property (readonly, nonatomic) BOOL isReady;
Swift
var isReady: Bool { get }
-
Convenience property for Interface Builder to set the value of VisaCheckoutButtonStyleStandard. Default value is true.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL standardStyle;
Swift
var standardStyle: Bool { get set }
-
The enableAnimation is used to turn on or off the animation on the button.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL enableAnimation;
Swift
var enableAnimation: Bool { get set }