@appboxo/capacitor-boxo-sdk 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '14.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'BoxoSDK', '1.27.6'
16
+ s.dependency 'BoxoSDK', '1.28.0'
17
17
  s.swift_version = '5.1'
18
18
  end
package/README.md CHANGED
@@ -294,6 +294,7 @@ logout() => Promise<void>
294
294
  | ---------------------- | ------------------- |
295
295
  | **`appId`** | <code>string</code> |
296
296
  | **`transactionToken`** | <code>string</code> |
297
+ | **`orderPaymentId`** | <code>string</code> |
297
298
  | **`miniappOrderId`** | <code>string</code> |
298
299
  | **`amount`** | <code>number</code> |
299
300
  | **`currency`** | <code>string</code> |
@@ -56,7 +56,7 @@ dependencies {
56
56
  implementation fileTree(dir: 'libs', include: ['*.jar'])
57
57
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
58
58
  implementation project(':capacitor-android')
59
- implementation('io.boxo.sdk:boxo-android:1.41.1')
59
+ implementation('io.boxo.sdk:boxo-android:1.42.0')
60
60
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
61
61
  testImplementation "junit:junit:$junitVersion"
62
62
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
@@ -252,6 +252,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
252
252
  val appId: String = call.getString("appId")!!
253
253
  val data = PaymentData(
254
254
  call.getString("transactionToken") ?: "",
255
+ call.getString("orderPaymentId") ?: "",
255
256
  call.getString("miniappOrderId") ?: "",
256
257
  call.getDouble("amount") ?: 0.0,
257
258
  call.getString("currency") ?: "",
@@ -320,6 +321,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
320
321
  params.put("appId", miniapp.appId)
321
322
  try {
322
323
  params.put("transactionToken", paymentData.transactionToken)
324
+ params.put("orderPaymentId", paymentData.orderPaymentId)
323
325
  params.put("miniappOrderId", paymentData.miniappOrderId)
324
326
  params.put("amount", paymentData.amount)
325
327
  params.put("currency", paymentData.currency)
package/dist/docs.json CHANGED
@@ -541,6 +541,13 @@
541
541
  "complexTypes": [],
542
542
  "type": "string | undefined"
543
543
  },
544
+ {
545
+ "name": "orderPaymentId",
546
+ "tags": [],
547
+ "docs": "",
548
+ "complexTypes": [],
549
+ "type": "string | undefined"
550
+ },
544
551
  {
545
552
  "name": "miniappOrderId",
546
553
  "tags": [],
@@ -161,6 +161,7 @@ export interface CustomEvent {
161
161
  export interface PaymentEvent {
162
162
  appId: string;
163
163
  transactionToken?: string;
164
+ orderPaymentId?: string;
164
165
  miniappOrderId?: string;
165
166
  amount: number;
166
167
  currency?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface AppboxoPlugin {\n /**\n * Set global configs\n */\n setConfig(options: ConfigOptions): Promise<void>;\n /**\n * Open miniapp with options\n */\n openMiniapp(options: OpenMiniappOptions): Promise<void>;\n /**\n * get AuthCode from hostapp backend and send it to miniapp\n */\n setAuthCode(options: { appId: string; authCode: string }): Promise<void>;\n /**\n * get AuthTokens from hostapp backend and send it to miniapp\n */\n setAuthTokens(options: { appId: string; tokens: { [key: string]: string } }): Promise<void>;\n /**\n * close miniapp by appId\n */\n closeMiniapp(options: { appId: string }): Promise<void>;\n /**\n * send custom event to miniapp\n */\n sendCustomEvent(customEvent: CustomEvent): Promise<void>;\n /**\n * send payment event to miniapp\n */\n sendPaymentEvent(paymentEvent: PaymentEvent): Promise<void>;\n /**\n * Get list of miniapps\n */\n getMiniapps(): Promise<MiniappListResult>;\n /**\n * Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\n */\n hideMiniapps(): Promise<void>;\n /**\n * When host app user logs out, it is highly important to clear all miniapp storage data.\n */\n addListener(\n eventName: 'custom_event',\n listenerFunc: (customEvent: CustomEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'payment_event',\n listenerFunc: (paymentEvent: PaymentEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'miniapp_lifecycle',\n listenerFunc: (lifecycle: LifecycleEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n logout(): Promise<void>;\n}\n\nexport interface ConfigOptions {\n /**\n * your client id from dashboard\n */\n clientId: string;\n /**\n * hostapp userId, will be used for the Consent Management\n */\n userId?: string;\n /**\n * language value will be passed to the miniapp\n */\n language?: string;\n /**\n * switch to sandbox mode\n */\n sandboxMode?: boolean;\n /**\n * theme for splash screen and other native components used inside miniapp.\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * enables webview debugging\n */\n isDebug?: boolean;\n /**\n * use it to hide \"Settings\" from Miniapp menu\n */\n showPermissionsPage?: boolean;\n /**\n * use it to hide \"Clear cache\" from Miniapp menu\n */\n showClearCache?: boolean;\n /**\n * use it to hide \"About Page\" from Miniapp menu\n */\n showAboutPage?: boolean;\n /**\n * use it to change miniapp settings cache time in sec. By default is 60 sec\n */\n miniappSettingsExpirationTime?: number;\n /**\n * (optional) setup splash screen configs\n */\n splashScreenOptions?: SplashScreenOptions;\n}\n\nexport interface OpenMiniappOptions {\n /**\n * miniapp id\n */\n appId: string;\n /**\n * (optional) data as Map that is sent to miniapp\n */\n data?: object;\n /**\n * (optional) miniapp theme \"dark\" | \"light\" (by default is system theme)\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n extraUrlParams?: object;\n /**\n * (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n urlSuffix?: string;\n /**\n * (optional) provide colors to miniapp if miniapp supports\n */\n colors?: ColorOptions;\n /**\n * (optional) use to skip miniapp splash screen\n */\n enableSplash?: boolean;\n /**\n * (optional) use to save state on close miniapp\n */\n saveState?: boolean;\n /**\n * (optional) use to change launch animation for miniapp.\n */\n pageAnimation?: 'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN';\n}\nexport interface SplashScreenOptions {\n lightBackground: string;\n darkBackground: string;\n lightProgressIndicator: string;\n lightProgressTrack: string;\n darkProgressIndicator: string;\n darkProgressTrack: string;\n}\n\nexport interface ColorOptions {\n primaryColor?: string;\n secondaryColor?: string;\n tertiaryColor?: string;\n}\n\nexport interface CustomEvent {\n appId: string;\n requestId: number;\n type: string;\n errorType?: string;\n payload?: object;\n}\n\nexport interface PaymentEvent {\n appId: string;\n transactionToken?: string;\n miniappOrderId?: string;\n amount: number;\n currency?: string;\n status?: string;\n hostappOrderId?: string;\n extraParams?: object;\n}\n\nexport interface LifecycleEvent {\n appId: string;\n /**\n * onLaunch - Called when the miniapp will launch with Boxo.open(...)\n * onResume - Called when the miniapp will start interacting with the user\n * onPause - Called when the miniapp loses foreground state\n * onClose - Called when clicked close button in miniapp or when destroyed miniapp page\n * onError - Called when miniapp fails to launch due to internet connection issues\n * onUserInteraction - Called whenever touch event is dispatched to the miniapp page.\n * onAuth - Called when the miniapp starts login and user allows it\n */\n lifecycle: string;\n error?: string;\n}\n\nexport interface MiniappListResult {\n miniapps?: [MiniappData];\n error?: string;\n}\n\nexport interface MiniappData {\n appId: string;\n name: string;\n category: string;\n description: string;\n logo: string;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface AppboxoPlugin {\n /**\n * Set global configs\n */\n setConfig(options: ConfigOptions): Promise<void>;\n /**\n * Open miniapp with options\n */\n openMiniapp(options: OpenMiniappOptions): Promise<void>;\n /**\n * get AuthCode from hostapp backend and send it to miniapp\n */\n setAuthCode(options: { appId: string; authCode: string }): Promise<void>;\n /**\n * get AuthTokens from hostapp backend and send it to miniapp\n */\n setAuthTokens(options: { appId: string; tokens: { [key: string]: string } }): Promise<void>;\n /**\n * close miniapp by appId\n */\n closeMiniapp(options: { appId: string }): Promise<void>;\n /**\n * send custom event to miniapp\n */\n sendCustomEvent(customEvent: CustomEvent): Promise<void>;\n /**\n * send payment event to miniapp\n */\n sendPaymentEvent(paymentEvent: PaymentEvent): Promise<void>;\n /**\n * Get list of miniapps\n */\n getMiniapps(): Promise<MiniappListResult>;\n /**\n * Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\n */\n hideMiniapps(): Promise<void>;\n /**\n * When host app user logs out, it is highly important to clear all miniapp storage data.\n */\n addListener(\n eventName: 'custom_event',\n listenerFunc: (customEvent: CustomEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'payment_event',\n listenerFunc: (paymentEvent: PaymentEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'miniapp_lifecycle',\n listenerFunc: (lifecycle: LifecycleEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n logout(): Promise<void>;\n}\n\nexport interface ConfigOptions {\n /**\n * your client id from dashboard\n */\n clientId: string;\n /**\n * hostapp userId, will be used for the Consent Management\n */\n userId?: string;\n /**\n * language value will be passed to the miniapp\n */\n language?: string;\n /**\n * switch to sandbox mode\n */\n sandboxMode?: boolean;\n /**\n * theme for splash screen and other native components used inside miniapp.\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * enables webview debugging\n */\n isDebug?: boolean;\n /**\n * use it to hide \"Settings\" from Miniapp menu\n */\n showPermissionsPage?: boolean;\n /**\n * use it to hide \"Clear cache\" from Miniapp menu\n */\n showClearCache?: boolean;\n /**\n * use it to hide \"About Page\" from Miniapp menu\n */\n showAboutPage?: boolean;\n /**\n * use it to change miniapp settings cache time in sec. By default is 60 sec\n */\n miniappSettingsExpirationTime?: number;\n /**\n * (optional) setup splash screen configs\n */\n splashScreenOptions?: SplashScreenOptions;\n}\n\nexport interface OpenMiniappOptions {\n /**\n * miniapp id\n */\n appId: string;\n /**\n * (optional) data as Map that is sent to miniapp\n */\n data?: object;\n /**\n * (optional) miniapp theme \"dark\" | \"light\" (by default is system theme)\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n extraUrlParams?: object;\n /**\n * (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n urlSuffix?: string;\n /**\n * (optional) provide colors to miniapp if miniapp supports\n */\n colors?: ColorOptions;\n /**\n * (optional) use to skip miniapp splash screen\n */\n enableSplash?: boolean;\n /**\n * (optional) use to save state on close miniapp\n */\n saveState?: boolean;\n /**\n * (optional) use to change launch animation for miniapp.\n */\n pageAnimation?: 'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN';\n}\nexport interface SplashScreenOptions {\n lightBackground: string;\n darkBackground: string;\n lightProgressIndicator: string;\n lightProgressTrack: string;\n darkProgressIndicator: string;\n darkProgressTrack: string;\n}\n\nexport interface ColorOptions {\n primaryColor?: string;\n secondaryColor?: string;\n tertiaryColor?: string;\n}\n\nexport interface CustomEvent {\n appId: string;\n requestId: number;\n type: string;\n errorType?: string;\n payload?: object;\n}\n\nexport interface PaymentEvent {\n appId: string;\n transactionToken?: string;\n orderPaymentId?: string;\n miniappOrderId?: string;\n amount: number;\n currency?: string;\n status?: string;\n hostappOrderId?: string;\n extraParams?: object;\n}\n\nexport interface LifecycleEvent {\n appId: string;\n /**\n * onLaunch - Called when the miniapp will launch with Boxo.open(...)\n * onResume - Called when the miniapp will start interacting with the user\n * onPause - Called when the miniapp loses foreground state\n * onClose - Called when clicked close button in miniapp or when destroyed miniapp page\n * onError - Called when miniapp fails to launch due to internet connection issues\n * onUserInteraction - Called whenever touch event is dispatched to the miniapp page.\n * onAuth - Called when the miniapp starts login and user allows it\n */\n lifecycle: string;\n error?: string;\n}\n\nexport interface MiniappListResult {\n miniapps?: [MiniappData];\n error?: string;\n}\n\nexport interface MiniappData {\n appId: string;\n name: string;\n category: string;\n description: string;\n logo: string;\n}\n"]}
@@ -199,6 +199,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
199
199
 
200
200
  let paymentData = PaymentData()
201
201
  paymentData.transactionToken = call.getString("transactionToken") ?? ""
202
+ paymentData.orderPaymentId = call.getString("orderPaymentId") ?? ""
202
203
  paymentData.miniappOrderId = call.getString("miniappOrderId") ?? ""
203
204
  paymentData.amount = call.getDouble("amount", 0.0)
204
205
  paymentData.currency = call.getString("currency") ?? ""
@@ -250,6 +251,7 @@ extension AppboxoPlugin : MiniappDelegate {
250
251
  let dict = [
251
252
  "appId" : miniapp.appId,
252
253
  "transactionToken" : paymentData.transactionToken,
254
+ "orderPaymentId" : paymentData.orderPaymentId,
253
255
  "miniappOrderId" : paymentData.miniappOrderId,
254
256
  "amount" : paymentData.amount,
255
257
  "currency" : paymentData.currency,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appboxo/capacitor-boxo-sdk",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "A capacitor wrapper over Appboxo SDK for IOS and Android.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",