LogoLogo
Developer Hub
Developer Hub
  • 📍Documentation
    • 🏂Onboarding
  • PayContactless
    • PayContactless Embed
  • 📱MERCHANT EMBED SDK
    • PayContactless Embed SDK
      • Getting Started
      • SDK API Reference
        • Initialize
        • Pay With Card
          • Sale
          • Refund
          • Pre&Post Auth
        • Pay With Link
        • Pay With Account
        • Transactions History
        • Transactions Detail
        • Send Receipt
        • Daily Transactions Summary
        • Error Handling
    • Security Mechanisms
    • Production Preparation
      • Play Integrity Configuration
      • Firebase Crashlytics Configuration
      • Firebase Push Notification Configuration
  • 📱CUSTOMER ACCOUNT BASE EMBED SDK
    • Account Base Embed SDK
      • Getting Started
      • SDK API Reference
  • 💻BACKEND INTEGRATION
    • API Specification
  • 🔐Security
Powered by GitBook
On this page
  • Merchant Info
  • Initialize Listener
  1. MERCHANT EMBED SDK
  2. PayContactless Embed SDK
  3. SDK API Reference

Initialize

PreviousSDK API ReferenceNextPay With Card

Last updated 8 days ago

Initialization of the PayContactlessEmbed Library

After invoking the start method of PayContactlessEmbed, the next crucial step is to initialize the Embed library. This function serves as a foundational call; subsequent functions from the library will be inaccessible unless the Embed library is properly initialized.

To facilitate this, the function requires an InitializeListener interface as an argument. It's essential for the merchant application to implement the InitializeListener class, as the library leverages its methods as delegates, ensuring seamless communication and functionality between the app and the SDK.

PayContactlessEmbed.getInstance().initialize(@NonNull String apiKey, @NonNull MerchantInfo merchantInfo, @NonNull InitializeListener listener)

Handling Initialization Outcomes in PayContactlessEmbed Library

Upon successful completion of the initialize function, the onSuccess method is triggered. This will return a deviceId to the integrating application, signifying a successful initialization.

However, should there be any issues during initialization, the onFailure method will be activated. In the event of such a failure, it's imperative to diagnose the error and undertake the necessary corrective measures. For a comprehensive understanding of possible errors and their resolutions, please refer to the Error Handling section.

Merchant Info

Find the details at Section 3.2.

data class MerchantInfo (
    val merchantId: String,
    val terminalId: String,
    val merchantCategoryCode: String? = null,
    val businessName: String? = null,
    val city: String? = null,
    val state: String? = null,
    val country: String? = null,
    val firstName: String? = null,
    val lastname: String? = null,
    val email: String? = null,
    val phoneNumber: String? = null,
    val taxIdentificationNumber: String? = null,
    val apiKey: String
)

Initialize Listener

public interface InitializeListener {
    void onSuccess(String deviceId);
    void onFailure(Error error);
}

📱
Error Handling