VisaCheckoutSDK
@interface VisaCheckoutSDK : NSObject
The VisaCheckoutSDK
class is primarily used for configuring a manual checkout session
for invoking the Visa Checkout SDK directly.
-
Call this method to configure the Visa Checkout SDK using a
VisaProfile
object with customizable options.Declaration
Objective-C
+ (void)configureWithProfile:(VisaProfile *_Nonnull)profile result: (void (^_Nullable)(VisaCheckoutConfigStatus))result;
Swift
class func configure(profile: Profile, result: ((CheckoutConfigStatus) -> Void)? = nil)
Parameters
profile
The profile object that holds all of your profile customizations options.
result
The result of configuring the Visa Checkout SDK. This result will report any errors if there were issues initializing. It will also report a successful configuration, at which time the VisaCheckoutButton will be ready to interact with.
-
Call this method to configure the Visa Checkout SDK using the basic information required to launch the Visa Checkout user interface.
Declaration
Objective-C
+ (void)configureWithEnvironment:(VisaEnvironment)environment apiKey:(NSString *_Nonnull)apiKey profileName:(NSString *_Nullable)profileName result:(void (^_Nullable)(VisaCheckoutConfigStatus)) result;
Swift
class func configure(environment: Environment, apiKey: String, profileName: String?, result: ((CheckoutConfigStatus) -> Void)? = nil)
Parameters
environment
The context with which Visa Checkout accounts are managed. For instance,
sandbox
will not have actual Visa Checkout accounts and it is safe to use this environment for testing the Visa Checkout integration.apiKey
The API Key string given associated with your Visa Merchant account. This key will be dependent on which
VisaEnvironment
you are connecting to. For instance, you will have one API Key for theVisaEnvironmentSandbox
and a different API Key for theVisaEnvironmentProduction
.profileName
The profile name associated with your Visa Merchant account.
result
The result of configuring the Visa Checkout SDK. This result will report any errors if there were issues initializing. It will also report a successful configuration, at which time the VisaCheckoutButton will be ready to interact with.
-
A convenience method to manually launch the Visa Checkout user interface with the basic information needed to complete a transaction. If the Visa Checkout SDK is configured properly, this will immediately present the Visa Checkout user interface to the user.
Declaration
Objective-C
+ (void)checkoutWithTotal:(VisaCurrencyAmount *_Nonnull)total currency:(VisaCurrency)currency completion:(VisaCheckoutResultHandler _Nonnull)completion;
Swift
class func checkout(total: CurrencyAmount, currency: Currency, completion: @escaping VisaCheckoutResultHandler)
-
A method to manually launch the Visa Checkout user interface with the detailed
VisaPurchaseInfo
used to complete a transaction. If the Visa Checkout SDK is configured properly, this will immediately present the Visa Checkout user interface to the user.Declaration
Objective-C
+ (void)checkoutWithPurchaseInfo:(VisaPurchaseInfo *_Nonnull)purchaseInfo completion:(VisaCheckoutResultHandler _Nonnull)completion;
Swift
class func checkout(purchaseInfo: PurchaseInfo, completion: @escaping VisaCheckoutResultHandler)
-
A value indicating whether the Visa Checkout SDK is configured and ready to launch, whether launched manually or through a VisaCheckoutButton tap. The VisaCheckoutButton will be enabled when this property is true (and disabled when this property is false).
Declaration
Objective-C
+ (BOOL)isReady;
Swift
class func isReady() -> Bool
-
Used to configure Visa Checkout when manually invoking the SDK without using
VisaCheckoutButton
. Provide the onReady callback for storing aLaunchHandle
which can be invoked later when a user taps your custom button.Declaration
Objective-C
+ (void) configureManualCheckoutSessionWithProfile:(VisaProfile *_Nonnull)profile purchaseInfo: (VisaPurchaseInfo *_Nonnull)purchaseInfo presentingViewController: (UIViewController *_Nonnull)viewController onReady:(ManualCheckoutReadyHandler _Nonnull) onReady result:(VisaCheckoutResultHandler _Nonnull) result;
Swift
class func configureManualCheckoutSession(profile: Profile, purchaseInfo: PurchaseInfo, presenting viewController: UIViewController, onReady: @escaping ManualCheckoutReadyHandler, result: @escaping VisaCheckoutResultHandler)
-
Call this method to update payment information after original information passed to Visa has changed.
Declaration
Objective-C
+ (void)updatePaymentInfoWithParameters: (NSDictionary<NSString *, id> *_Nonnull)parameters;
Swift
class func updatePaymentInfo(parameters: [String : Any])
Parameters
parameters
A dictionary of key/value pairs that should include apiKey, callId, eventType, some amount key e.g. ‘total’, and currencyCode.
-
Use for campaign tracking promotions. Should be set in the application:openURL:options: UIApplicationDelegate method.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, class) NSURL *_Nullable marketingUrl;
Swift
class var marketingUrl: URL? { get set }