Skip to content

khipu/capacitor-khipu

Repository files navigation

capacitor-khipu

Capacitor plugin for Khipu

Install

npm install capacitor-khipu
npx cap sync

iOS setup

No need for aditional steps

Android setup

Main Khipu repository

For Android to be able to locate the khenshin aar you need to add the maven repository of khenshin to the allproyects section of the android/build.gradle file.

Something like:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://dev.khipu.com/nexus/content/repositories/khenshin' }
    }
}

Note that google() and mavenCentral() repos are usually already added.

Jetpack compose and Kotlin

Khipu client for Android use Jetpack Compose technology, in order to do that the kotlin plugin must be enabled.

In the android/build.gradle file add the classpath for the org.jetbrains.kotlin:kotlin-gradle-plugin:<version> artifact

buildscript {
    
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.2.1'
        classpath 'com.google.gms:google-services:4.4.0'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Note that the classpath for com.android.tools.build:gradle:<version> and com.google.gms:google-services:<version> are usually already there.

Then in the android/app/build.gradle file add the plugin at the top of the file

apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'

Note that the com.android.application plugin is usually already there.

API

startOperation(...)

startOperation(options: StartOperationOptions) => Promise<KhipuResult>
Param Type
options StartOperationOptions

Returns: Promise<KhipuResult>


Interfaces

KhipuResult

Prop Type
operationId string
exitTitle string
exitMessage string
exitUrl string
result 'OK' | 'ERROR' | 'WARNING' | 'CONTINUE'
failureReason string
continueUrl string
events KhipuEvent[]

KhipuEvent

Prop Type
name string
timestamp string
type string

StartOperationOptions

Prop Type
operationId string
options KhipuOptions

KhipuOptions

Prop Type
locale string
title string
titleImageUrl string
skipExitPage boolean
theme 'light' | 'dark' | 'system'
colors KhipuColors
showFooter boolean
showMerchantLogo boolean
showPaymentDetails boolean

KhipuColors

Prop Type
lightBackground string
lightOnBackground string
lightPrimary string
lightOnPrimary string
lightTopBarContainer string
lightOnTopBarContainer string
darkBackground string
darkOnBackground string
darkPrimary string
darkOnPrimary string
darkTopBarContainer string
darkOnTopBarContainer string