Functions
The SDK currently provides a single function, serving as the entry point for the merchant's application.
Additionally, callbacks are provided and must be handled by the parent application. These callbacks are described here.
The Checkout.init
function is responsible for initializing the checkout process and configuring the necessary settings for the Checkout SDK.
It must be called once by the parent application and provided with a set of configuration fields that define all the required options for the checkout process.
When Checkout.init
is invoked, the SDK automatically sets up the essential components, including:
Generating a form for the customer to enter their payment details.
Handling communication with Ottu's servers to process the payment.
This function returns a View
object, which is a native iOS UI component. It can be embedded within any ViewController
instance in the application.
The merchant_id
specifies the Ottu merchant domain and must be set to the root domain of the Ottu account, excluding the "https://" or "http://" prefix.
For example, if the Ottu URL is https://example.ottu.com
, then the corresponding merchant_id
is example.ottu.com
.
This parameter is used to link the checkout process to the appropriate Ottu merchant account.
The apiKey
is the Ottu API public key, used for authentication when communicating with Ottu's servers during the checkout process.
Only the public key should be used. The private key must remain confidential at all times and must not be shared with any clients.
The session_id
is a unique identifier assigned to the payment transaction associated with the checkout process.
This identifier is automatically generated when the payment transaction is created.
For more details on how to use the session_id
parameter in the Checkout API, refer to the session_id.
The forms of payment displayed in the checkout process can be customized using formsOfPayment
. By default, all forms of payment are enabled.
Available options for formsOfPayment
:
applePay
: Supports Apple Pay, allowing purchases to be made using Apple Pay-enabled devices.stcPay
: Requires customers to enter their mobile number and authenticate with an OTP sent to their device to complete the payment.cardOnsite
: Enables direct payments (onsite checkout), where Cardholder Data (CHD) is entered directly in the SDK. If 3DS authentication is required, a payment provider is involved in the process.tokenPay
: Uses tokenization to securely store and process customers' payment information.redirect
: Redirects customers to an external payment gateway or a third-party payment processor to complete the transaction.
An ApiTransactionDetails
struct object is used to store transaction details.
If provided, the SDK will not request transaction details from the backend, reducing processing time and improving efficiency.
The Theme
struct object is used for UI customization, allowing modifications to background colors, text colors, and fonts for various components. It supports customization for both light and dark device modes. All fields in the Theme
struct are optional. If a theme is not provided, the default UI settings will be applied. For more details, refer to the Customization Theme section.
The display of payment options is configured using the PaymentOptionsDisplaySettings
struct. Additional information is provided in the Payment Options Display Mode section.
An object is used to provide SDK callbacks to the application. Typically, this is the parent app’s class that conforms to OttuDelegate
, aggregating the SDK object.
To implement this delegate, the class must define three callback functions. More details are accessible next secion.
Last updated