Welcome to the Olo Pay SDK
PCI compliance is your responsibility but the Olo Pay SDK simplifies your process of maintaining PCI compliance by doing the heavy lifting of processing sensitive credit card data for you. See below for details on adding the SDK to your project and integrating it into your app to submit payments to Olo’s Ordering API.
Useful Links
Setup
Use one of the following guides to add the Olo Pay SDK to your Xcode project
Getting Started
The Olo Pay SDK helps with PCI compliance by creating a token to represent sensitive credit card data. The tokenized data is then used in your app to submit payments via Olo’s Ordering API. The Olo Pay SDK supports two different types of tokens: Payment Method and CVV Update tokens. Specific details about each token and how to use the SDK to generate them can be found below.
Payment Methods (new cards & digital wallets)
This approach is used for cards that have not previously been saved on file with Olo. This includes new credit cards and digital wallets. With this tokenization approach, an OPPaymentMethodProtocol is created that is then used to submit a basket with Olo’s Ordering API.
- Initialize the SDK. It is recommended to initialize on application startup, but it can be initialized anywhere in your app that is convenient. - Note - It is important to make sure the SDK is initialized prior to calling methods that generate payment methods 
- Choose how to create a payment method - Credit Card Input UI Control
- Add a payment input control to your app
See OPPaymentCardDetailsView. This will display an input control that contains input fields for all credit card fields in a single one-line component. This control provides the most flexibility for styling and customization.See OPPaymentCardDetailsForm. This will display an input control that breaks out each field into a larger form. This control has fewer options for styling and customization.
- Get an OPPaymentMethodParamsProtocolinstance
- Generate an OPPaymentMethodProtocolinstance
 
- Add a payment input control to your app
- Digital Wallet (Apple Pay)
- Create an Apple Pay button using Apple’s PKPaymentButtonclass
- When the user clicks the button, present the Apple Pay sheet
- Retrieve the OPPaymentMethodProtocolcreated byOPApplePayLauncher
 
- Create an Apple Pay button using Apple’s 
 
- Credit Card Input UI Control
- Submit the - OPPaymentMethodProtocoldata to the Basket Submit endpoint of Olo’s Ordering API
CVV Update Tokens (previously saved cards)
This approach is used for cards that have previously been saved on file with Olo, and you want to reverify the CVV of the saved card prior to submitting a basket and processing a payment. With this tokenization approach, an OPCvvUpdateToken is created that is then used to submit a basket with Olo’s Ordering API.
Note
It is up to you to determine when to verify the CVV on a saved card.
- Initialize the SDK. It is recommended to initialize on application startup, but it can be initialized anywhere in your app that is convenient. - See - OloPayApiInitializer.setup(with:completion:)- Note - It is important to make sure the SDK is initialized prior to calling methods that generate payment methods 
- Add the CVV control to your app - See - OPPaymentCardCvvView. This will display an input field for entering a CVV value. It can be styled and customized to meet your needs.
- Get an - OPCvvTokenParamsProtocolinstance
- Generate an - OPCvvUpdateTokenProtocolinstance
- Submit the - OPCvvUpdateTokenProtocoldata to the Basket Submit endpoint of Olo’s Ordering API