BUYViewController Class Reference
| Inherits from | UIViewController |
|---|---|
| Conforms to | PKPaymentAuthorizationViewControllerDelegate |
| Declared in | BUYViewController.h |
delegate
Register yourself as a BUYViewControllerDelegate to handle all errors, and status changes.
@property (nonatomic, weak) id<BUYViewControllerDelegate> delegateDeclared In
BUYViewController.h
client
Set the BUYClient using the provided initializer method initWithClient: or
if using Storyboards, override after Storyboard initialization.
@property (nonatomic, strong) BUYClient *clientDeclared In
BUYViewController.h
shop
The associated shop. setting this prior to displaying will prevent another network request
@property (nonatomic, strong) BUYShop *shopDeclared In
BUYViewController.h
merchantId
The merchant ID used for Apple Pay
@property (nonatomic, strong) NSString *merchantIdDeclared In
BUYViewController.h
isApplePayAvailable
Returns YES if the following conditions are met: - the device hardware is capable of using Apple Pay - the device has a payment card setup - the merchant ID has been set to use Apple Pay
@property (nonatomic, assign, readonly) BOOL isApplePayAvailableDeclared In
BUYViewController.h
allowApplePaySetup
If the merchantId is set and the device support Apple Pay but no credit card is present this allows the user to add a payment pass to the Wallet. The user is given the option to add a payment pass or continue with web checkout. Default is set to true. The Set Up Apple Pay button will, however still only show if [PKAddPaymentPassViewController canAddPaymentPass] returns true, merchantId is set and the app is running iOS 9.0 and above.
@property (nonatomic, assign) BOOL allowApplePaySetupDeclared In
BUYViewController.h
– canShowApplePaySetup
Whether the device is setup to show the Apple Pay setup sheet.
allowApplePaySetup must be set to YES, and the merchantId must also be set in addition to the
device settings for this method to return YES.
- (BOOL)canShowApplePaySetupReturn Value
YES if the Setup Apple Pay button should be shown
Declared In
BUYViewController.h
– shouldShowApplePayButton
Returns whether the Apple Pay button should be shown
- (BOOL)shouldShowApplePayButtonReturn Value
YES if isApplePayAvailable or canShowApplePaySetup returns YES
Declared In
BUYViewController.h
– shouldShowApplePaySetup
Returns whether to show the Apple Pay setup button in place of the Apple Pay buy button
- (BOOL)shouldShowApplePaySetupReturn Value
YES if isApplePayAvailable returns NO and canShowApplePaySetup returns YES
Declared In
BUYViewController.h
checkout
The current checkout object
@property (nonatomic, strong, readonly) BUYCheckout *checkoutDeclared In
BUYViewController.h
– loadShopWithCallback:
Loads the shop details
- (void)loadShopWithCallback:(void ( ^ ) ( BOOL , NSError *))blockParameters
block |
callback block called on completion |
|---|
Declared In
BUYViewController.h
supportedNetworks
The supported credit card payment networks. iOS 8.3: PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa. iOS 9.0: PKPaymentNetworkAmex, PKPaymentNetworkDiscover, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa.
@property (nonatomic, copy) NSArray *supportedNetworksDeclared In
BUYViewController.h
– paymentRequest
Override point to return a custom payment request
- (PKPaymentRequest *)paymentRequestReturn Value
a new payment request object
Discussion
The default merchantCapability is PKMerchantCapability3DS
Declared In
BUYViewController.h
– startApplePayCheckout:
Start an Apple Pay checkout with a BUYCheckout object. The checkout object will be created or updated on Shopify before proceeding with the Apple Pay checkout
- (void)startApplePayCheckout:(BUYCheckout *)checkoutParameters
checkout |
A BUYCheckout object to start an Apple Pay checkout with |
|---|
Declared In
BUYViewController.h
– startWebCheckout:
Start a responsive web checkout with a BUYCheckout object. This call will jump out to Safari and the shop’s responsive web checkout. The checkout object will be created or updated on Shopify before proceeding with the responsive web checkout
- (void)startWebCheckout:(BUYCheckout *)checkoutParameters
checkout |
A BUYCheckout object to start a web checkout with |
|---|
Declared In
BUYViewController.h
– checkoutCompleted:status:
Override this method if you want to perform any actions before information the delegate
- (void)checkoutCompleted:(BUYCheckout *)checkout status:(BUYStatus)statusParameters
checkout |
The completed BUYCheckout |
|---|---|
status |
The status of the BUYCheckout |
Declared In
BUYViewController.h