Secure Remote Commerce

Client-Side Implementation

Availability
Masterpass, Amex Express Checkout, and Visa Checkout have been replaced with the latest unified checkout experience offered through Visa known as Secure Remote Commerce. If you were previously using Masterpass or Amex Express Checkout, you will need to integrate with SRC. If you were using Visa Checkout, you do not have to change your integration as SRC is an updated version of Visa Checkout. As such, you may see Visa Checkout referenced elsewhere in our documentation.

SRC is currently in a limited release to eligible merchants, and the API is subject to change. It is available in iOS v4+ and JavaScript v3+.

Contact us to request access to the release.

InstallationAnchorIcon

BraintreeAnchorIcon

Important
The SSL certificates for all Braintree SDKs are set to expire by June 30, 2025. This will impact existing versions of the SDK in published versions of your app. To reduce the impact, upgrade the iOS SDK to version 6.17.0+ for the new SSL certifications..

If you do not decommission your app versions that include the older SDK versions or force upgrade your app with the updated certificates by the expiration date, 100% of your customer traffic will fail.
In your `Podfile`, include `BraintreeVisaCheckout`:
  1. Ruby
pod 'BraintreeVisaCheckout'

SRCAnchorIcon

The Braintree Visa Checkout SDK depends on and includes VisaCheckoutSDK v7.2.0. It requires Xcode 12.0. .

Important
You are not required to sign up with SRC. If you already have, do not initialize the SRC component with your own SRC credentials. These details will be handled internally by the Braintree SDK.

InitializationAnchorIcon

  1. Configure the VisaCheckoutSDK when your app launches:.

    1. Swift
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        VisaCheckoutSDK.configure()
        return true
    }
  2. Instantiate a BTAPIClient using the appropriate authorization
  3. Instantiate a BTVisaCheckoutClient:.

    1. Swift
    let client = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")!
    self.visaCheckoutClient = BTVisaCheckoutClient(apiClient: client)
  4. Create a Profile using the BTVisaCheckoutClient:.

    1. Swift
    self.visaCheckoutClient.createProfile() { (profile, error) in
        guard let profile = profile as? Profile else {
            print("Failed to create Visa profile: (error!)")
            return;
        }
    
        // Customize the Visa Checkout experience
        profile.displayName = "My Merchant Name"
    }

Generating a client tokenAnchorIcon

If you choose to use a client token, you must generate it on the server and make it accessible to your client..

To use a merchant account ID other than your default, specify the MerchantAccountId when generating the client token. This merchant account ID must match the merchant account ID used to create the transaction.

Specifying payment detailsAnchorIcon

Note
See Visa Checkout's user interface guidelines for more information on UI and branding requirements.
  1. Create a PurchaseInfo object, passing in an amount and currency
  2. Specify additional payment details on this object, e.g. description, subtotal, shipping
Here is an example:
  1. Swift
let total = CurrencyAmount(string: "1.00")
let purchaseInfo = PurchaseInfo(total: total, currency: .usd)

// Customize the purchase info
purchaseInfo.customDescription = "My Description"

TokenizingAnchorIcon

  1. Create a VisaCheckoutButton and set it up
  2. Call visaCheckoutClient.tokenize(CheckoutResult) with a CheckoutResult
  3. We tokenize the result and return a VisaCheckoutNonce in the completion block
Here is an example:
  1. Swift
let checkoutButton = VisaCheckoutButton.init(frame: CGRect.init(x: 0, y: 0, width: 213, height: 47))
self.view.addSubview(checkoutButton)

checkoutButton.onCheckout(profile: profile, purchaseInfo: purchaseInfo, presenting: self, onReady: { (launchHandler) in
    self.launchHandler = launchHandler
}, onButtonTapped: {
    self.launchHandler()
}, completion: { (result) in
    self.client.tokenize(result, completion: { (tokenizedVisaCheckoutCard, error) in
      if error != nil {
          print("Error tokenizing Visa Checkout card: %@", error.localizedDescription)
      } else if tokenizedVisaCheckoutCard != nil {
          // Send this nonce to your server, and create a transaction there.
          let nonce = tokenizedVisaCheckoutCard.nonce

          // Access Visa Checkout properties from this `VisaCheckoutCardNonce`, e.g.
          let shippingAddress = tokenizedVisaCheckoutCard.shippingAddress
      } else {
          // User canceled.
      }
    })
})

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more