Pre-requisites
To ensure compatibility and optimal performance, your iOS project must meet the following minimum requirements:- iOS 14 or a later version
- Swift 5.0
- Xcode Version 14.0 or a later version
- A valid Sign Key (shared by Nayax, typically 16 characters).
- The associated Sign Key ID.
- The
securityTokenIdandsecurityTokenValue.
Integrate eCom SDK
The integration of eCom SDK consists of four steps:- Install the SDK.
- Handle URL callbacks.
- Initialize the SDK.
- Add Configuration Class.
Step 1: Install the SDK
To begin integrating the Nayax E-commerce functionality into your application, you’ll first need to set up access to the GitLab repository and then install the SDK as shown below.- The Nayax eCom SDK for iOS is hosted on Nayax’s private GitLab repository. The Nayax Team will provide you with a read-only access token. Configure git to use this token for authentication:
- Set up your Podfile with the following code:
Podfile
- Before installing, remove any previous integrations:
Terminal
- Now, install the pods.
Terminal
Step 2: Handle URL callbacks
Add the following URL Types entry to your application’sInfo.plist file. This configuration allows the SDK to handle callback URLs:
info.plist
SceneDelegate or AppDelegate to handle URL callbacks.
- If you are using a
SceneDelegate, add the following method: - If you are using an
AppDelegate(without scenes), implement this method:
Step 3: Initialize the SDK
Now initialize the SDK in your application, using theinitialize method. Add the following code in your AppDelegate (or your main application entry point):
Sign Key and IDNayax provides the
signId, signKey, securityTokenId, and securityTokenValue values during your onboarding. Ensure you handle these values securely.Swift
Step 4: Add Configuration Class
Add theNayaxEcomConfig struct to set the essential properties of the SDK. This table describes the parameters required to initialize the NayaxEcomConfig object.
Now the eCom SDK is integrated into your iOS application, and you can start creating payments through it. Refer to the Front-End Integration guide for more information on how this works.
See Also
Android SDK
Install, initialize, and configure the eCom SDK for Android apps.
Front-End Integration
Integrate a payment page into your app without handling payment processing directly.