### Initiate GoPay Transaction with Node.js Source: https://docs.midtrans.com/docs/coreapi-e-money-integration This Node.js example shows how to initiate a GoPay transaction using the midtrans-client NPM package. Make sure to install the package and configure your server and client keys. ```javascript /*Install midtrans-client (https://github.com/Midtrans/midtrans-nodejs-client) NPM package. npm install --save midtrans-client*/ //SAMPLE REQUEST START HERE const midtransClient = require('midtrans-client'); // Create Core API instance let core = new midtransClient.CoreApi({ isProduction : false, serverKey : 'YOUR_SERVER_KEY', clientKey : 'YOUR_CLIENT_KEY' }); let parameter = { "payment_type": "gopay", "transaction_details": { "gross_amount": 12145, "order_id": "test-transaction-54321", }, "gopay": { "enable_callback": true, // optional "callback_url": "someapps://callback" // optional } }; // charge transaction core.charge(parameter) .then((chargeResponse)=>{ console.log('chargeResponse:'); console.log(chargeResponse); }); ``` -------------------------------- ### Example Esign API Header Block Source: https://docs.midtrans.com/docs/understanding-esign-apis-headers This bash example demonstrates how to include all required headers for Esign API requests. Replace placeholders with your actual token, partner IDs, and session ID. ```bash -H "x-onekyc-token: " \ -H "x-esign-onboarding-partner: " \ -H "x-partner-user-id: " \ -H "x-partner-user-id-type: " \ -H "x-partner-session-id: " ``` -------------------------------- ### EnterpriseKTPScanConfig with Theme Source: https://docs.midtrans.com/docs/kyc-sdk Example of initializing EnterpriseKTPScanConfig with a custom theme. ```APIDOC ## EnterpriseKTPScanConfig with Theme ### Description This code snippet demonstrates how to initialize the `EnterpriseKTPScanConfig` with a custom `DigitalIdentityKTPScanFlowTheme`. ### Method Initializer ### Parameters - **baseUrl** (string) - Required - The base URL for the KYC service. - **token** (string) - Required - The JWT token for user authentication. - **correlationId** (string) - Required - A unique identifier for tracking the request. - **language** (enum) - Required - The language for the KYC flow. - **theme** (DigitalIdentityKTPScanFlowTheme) - Optional - A custom theme object for visual appearance. ### Request Example ```swift import DigitalIdentity let theme = DigitalIdentityKTPScanFlowTheme(/* customise as needed */) let config = EnterpriseKTPScanConfig( baseUrl: "https://kyc.example.com", token: "user-jwt-token", correlationId: "user-correlation-id", language: .id, theme: theme ) ``` ``` -------------------------------- ### JSON Parameters for Online Installment Source: https://docs.midtrans.com/docs/snap-advanced-feature Example of JSON parameters for a backend API request to enable online installments. This includes transaction details and credit card installment configurations for multiple banks. ```json { "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "secure": true, "installment": { "required": true, "terms": { "bca": [3,6,12], "bni": [3,6,12], "mandiri": [3,6,12], "cimb": [3,6,12], "bri": [3,6,12] } } } } ``` -------------------------------- ### Initialize GoPayEnterprise SDK (After) Source: https://docs.midtrans.com/docs/migration-guide Demonstrates the initialization of the new GoPayEnterprise SDK using GoPayEnterpriseFactory.createEnterpriseSdk(). Includes obtaining the KycManager. ```kotlin val configuration = GoPayEnterpriseConfiguration( clientID = , environment = GoPayEnterpriseEnvironment.PRODUCTION, // or .GoPayEnterpriseEnvironment.STAGING enableDebugLogs = true, // or false additionalData = emptymap(), locale = GoPayEnterpriseLocale.en // or GoPayEnterpriseLocale.id ) val sdk = GoPayEnterpriseFactory.createEnterpriseSdk( context = applicationContext, configuration = configuration, callbackDelegate = ) // Obtain KycManager from the initialized SDK instance val kycManager = sdk.getKycManager() ``` -------------------------------- ### Sample Charge API Request - Offline Installment (Whitelist BINs) Source: https://docs.midtrans.com/docs/snap-advanced-feature This cURL example shows how to send a charge API request for offline installment transactions using a whitelist of BINs. Verify the authorization header and JSON payload for accuracy. ```curl curl -X POST \ https://app.sandbox.midtrans.com/snap/v1/transactions \ -H 'Accept: application/json'\ -H 'Authorization: Basic U0ItTWlkLXNlcnZlci1UT3ExYTJBVnVpeWhoT2p2ZnMzVV7LZU87' \ -H 'Content-Type: application/json' \ -d '{ "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "secure": true, "installment": { "required": true, "terms": { "offline": [3,6,12] } }, "whitelist_bins": [ "481111", "410505" ], "bank": "mandiri" } }' ``` -------------------------------- ### Android: Initialize Webview and Load URL Source: https://docs.midtrans.com/docs/digital-identity-integration-web-webview Configure the webview with JavaScript enabled and user-gesture-free media playback. Load the launch URL obtained from the Initiate Flow API. Replace 'https://xxx' with your actual launch URL. ```kotlin webview.apply { settings.apply { javaScriptEnabled = true mediaPlaybackRequiresUserGesture = false } webChromeClient = mWebChromeClient loadUrl("https://xxx") } ``` -------------------------------- ### Initiate Snap Payment with Callbacks (Pop Up Mode) Source: https://docs.midtrans.com/docs/snap-snap-integration-guide.md This example demonstrates how to initiate the Snap checkout modal and handle payment status updates using callback functions. It includes handlers for success, pending, error, and close events. Remember to replace placeholders with your client key and transaction token. ```html ``` -------------------------------- ### Backend API Request - Offline Installment (Offline BINs) Source: https://docs.midtrans.com/docs/snap-advanced-feature Example of a backend API request to initiate a transaction with offline installment enabled using specific offline BINs. This includes transaction details, credit card configuration, and the list of applicable BINs. ```json { "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "secure": true, "installment": { "required": true, "terms": { "offline": [3,6,12] } }, "offline_bins": [ "481111", "410505" ], "bank": "mandiri" } } ``` -------------------------------- ### Example Request to Get Partner Token Source: https://docs.midtrans.com/docs/getting-an-authentication-token Use this cURL command to request a partner token from the authentication endpoint. Ensure you replace the placeholder client-id and pass-key with your actual credentials. ```bash curl -X GET "https://onekyc-token.sandbox.gopayapi.com/v1/esign/partner/authentication" \ -H "client-id: b31fa508-331c-4e9e-9a60-b0f28c3f7e13" \ -H "pass-key: 2c7b2893-e49f-4cf3-89e6-1b9c5bf0500b" ``` -------------------------------- ### Initialize DigitalIdentity SDK (Before) Source: https://docs.midtrans.com/docs/migration-guide Shows the initialization of the older DigitalIdentity SDK using DigitalIdentityProvider.getInstance(). ```kotlin private val myClientConfig: DigitalIdentityClientConfig = DigitalIdentityClientConfig( userId = , userName = , environment = ClientEnvironment.PRODUCTION // or ClientEnvironment.STAGING ) private val myEventTracker: IDigitalIdentityEventTracker = object: IDigitalIdentityEventTracker { override fun track( eventName: String, eventProperties: Map, productName: String? ) { // Callback is triggered by SDK with event and data to be tracked if required } } val sdkInstance: DigitalIdentitySdk = DigitalIdentityProvider.getInstance( appContext = applicationContext, clientConfig = myClientConfig, eventTracker = myEventTracker ) ``` -------------------------------- ### Example KYC Verification Flow Source: https://docs.midtrans.com/docs/features Demonstrates how to initiate a KYC verification flow using the SDK. Requires setting up a FeatureRequest and a CredentialReceiver to handle credentials and exchange them. ```kotlin val request = FeatureRequest.Builder() .requestId("REQ-${System.currentTimeMillis()}") .userCorrelationId("user-correlation-id") .token("short-term-linking-token") .additionalData(mapOf("phone_number" to "+628123456789")) .build() val credentialReceiver = CredentialReceiver.Exchange { credential, requestId -> if (credential is GoPayCredential.AuthCode) { val correlationId = myBackend.exchangeAuthCode(credential.code, requestId) ExchangeResult.Success(userCorrelationId = correlationId) } else { ExchangeResult.Failure(reason = "Unexpected credential type") } } sdk.getFeatureManager().verify( activity = this, request = request, credentialReceiver = credentialReceiver, callback = object : FeatureCallback { override fun onComplete(result: VerifyResult, data: Map) { Log.d(TAG, "Submission ID: ${result.submissionId}") } override fun onError(error: GoPayEnterpriseError) { Log.e(TAG, "Error ${error.code}: ${error.message}") } } ) ``` -------------------------------- ### Poll Submission Status with Fallback Source: https://docs.midtrans.com/docs/handling-submission-results If a callback is not received within a reasonable time, use the Get Submission Details API to poll the submission status. This example shows a cURL request for polling. ```bash curl -X GET \ "https://onekyc.ky.id.sandbox.gopayapi.com/esign-partner/v1/submissions" \ -H "x-onekyc-token: " \ -H "x-partner-user-id: user-12345" \ -H "x-partner-user-id-type: CLIENT_X_USER_ID" \ -H "x-partner-session-id: session-fallback-001" ``` -------------------------------- ### Initialize Digital Identity SDK (iOS) Source: https://docs.midtrans.com/docs/face-verification-flow Use the `initialise` method to initialize the SDK for iOS. Refer to the provided link for detailed instructions. ```swift Use the [initialise](https://docs.midtrans.com/docs/digital-identity-getting-started-ios#initialise-sdk) method to initialize the SDK. ``` -------------------------------- ### Migrate Face Verification Configuration and Launch (Before) Source: https://docs.midtrans.com/docs/migration-guide Example of the previous configuration and launch for Face Verification using the Digital Identity SDK. ```kotlin val config = DigitalIdentitySelfieVerificationConfig( baseUrl = , token = , correlationId = , theme = ) val helpCenter: DigitalIdentityHelpCenter = object : DigitalIdentityHelpCenter { override fun isHelpCTAVisible(helpCenterType: HelpCenterType): Boolean { return when(helpCentertype) { ... } // true or false } override fun onHelpCTAClicked(helpCenterType: HelpCenterType): Boolean { // Handle helpcenter loading return false // or true } } sdkInstance.launchSelfieVerification( activity = , config = config, helpCenter = helpCenter ) sdkInstance.observeSelfieVerification( owner = ) { result -> // Handle Completion } ``` -------------------------------- ### Configure Online Installment in JSON Source: https://docs.midtrans.com/docs/snap-advanced-feature Use this JSON structure to configure online installment options. Set 'required' to true to enforce installment payments or false to offer it as an option. Specify bank names and their available installment terms. ```json { "credit_card": { "secure": true, "installment": { "required": true, "terms": { "": [ ] } } } } ``` -------------------------------- ### Online Installment Payment Source: https://docs.midtrans.com/docs/coreapi-advanced-features This section describes how to process online installment payments. Online installments occur when the card issuing bank and the acquiring bank are the same. To enable this, you need a special installment MID from the bank and must include `installment_term` and `bank` parameters in your API request. ```APIDOC ## POST /v2/charge - Online Installment ### Description Processes an online installment payment using a credit card. This requires a pre-arranged installment MID and specific parameters in the request body. ### Method POST ### Endpoint https://api.sandbox.midtrans.com/v2/charge ### Parameters #### Request Body - **payment_type** (string) - Required - Set to "credit_card". - **transaction_details** (object) - Required - Contains order details. - **order_id** (string) - Required - Unique identifier for the order. - **gross_amount** (integer) - Required - The total transaction amount. - **credit_card** (object) - Required - Contains credit card payment details. - **token_id** (string) - Required - Token ID obtained from the Get Card Token step. - **authentication** (boolean) - Optional - Flag to enable 3DS authentication. Defaults to false if not provided. - **bank** (string) - Required - The name of the Card Issuing Bank or Acquiring Bank (e.g., "bni"). If omitted, it's treated as Offline Installment. - **installment_term** (integer) - Required - The tenor of the installment in months (e.g., 3). ### Request Example ```json { "payment_type": "credit_card", "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "token_id": "", "authentication": true, "bank": "bni", "installment_term": 3 } } ``` ### Response #### Success Response (200) - **token** (string) - Transaction token. - **transaction_status** (string) - Status of the transaction. - **order_id** (string) - Order ID. - **payment_type** (string) - Type of payment. - **gross_amount** (string) - Total amount. - **installment_terms** (object) - Details about installment terms if applicable. - **bank** (string) - The bank used for installment. - **installment_term** (string) - The selected installment tenor. - **installment_rate** (string) - The installment interest rate. - **total_amount** (string) - The total amount including interest. #### Response Example ```json { "token": "some-transaction-token", "transaction_status": "pending", "order_id": "CustOrder-102", "payment_type": "credit_card", "gross_amount": "120000", "installment_terms": { "bni": { "3": { "installment_rate": "0.1", "total_amount": "121200" } } } } ``` ``` -------------------------------- ### Launch KTP Scan Flow Source: https://docs.midtrans.com/docs/digital-identity-ktp-scan-ios This snippet demonstrates how to initialize the SDK configuration and launch the KTP Scan flow. It includes parameters for base URL, authentication token, correlation ID, language, theme, and the view controller. The completion handler provides the result of the KTP scan. ```APIDOC ## Launch KTP Scan Flow ### Description Initializes the Digital Identity SDK and launches the KTP Scan user interface. ### Method Signature `DigitalIdentitySdk.shared.launchKTPScan(config: DigitalIdentityKTPScanConfig, viewcontroller: UIViewController, completion: @escaping (DigitalIdentityDocumentVerificationResult) -> Void)` ### Parameters #### config (DigitalIdentityKTPScanConfig) Configuration object for the KTP Scan flow. - **baseUrl** (String) - Required - The base URL for the DigitalIdentity backend. - **token** (String) - Required - The authentication token for DigitalIdentity. - **correlationId** (String) - Required - A unique identifier for this KTP Scan flow. - **language** (String) - Required - The language to be used in the app. - **theme** (DigitalIdentityKTPScanFlowTheme?) - Optional - An instance of `DigitalIdentityKTPScanFlowTheme` for customizing the UI theme. #### viewcontroller (UIViewController) An instance of the `UIViewController` from which the KTP Scan flow will be presented. #### completion ((DigitalIdentityDocumentVerificationResult) -> Void) A closure that is called when the KTP Scan flow is completed or encounters an error. ### Completion Result (`DigitalIdentityDocumentVerificationResult`) An object containing the results of the KTP Scan flow. - **correlationId** (String) - The correlation ID passed during the launch. - **status** (DigitalIdentityDocumentVerificationResultStatus) - The status of the KTP Scan flow. Possible values: - `completed`: KTP Scan completed successfully. - `error`: An error occurred during KTP Scan verification. - `notCompleted`: The user exited the KTP Scan flow before completion. - **submissionId** (String?) - An optional reference number for the submitted documents. - **extra** (DigitalIdentityResultExtraData?) - Optional data providing more details, especially in case of errors. - **errorCode** (DigitalIdentityFlowErrorCode) - Enum indicating the type of error. Possible values: - `CAMERA`: Error related to camera access. - `PERMISSION`: User denied camera permissions. - `NETWORK`: Error occurred during network communication. - `USER_CANCELLED`: User explicitly cancelled the flow. - `VERIFICATION`: Document verification completed with errors. - **errorMessage** (String?) - A detailed message describing the error. ``` -------------------------------- ### Install Midtrans Snap Plugin via Composer Source: https://docs.midtrans.com/docs/install-cms-plugins Use these commands to install the Midtrans Snap plugin using Composer. Ensure Composer is installed and you have a Magento Marketplace account. ```bash composer require midtrans/snap ``` ```bash bin/magento module:enable Midtrans_Snap ``` ```bash bin/magento setup:upgrade ``` ```bash bin/magento cache:flush ``` -------------------------------- ### Configure Installment Options with Minimum Amount Source: https://docs.midtrans.com/docs/snap-advanced-feature Set up installment payment requirements, specify bank terms, and define minimum transaction amounts for both online (e.g., BNI) and offline installments. ```json { "transaction_details": { "order_id": "ORDER-101", "gross_amount": 10000 }, "credit_card": { "installment": { "required": false, "terms": { "bni": [3, 6, 12] }, "minimum_amount": { "bni": 100000, "offline" : 50000 } } } } ``` -------------------------------- ### iOS: Present WebViewController and Load URL Source: https://docs.midtrans.com/docs/digital-identity-integration-web-webview Instantiate and present the WebViewController modally, setting the launch URL. Replace 'https://xxx' with the actual URL obtained from the Initiate Flow API. ```swift if let webviewController = storyboard?.instantiateViewController(withIdentifier: "WebViewController") as? WebViewController { webviewController.webUrl = URL(string: "https://xxx") webviewController.modalPresentationStyle = .fullScreen present(webviewController, animated: true) } ``` -------------------------------- ### Constructing Authorization Header Value Source: https://docs.midtrans.com/docs/api-authorization-headers This example shows the step-by-step process to create the Authorization header value for backend API requests using a Server Key. ```text SB-Mid-server-abc123cde456: ``` ```text U0ItTWlkLXNlcnZlci1hYmMxMjNjZGU0NTY6 ``` ```text Basic U0ItTWlkLXNlcnZlci1hYmMxMjNjZGU0NTY6 ``` -------------------------------- ### Offline Installment Charge Source: https://docs.midtrans.com/docs/coreapi-advanced-features This endpoint allows you to process a credit card transaction that can be converted into an installment payment. You need to specify the installment term, allowed card BINs, and the acquiring bank. ```APIDOC ## POST /v2/charge ### Description Processes a credit card transaction for offline installment payments. ### Method POST ### Endpoint https://api.sandbox.midtrans.com/v2/charge ### Parameters #### Request Body - **payment_type** (string) - Required - Must be "credit_card". - **transaction_details** (object) - Required - Contains order ID and gross amount. - **order_id** (string) - Required - Unique identifier for the transaction. - **gross_amount** (integer) - Required - The total transaction amount. - **credit_card** (object) - Required - Details for credit card payment. - **token_id** (string) - Required - Token ID obtained from Get Card Token Step. - **authentication** (boolean) - Optional - Flag to enable 3D secure authentication. - **installment_term** (integer) - Optional - The tenor of the installment in months. - **bins** (array) - Optional - List of credit card BINs allowed for this transaction. - **bank** (string) - Optional - The acquiring bank to be used for the offline installment payment. ### Request Example ```json { "payment_type": "credit_card", "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "token_id": "", "authentication": true, "installment_term": 12, "bins": ["48111111", "3111", "5"], "bank": "mandiri" } } ``` ### Response #### Success Response (200) - **token** (string) - Transaction token. - **transaction_status** (string) - Status of the transaction. - **order_id** (string) - Order ID of the transaction. - **gross_amount** (string) - Gross amount of the transaction. - **payment_type** (string) - Type of payment. - **transaction_time** (string) - Timestamp of the transaction. - **fraud_status** (string) - Fraud status of the transaction. - **status_code** (string) - Status code of the transaction. - **finish_redirect_url** (string) - URL to redirect for finishing the transaction. - **redirect_url** (string) - URL to redirect for payment. - **pdf_url** (string) - URL to download the transaction receipt in PDF format. #### Response Example ```json { "token": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "transaction_status": "pending", "order_id": "CustOrder-102", "gross_amount": "120000", "payment_type": "credit_card", "transaction_time": "2023-10-27 10:00:00", "fraud_status": "accept", "status_code": "200", "finish_redirect_url": "https://your-website.com/finish?order_id=CustOrder-102", "redirect_url": "https://api.sandbox.midtrans.com/v2/charge/a1b2c3d4-e5f6-7890-1234-567890abcdef/redirect", "pdf_url": "https://api.sandbox.midtrans.com/v2/charge/a1b2c3d4-e5f6-7890-1234-567890abcdef/pdf" } ``` ``` -------------------------------- ### Online Installment Payment Request Source: https://docs.midtrans.com/docs/coreapi-advanced-features Use this JSON structure to make an online installment payment request. Ensure you have the correct installment MID and include `installment_term` and `bank` parameters in the `credit_card` object. ```json { "payment_type": "credit_card", "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "token_id": "", "authentication": true, "bank": "bni", "installment_term": 3 } } ``` -------------------------------- ### Initialise SDK Instance Source: https://docs.midtrans.com/docs/digital-identity-getting-started-android This snippet shows how to get an instance of the DigitalIdentitySdk using the DigitalIdentityProvider.getInstance() method. It requires the application context, client configuration, an event tracker, and an optional HTTP client. ```APIDOC ## Initialise SDK Instance ### Description This method initializes and returns an instance of the DigitalIdentitySdk. This instance is used to start various SDK flows. ### Method `DigitalIdentityProvider.getInstance()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```kotlin private val myClientConfig: DigitalIdentityClientConfig private val myEventTracker: IDigitalIdentityEventTracker private val myHttpClient: OkHttpClient val instance: DigitalIdentitySdk = DigitalIdentityProvider.getInstance( appContext = applicationContext, clientConfig = myClientConfig, eventTracker = myEventTracker, httpClient = myHttpClient ) ``` ### Response #### Success Response - **DigitalIdentitySdk** - The initialized DigitalIdentitySdk instance. #### Response Example ```kotlin // The returned instance is of type DigitalIdentitySdk val digitalIdentitySdkInstance: DigitalIdentitySdk = ... // result of getInstance call ``` ### Properties Details: * **appContext**: Application context. * **clientConfig**: Instance of **DigitalIdentityClientConfig** for user configuration. * **userId** (Int) - Required - The unique identifier for the user. * **userName** (String) - Optional - The username associated with the user. Defaults to an empty string. * **environment** (ClientEnvironment) - Optional - The environment to use for the SDK. Defaults to `ClientEnvironment.PRODUCTION`. * Enum values: `STAGING`, `PRODUCTION`. * **eventTracker**: Implementation of `IDigitalidentityEventTracker` for tracking events. * **httpClient**: Optional parameter to provide a custom `OkHttpClient` implementation. ``` -------------------------------- ### Configure Offline Installment with Whitelist BINs Source: https://docs.midtrans.com/docs/snap-advanced-feature This JSON structure configures offline installment payments using a whitelist of specific card BINs. Ensure 'required' is set appropriately to enforce or allow installment payments. ```json { "credit_card": { "secure": true, "installment": { "required": true, "terms": { "offline": [ ] } }, "whitelist_bins": [ ], "bank": } } ``` -------------------------------- ### Sample Charge API Request with Online Installment Source: https://docs.midtrans.com/docs/snap-advanced-feature A cURL command demonstrating a POST request to the Snap API for creating a transaction with online installment options. It specifies transaction details and limited installment terms for selected banks. ```curl curl -X POST \ https://app.sandbox.midtrans.com/snap/v1/transactions \ -H 'Accept: application/json'\ -H 'Authorization: Basic U0ItTWlkLXNlcnZlci1UT3ExYTJBVnVpeWhoT2p2ZnMzVV7LZU87' \ -H 'Content-Type: application/json' \ -d '{ "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "secure": true, "installment": { "required": true, "terms": { "bca": [6,12], "bni": [6,12], "mandiri": [3,6,12] } } } }' ``` -------------------------------- ### Backend API Request - Offline Installment (Whitelist BINs) Source: https://docs.midtrans.com/docs/snap-advanced-feature This JSON payload demonstrates a backend API request for a transaction using offline installment with a predefined whitelist of card BINs. It specifies transaction details and credit card installment settings. ```json { "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "secure": true, "installment": { "required": true, "terms": { "offline": [3,6,12] } }, "whitelist_bins": [ "481111", "410505" ], "bank": "mandiri" } } ``` -------------------------------- ### Alternative Frontend Integration (JSFiddle) Source: https://docs.midtrans.com/docs/snap-interactive-demo This sample demonstrates an alternative frontend integration hosted on JSFiddle. It requires you to enter a snap_transaction_token and click 'Pay' to test the payment flow. The HTML source code is also available. ```html

``` -------------------------------- ### Initialize Digital Identity SDK (Android) Source: https://docs.midtrans.com/docs/face-verification-flow Use the `getInstance` method of the `DigitalIdentityProvider` class to get the SDK instance for Android. Refer to the provided link for detailed instructions. ```java Use the [getInstance](https://docs.midtrans.com/docs/digital-identity-getting-started-android#initialise-sdk-instance) method of DigitalIdentityProvider class to get Sdk instance. ``` -------------------------------- ### Charge API Request for Online Installment Source: https://docs.midtrans.com/docs/coreapi-advanced-features This cURL command demonstrates how to send a charge API request for an online installment payment. Replace placeholders with your actual server key and token ID. The `installment_term` and `bank` parameters are crucial for processing the installment. ```curl curl -X POST \ https://api.sandbox.midtrans.com/v2/charge \ -H 'Accept: application/json'\ -H 'Authorization: Basic ' \ -H 'Content-Type: application/json' \ -d '{ "payment_type": "credit_card", "transaction_details": { "order_id": "CustOrder-102", "gross_amount": 120000 }, "credit_card": { "token_id": "", "authentication": true, "bank": "bni", "installment_term": 3 } }' ``` -------------------------------- ### Configure Offline Installment with Offline BINs Source: https://docs.midtrans.com/docs/snap-advanced-feature Use this JSON structure to configure offline installment payments by specifying an array of card BINs that support this feature. Set 'required' to true to enforce installment payment or false to allow regular full payment. ```json { "credit_card": { "secure": true, "installment": { "required": true, "offline_bins": [], "terms": { "offline": [ ] } }, "bank": } } ``` -------------------------------- ### Migrate Selfie Liveness Configuration and Launch (After) Source: https://docs.midtrans.com/docs/migration-guide Example of the updated configuration and launch for Selfie Liveness using the Enterprise SDK. ```kotlin val config = EnterpriseSelfieLivenessConfig( baseUrl = , token = , correlationId = , theme = ) val helpCenter: EnterpriseHelpCenter = object : EnterpriseHelpCenter { override fun isHelpCTAVisible(helpCenterType: EnterpriseHelpCenterType): Boolean { return when(helpCentertype) { ... } // true or false } override fun onHelpCTAClicked(helpCenterType: EnterpriseHelpCenterType): Boolean { // Handle helpcenter loading return false // or true } } kycManager.launchSelfieLiveness( activity = , config = config, helpCenter = helpCenter ) kycManager.observeSelfieLiveness( owner = ) { result -> // Handle Completion } ```