# Masterpass Checkout iOS SDK - v2.4
source: https://developer.mastercard.com/masterpass-merchant-integration-v7/documentation/previous-releases/masterpass-checkout-ios-sdk-v24/index.md

This page contains details of version 2.4 of the Masterpass Checkout iOS SDK.

## Overview {#overview}

The Masterpass Checkout iOS SDK is designed to enable you to add Masterpass checkout services into your native iOS apps quickly and easily.

You can integrate Masterpass for the "Standard Checkout" and "Express Checkout" flows, and can use the Masterpass Button or Payment method selection:  

* **Standard Checkout**: With Standard Checkout, your checkout screen will contain the Masterpass button, which when tapped will redirect the consumer to the Masterpass checkout experience. The checkout experience can be entirely within the app (in supported countries), or can be via web.
* **Payment Method**: The payment method flow is similar to the Standard Checkout flow, except that the consumer selects a payment method from a list before launching the Masterpass checkout experience from a standard UI element rather than an explicit Masterpass button.
* **Express Checkout**: With Express Checkout, consumers have the option to pair their payment details / wallets with you so that future checkouts are more seamless.

The steps needed to implement each of these are described below.

**Note: Express Checkout is not supported in the US and Canada. Please contact your regional representative for more information.**

## Onboarding {#onboarding}

To integrate with the SDK, you must provide:  

* A custom URL Scheme for the Standard Checkout app-to-web communication allowing a call back that deep links into your app (see the Apple developer information on [URL Schemes](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW1)).
* Merchant-specific CHECKOUTID and CARTID during Standard Checkout.
* Merchant-specific CHECKOUTID and USERID during Express Checkout.

To allow the Masterpass web checkout experience to return control to the app, add a callback URL to your Masterpass project on Mastercard Developers under Checkout Credentials.

***Note*** : During the Masterpass [merchant onboarding process](https://developer.mastercard.com/masterpass-merchant-onboarding/documentation/), the merchant developer must configure the Checkout Credentials on Mastercard Developers with the related **CHECKOUTID** and **Callback URL** so that the callback method (from Masterpass site to merchant app) can be triggered correctly (ensure you have set up a custom URL scheme for deep linking into your app as described above), and select "iOS" as the channel for the checkout ID.

In addition, note that before being enabled for Express Checkout, merchants must pass the Masterpass security vetting specifications. The following steps outline the way in which Express Checkout should work:  

1. The merchant must have a reliable method for identifying the consumer, preferably with login.
2. The consumer must log in to their merchant account and pair it with their Masterpass wallet account. This allows Masterpass to share the consumer's wallet data with the merchant during checkout.
3. The merchant requests a masked copy of the wallet data (known as precheckout data) from Masterpass to display on their site or app.
4. The consumer makes their payment and shipping selections on the merchant interface and clicks the Masterpass Button to confirm the order.
5. The merchant (or their Payment Service Provider) receives the full, unmasked payment details from the Masterpass wallet and uses that information to process the order.

## SDK download {#sdk-download}

The SDK is available for download from here:

|                                                                                     Zip file                                                                                      |                                                                                                                Contents                                                                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MCCMerchant.framework_sandbox_v241.zip](https://static.developer.mastercard.com/content/masterpass-merchant-integration-v7/uploads/mccmerchant.framework_sandbox_v241.zip)       | Merchant framework files - project files, storyboard files (nibs), header files, assets, sandbox access keys, etc. Version 2.4.1 Last updated 04 May 2018                                                                               |
| [MCCMerchant.framework_production_v241.zip](https://static.developer.mastercard.com/content/masterpass-merchant-integration-v7/uploads/mccmerchant.framework_production_v241.zip) | Merchant framework files - project files, storyboard files (nibs), header files, assets, production access keys, etc. Version 2.4.1 Last updated 04 May 2018                                                                            |
| [MerchantCheckoutApp_ios_v241.zip](https://static.developer.mastercard.com/content/masterpass-merchant-integration-v7/uploads/merchantcheckoutapp-ios-v241.zip)                   | Source code (Xcode project) for sample app - updated for 2.4.1 Last updated 04 May 2018 (This sample project has additional dependencies - a dependency file for Carthage is provided - see Dependency.md and Cartfile in the project). |

You will also need to download the following static libraries from version 5.4.1 of the [card.io SDK for iOS](https://github.com/card-io/card.io-iOS-SDK) from GitHub and add them to your project:

* libcardio.a
* libopencv_core.a
* libopencv_imgproc.a

## What's new in this release? {#whats-new-in-this-release}

The following changes and new features in version 2.4.x of the Masterpass Checkout iOS SDK, compared to 2017 R7 (v2.0.x):  

* The SDK now offers consumers seamless Masterpass registration, sign-in, and check-out, all from within your application, without sending them to an external website. The new flow uses native UI elements contained within the SDK to provide an [embedded native experience](https://developer.mastercard.com/masterpass-merchant-integration-v7/documentation/previous-releases/masterpass-checkout-ios-sdk-v24/(/documentation/merchant-embedded-native-experience/)/index.md) and will be invoked instead of the previous web based UI flow at checkout (in supported countries).

* The native experience provides other enhancements:

* Support for biometric (fingerprint) authentication during checkout (no additional coding is needed). Note Face ID is supported instead of fingerprint authentication (TouchID) on the iphone X.

* Support for 3D Secure (if you have specified support for 3DS during onboarding then no additional coding is needed in the mobile app).

* Support for international phone numbers during user sign in.

* Support for payment card management.

* Payment method support.

* Ability for consumer to sign out of embedded native experience.

* Streamlined registration flow.

* Enhancements to Express Pairing within the embedded native experience.

Note that the embedded native experience will only be available in certain countries initially. The SDK will communicate with the Masterpass server for the country concerned and if supported use the new native UI elements. If the app is running in a country where the native experience is not yet supported (as indicated by the Masterpass server concerned) then the app will fall back to using the web checkout flow as before. As long as your app is built using 2.4.0 or later then this will happen automatically and as new countries add support for the new UI the app will change behavior as requried.

The new native experience will not of course be available to any app built using an older version of the SDK as the UI elements and logic to decide whether to use them or not is built into the post 2.4 SDK.

**Changes in 2.4.1**

This increment includes the following:

* Analytics is now off by default - the MCCConfiguration.enableAnalytics property now defaults to false.
* The MCCCheckoutRequest.merchantName property is deprecated and should no longer be used. Use the MCCConfiguration.merchantName property during initialisation to set the merchant name.
* Other minor bug fixes to initialisation code.

### Other releases {#other-releases}

For details of the previous supported release, see the [Masterpass Checkout iOS SDK v2.0](https://developer.mastercard.com/masterpass-merchant-integration-v7/documentation/previous-releases/masterpass-checkout-ios-sdk-v2/index.md) page.  

For the latest realease, see the [Masterpass Checkout iOS SDK v2.5](https://developer.mastercard.com/masterpass-merchant-integration-v7/documentation/previous-releases/masterpass-checkout-ios-sdk-v25/index.md) page.

## Migration notes {#migration-notes}

The following important changes to the SDK in this release will require you to make code changes in your merchant app:  

* Additional configuration settings must be specified during initialization - see the Initialize the SDK section below for details of how to set up the MCCConfiguration correctly before passing it to MCCMerchant.initializeSDK().

## Integration {#integration}

This integration tutorial goes through the typical steps involved to demonstrate how you can add Masterpass to your iOS merchant app (the code samples have been tested in Xcode 9.2 with version 2.4.1 of the Masterpass iOS SDK).

### 1. Add the SDK to your application {#1-add-the-sdk-to-your-application}

In your Xcode project, select your target and add **MCCMerchant.framework** to:  

* General tab: **Linked Frameworks and Libraries** and **Embedded Binaries**
* Build Phases tab:**Link Binary with Libraries**

You can drag the framework file into each area or use the + buttons, as shown below.

![alt text](https://static.developer.mastercard.com/content/masterpass-merchant-integration-v7/documentation/images/mccmerchant233addingmerchantsdk.png)

Xcode automatically adds the framework to **Embed Frameworks** , in the Build Phases tab. Ensure that **Code Sign On Copy** is checked for the framework.

### 2. Initialize the SDK {#2-initialize-the-sdk}

To initialize the SDK, you must provide an **MCCConfiguration** object to the SDK initializing class method, which returns a singleton instance of the SDK. Note that while **merchantUrlScheme, merchantUniversalLink, merchantName, merchantUserId** and **locale** are required for the SDK, all the other properties are optional.

**Sample initialization code (swift 4.0)**
* Swift

```Swift
// Create SDK configuration object

let configuration: MCCConfiguration = MCCConfiguration()

configuration.merchantUrlScheme = "YourURLSchemeName://"  //place your own custom URL scheme here
configuration.merchantName = "Merchant App"
configuration.merchantUniversalLink = "https://merchant.com"
configuration.merchantUserId = "123"
configuration.locale = NSLocale.current
configuration.merchantUserDetail = MCCUserDetail()
configuration.merchantUserDetail?.userId = "123"
configuration.expressCheckoutEnabled = true


// Start SDK initialization

        MCCMerchant.initializeSDK( with: configuration) { (status:[AnyHashable : Any], error: Error?) -> Void in

            var responseDict: NSDictionary
            let responseKeys: [String] = ["status"]

            let statusDictionary = status as? [String:AnyObject]
            let statusCode: Int = (statusDictionary?[kInitializeStateKey]?.intValue)!

            switch (MCCInitializationState(rawValue: statusCode)!) {

            case .started:
                //Started
                //Here you can perform other custom UI tasks like showing an activity indicator.               
                break

            case .completed:
                //Complete
                //Here you can hide the activity indicator and add call the getMPButton or create your own button
                self.getMasterPassButton()
                break

            case .fail:
                //Error
                //On error, reset any custom UI / animations (e.g. hide the activity indicator) and if the MPButton was previously shown, hide it.
                //Inform the user an error has occurred.
                if (self.masterPassButton != nil) {
                    self.masterPassButton?.removeFromSuperview()
                }
                break
            }
        }

```

The MCCConfiguration class defines the settings you wish to configure the SDK with, such as the locale, whether analytics are enabled, and so on.

|     **Parameter**      |                                                                                                                                    **Description**                                                                                                                                     |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| enableAnalytics        | If true then the SDK will collect data for analytics purposes.                                                                                                                                                                                                                         |
| locale                 | The application locale. Note that this is used by the SDK when deciding whether to use the native checkout experience or the web checkout experience (as initially not all regions will support native checkout).                                                                      |
| merchantUrlScheme      | The merchant URL scheme as redirect address. Only the protocol part of the URLScheme is expected, the framework will do necessary formatting as required. For example, in "<http://mydomain.com>", "http" is the protocol, the framework will add "://" etc... while using the scheme. |
| merchantUniversalLink  | Merchant Universal Link: for app to app transition.                                                                                                                                                                                                                                    |
| merchantName           | Merchant name to be used in checkout UI.                                                                                                                                                                                                                                               |
| merchantUserId         | Unique id for user. This will be used for express checkout pairing.                                                                                                                                                                                                                    |
| expressCheckoutEnabled | Boolean flag specifying whether the app is enabled for express checkout.                                                                                                                                                                                                               |

### 3.Implement Standard Checkout {#3implement-standard-checkout}

To start the Standard Checkout process, there is typically a checkout view controller subclass (such as a table view) that shows the items being purchased and other transaction details. Add the Masterpass Button to this checkout view.

#### 3a. Set up your Checkout View Controller with MCCMasterpassButton {#3a-set-up-your-checkout-view-controller-with-mccmasterpassbutton}

To display the Masterpass Button use the **getMasterPassButton** method within the **MCCMerchant** class (this method will create an **MCCMasterpassButton** object if the library is initialized, otherwise it returns nil).
* Swift

```Swift
//Checkout UI Page

class CheckOutVC: UIViewController {

    var masterPassButton : MCCMasterpassButton?      
    self.masterPassButton = self.getMasterPassButton()

    // Other custom implementation for your view controller ...
}
```

#### 3b. Display the Masterpass Button {#3b-display-the-masterpass-button}

To display the Masterpass Button, the **getMasterPassButton()** function wraps the call to the SDK.
* Swift

```Swift
// MARK: Buy with Masterpass button
func getMasterPassButton() -> MCCMasterpassButton? {
    let masterpassButton = MCCMerchant.getMasterPassButton(self)
    return masterpassButton
}
```

#### 3c. Declare merchant delegate {#3c-declare-merchant-delegate}

Add the **MCCMerchantDelegate** object to your checkout class (MerchantCheckoutManager) declaration line:
* Swift

```Swift
class MerchantCheckoutManager:NSObject, MCCMerchantDelegate {

    //Checkout Logic ...
}
```

<br />

#### 3d. Implement the merchant delegate method {#3d-implement-the-merchant-delegate-method}

Add the delegate method, providing the **CHECKOUTID** and **CARTID** variables for your merchant app.
* Swift

```Swift
//MerchantCheckoutManager.swift

    // MARK: Build up your checkout request here
    func didGetCheckoutRequest(_ completionBlock: ((MCCCheckoutRequest) -> Bool)?) {

       let transactionRequest = MCCCheckoutRequest()

       //check merchant on-boarding process for checkoutId & cartID
       transactionRequest.checkoutId = {ADD_YOUR_CHECKOUTID}
       transactionRequest.cartId = {ADD_YOUR_CARTID}

       //amount and currency - note that NSDecimal values are used so $9.99 would be 9.99 USD
       var total = NSDecimalNumber(string:"75")        // this will be $75
       let amount:MCCAmount = MCCAmount()
       amount.total = total
       amount.currencyCode = "USD"
       transactionRequest.amount = amount

       //network type (allowed csrds)
       var allowedNetworkTypesSet = Set<MCCCardType>()
       allowedNetworkTypesSet.insert(MCCCardType(type: MCCCard.MASTER)!);
       transactionRequest.allowedCardTypes = allowedNetworkTypesSet

       //cryptogram type (DSRP,
       transactionRequest.cryptogramType =  MCCCryptogram(type: MCCCryptogramType.UCAF)

       //shipping required
       transactionRequest.isShippingRequired = true

       completionBlock(transactionRequest)
    }

    // MARK: delegate method to handle the checkout error
    func didReceiveCheckoutError(_ error: Error) {
        let errorObject = error as NSError
        if (errorObject.domain == MCCMerchantSDKTransactionErrorDomain) {
            //Do something with error
            self.showErrorDialogue(error.localizedDescription, action: nil)
        } else {
            self.showError(errorObject)
        }
    }

    //MARK: delegate method to handle the checkout response
    func didFinishCheckout(_ checkoutResponse: MCCCheckoutResponse) {
        if (responseInfo != nil) {
            let checkoutType : MCCResponseType = responseInfo!.responseType
            if (checkoutType == .appCheckout) {
                //embedded checkout experience
            } else if (checkoutType == .webCheckout){
                //web checkout
            }
        }
    }

```

#### 3e. Perform Standard Checkout {#3e-perform-standard-checkout}

Clicking the Masterpass button will trigger the merchant embedded checkout experience, or alternatively trigger the Safari to web checkout experience (depending on whether the embedded experience is supported in the locale in which the app is running - the SDK will communicate with the Masterpass server concerned behind the scenes and initiate the appropriate flow / experience).

To build the checkout request details create an MCCCheckoutRequest object and set the checkoutId, cartId, amount, allowsCardTypes, cryptogramType, and isShippingRequired properties as required in the didGetCheckoutRequest function within the MCCMerchantDelegate (see the merchant delegate code sample above).

#### 3f. Transaction completion {#3f-transaction-completion}

##### 3f.I. Configure CustomURL Scheme callback (web checkout) {#3fi-configure-customurl-scheme-callback-web-checkout}

When the wallet returns the transaction response data (payment information), the merchant app will be brought to the foreground. Web checkout will use the merchant custom URL Scheme but the merchant embedded experience will not. This event needs to be handled in the **application:open url:sourceApplication** of the app delegate for the merchant app by invoking the **handleMasterpassResponse** method of the SDK.  
* Swift

```Swift
    //AppDelegate.swift
    func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        return MCCMerchant.handleMasterpassResponse(url.absoluteString, delegate: self)
    }
```

<br />

**Note** : The URL callback method uses the **CHECKOUTID** and **URL Scheme** configured in the Masterpass Merchant Portal during onboarding. As shown in section 3d, the **didFinishCheckout** delegate method will be triggered when the correct response is generated. You need to handle the response correctly inside this delegate method.

##### 3f .II. Transaction completion delegate method {#3f-ii-transaction-completion-delegate-method}

As shown in the example in 3d, your didFinishCheckoutDelegate method needs to handle the response appropriately:
* Swift

```Swift
    //MARK: delegate method to handle the checkout response here
    func didFinishCheckout(_ checkoutResponse: MCCCheckoutResponse) {
        if (responseInfo != nil) {
            let checkoutType : MCCResponseType = responseInfo!.responseType
            if (checkoutType == .appCheckout) {
                //embedded checkout experience
            } else if (checkoutType == .webCheckout){
                //web checkout
            }
        }
    }
```

<br />

### 4. Implement Express Checkout {#4-implement-express-checkout}

To enable the Express Checkout experience, the SDK is used to retrieve the **pairingTransactionId** with class method **pairingwithCheckout(isCheckout, merchantDelegate)** provided. The delegate methods need to be slightly altered based on the request.

#### 4a. Set up button with API {#4a-set-up-button-with-api}

The **pairingWithCheckoutClicked** function wraps the call to the Express Checkout API.

***Setup button with API***
* Swift

```Swift
    @IBAction func pairingWithCheckoutClicked(_ sender: Any) {
         //MARK: trigger pairing with/without checkout
        MCCMerchant.pairing(withCheckout: _isCheckout, merchantDelegate: MerchantCheckoutManager.sharedInstance)
    }
```

<br />

#### 4b. Pairing with or without checkout {#4b-pairing-with-or-without-checkout}

Add the delegate method, providing the **USERID** and **CHECKOUTID** variables.

The following example code shows the additional changes needed:

***Pairing with or without checkout***   
* Swift

```Swift
//MerchantCheckoutManager.swift

    // MARK: Build up your checkout request here
    func didGetCheckoutRequest(_ completionBlock: ((MCCCheckoutRequest) -> Bool)?) {

       let transactionRequest = MCCCheckoutRequest()
       transactionRequest.userId = {ADD_YOUR_USERID}

       if (self.isPairingOnly) {
            //Pairing only request needs userId & checkoutID
            transactionRequest.checkoutId = {ADD_YOUR_CHECKOUTID}
            return transactionRequest
        }

       //... follow the same logic as web checkout

       completionBlock(transactionRequest)
    }

    //MARK: delegate method to handle the checkout response here
    func didFinishCheckout(_ checkoutResponse: MCCCheckoutResponse) {
        if (responseInfo != nil) {
            let webCheckoutType : MCCResponseType = responseInfo!.responseType
            if (webCheckoutType == .webCheckout){
                //analyze response
            } else {
                //add pairing response
                if((responseInfo?.pairingTransactionID) != nil){
                    //retrieve pairingTransactionID
                }

            }
        }
    }
```

#### 4c. Complete the implementation {#4c-complete-the-implementation}

You can read more about [Express Checkout](https://developer.mastercard.com/documentation/masterpass-merchant-integration-v7#express-checkout) (.external-link rel=external-link target=external-link data-ext-link-init=external-link style=external-link) in the main [Masterpass Merchant Integration](https://developer.mastercard.com/documentation/masterpass-merchant-integration-v7) (.external-link rel=external-link target=external-link data-ext-link-init=external-link style=external-link) page.

### 5. Implement Payment Method Checkout {#5-implement-payment-method-checkout}

Payment method checkout is similar to standard checkout but differs in that the payment method must first be set up before it can later be invoked. This allows a more consistent UI for those merchants who wish to allow consumers to select their preferred payment method prior to invoking payment via a generic UI element (rather than having to provide the Masterpass Button to invoke payment via Masterpass and another UI element to invoke payment via other services). Note that the UI providing the choice to the consumer must follow the Masterpass branding guidelines.

#### 5a. Set up payment method {#5a-set-up-payment-method}

To set up a payment method, first call the add masterpass payment method API to retrieve the payment method object. It is the merchant's responsibility to save this MCCPaymentMethod object which will be used when payment method checkout being called. Also don't forget to declare your merchant delegate (as shown for Standard Checkout in step 3c).  
* Swift

```Swift
    func addMasterpassPaymentMethod() {
         //set the delegate
        MCCMerchant.addMasterpassPaymentMethod(self) {(paymentMethod: MCCPaymentMethod? ,error: Error?) -> (Void) in

            if (error != nil) {
                //error
            }
            else {

                //store data
                let archivedData = NSKeyedArchiver.archivedData(withRootObject: paymentMethod)
                UserDefaults.standard.set(archivedData, forKey: "userAddedPaymentMethod")

                //store pairingTransactionId for express checkout if paired during payment method set up
                DataManager.storeValue(value: paymentMethod?.pairingTransactionID, key: kPairingTransactionIdRequest)
            }
        }
    }
```

Next, implement a delegate method to provide necessary information used during payment method setup:
* Swift

```Swift
func didGetAddPaymentMethodRequest(_ completionBlock: ((Set<MCCCardType>,String) -> Void)?) {

        //provide network type
       var allowedNetworkTypesSet = Set<MCCCardType>()
       allowedNetworkTypesSet.insert(MCCCardType(type: MCCCard.MASTER)!);

       //provide checkout id
       var checkoutId = {ADD_YOUR_CHECKOUTID}       
       completionBlock!(allowedNetworkTypesSet, checkoutId)
}
```

Now payment method set up should be ready, a MCCPaymentMethod object will be returned once the consumer successfully set up the payment method via our SDK.

#### 5b. Check out with payment method {#5b-check-out-with-payment-method}

To checkout with payment method, call the payment method checkout API provided:
* Swift

```Swift
func doCheckoutWithPaymentMethod () {
    //set the delegate
   MCCMerchant.paymentMethodCheckout(self)
}
```

<br />

Two delegate methods need to be implemented before payment method checkout: one to load the payment method you want to check out with and the other to provide the checkout request (like standard checkout 3d).
* Swift

```Swift
func loadPaymentMethod() -> MCCPaymentMethod {
        if let data = UserDefaults.standard.data(forKey: "userAddedPaymentMethods") {
            let storePaymentMethods = (NSKeyedUnarchiver.unarchiveObject(with: data) as? [MCCPaymentMethod])!
            //return cached MCCPaymentMethod object
            return storePaymentMethod[0]
        }else{
            //error
        }
        //return a new instance if not cached
        return MCCPaymentMethod()  
}


func didGetCheckoutRequest(_ completionBlock: ((MCCCheckoutRequest) -> Bool)?) {

      //build up the checkout request just like standard checkout        
      completionBlock!(self.checkoutRequest())
}

```

#### 5c. Transaction completion {#5c-transaction-completion}

Follow standard checkout transaction completion instruction 3f above to finish the transaction completion part.

## Appendix {#appendix}

### MCCCheckoutRequest object details {#mcccheckoutrequest-object-details}

The following table lists the field details for the MasterpassCheckoutRequest object.

This represents the details required by a single Masterpass transaction.

|                 Field                  |                                                                                                                                                                                             Description                                                                                                                                                                                             |
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| MCCCheckoutRequest                     |                                                                                                                                                                                                                                                                                                                                                                                                     |
| MCCCheckoutRequest.amount              | Contains the amount of the transaction and the currency code.**Data Type:** MCCAmount object**Required:** Yes                                                                                                                                                                                                                                                                                       |
| MCCCheckoutRequest.checkoutId          | An ID provided to a merchant partner during onboarding.**Data Type:** NSString**Required:** Yes                                                                                                                                                                                                                                                                                                     |
| MCCCheckoutRequest.cartId              | An ID provided by a merchant partner to Masterpass to indicate a unique transaction.**Data Type:** NSString**Required:** Yes                                                                                                                                                                                                                                                                        |
| MCCCheckoutRequest.allowedCardTypes    | This property constrains the merchant supported payment network types that the user can select for transaction being performed. MasterCard, Visa etc...**Data Type:** Set of MCCCardType (NS_ENUM, one of: MCCCardMASTER, MCCCardVISA, MCCCardAMEX, MCCCardDISCOVER, MCCCardDINERS)**Required:** Yes                                                                                                |
| MCCCheckoutRequest.shippingProfileId   | Constrains the locations that the merchant can ship the product. If null, 'default' profile id will be used**Data Type:** NSString**Required:** No                                                                                                                                                                                                                                                  |
| MCCCheckoutRequest.isShippingRequired  | Indicates if this transaction requires Shipping or not. If false, the wallet will not display any shipping addresses for the user to select.**Data Type:** BOOL**Required:** No                                                                                                                                                                                                                     |
| MCCCheckoutRequest.cryptogramType      | Contains the parameters to indicate the support of tokenized card details**Data Type:** MCCCryptogram**Required:** No                                                                                                                                                                                                                                                                               |
| MCCCheckoutRequest.userId              | An ID provided by a merchant to Masterpass for express checkout pairing purpose.**Data Type:** NSString**Required:** No                                                                                                                                                                                                                                                                             |
| MCCCheckoutRequest.merchantLocale      | The locale supported by the merchant.**Data Type:** String**Required:** No                                                                                                                                                                                                                                                                                                                          |
| MCCCheckoutRequest.suppress3DS         | Used to describe the state of 3DS required.**Data Type:** BOOL**Required:** No                                                                                                                                                                                                                                                                                                                      |
| MCCCheckoutRequest.unpredictableNumber | Random number that can be generated by the merchant for use generating the DSRP cryptogram - this is the recommended option. If no unpredictable number is passed, Mastercard will generate an unpredictableNumber for the transaction. **Data Type:** NSString**Required:** No                                                                                                                     |
| MCCCheckoutRequest.extentionPoint      | Reserved for future use. This property is currently not used but is provided as a mechanism to enable additional optional data to be passed by the application in future without requiring a new major version of the SDK or web API service. Any such extensions will be optional, and any unknown elements in the data will be ignored by Masterpass. **Data Type:** NSDictionary**Required:** No |
| MCCCheckoutRequest.merchantName        | The property used to describe the merchant name. DEPRECATED - as of v2.4.1 this property is deprecated and should not be used. The merchant name should instead be defined in the MCCConfiguration class.**Data Type:** NSString**Required:** No                                                                                                                                                    |
|                                        |                                                                                                                                                                                                                                                                                                                                                                                                     |
| MCCAmount                              |                                                                                                                                                                                                                                                                                                                                                                                                     |
| MCCAmount.total                        | Total to be used for transaction. The value may have precision up to 2 decimal places. For example, 12.55 is a valid amount (representing $12.55 if USD is the currency), while 12.456 will not be considered as valid total.**Data Type:** NSDecimalNumber**Required:** Yes                                                                                                                        |
| MCCAmount.currencyCode                 | A string representing currency code in which the amount is being charged. The value should be following ISO 4217 standard.**Data Type:** NSString**Required:** Yes                                                                                                                                                                                                                                  |
|                                        |                                                                                                                                                                                                                                                                                                                                                                                                     |
| MCCCryptogram                          |                                                                                                                                                                                                                                                                                                                                                                                                     |
| MCCCryptogram.cryptogramType           | Contains the parameters to indicate the support of tokenized Mastercard or Visa card details.**Data Type:** MCCCryptogramType object (NS_ENUM, one of: MCCCryptogramICC, MCCCryptogramUCAF, MCCCryptogramUCAFAndICC, MCCCryptogramNone)**Required:** Yes                                                                                                                                            |
| MCCCryptogram.cryptogramIdentifier     | Cryptogram id.**Data Type:** NSString**Required:** Yes                                                                                                                                                                                                                                                                                                                                              |

For more information about tokenization, see the [Masterpass DSRP and Tokenization](https://developer.mastercard.com/masterpass-merchant-integration-v7/page/masterpass-dsrp-and-tokenization/index.md) (data-cms-id=undefined data-cms-href=undefined) guide.

### Error code details {#error-code-details}

|             \*\* Error\*\*              |                      \*\* Description\*\*                      |
|-----------------------------------------|----------------------------------------------------------------|
| MCCMerchantSDKInitializationErrorDomain | The domain for errors originating from SDK initialization.     |
| MCCMerchantErrorDomain                  | The domain for errors originating from transaction processing. |
| MCCMerchantErrorDomain                  | The domain for errors originating from Exception.              |

