nimbbl-mobile-react-native-sdk 1.1.0 → 1.2.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.
- package/README.md +102 -66
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/nimbbl/reactnative/NimbblCheckoutActivity.kt +55 -111
- package/android/src/main/java/com/nimbbl/reactnative/NimbblReactNativeSDKModule.kt +58 -157
- package/ios/NimbblReactNativeSDK.m +6 -2
- package/ios/NimbblReactNativeSDK.podspec +1 -1
- package/ios/NimbblReactNativeSDK.swift +29 -32
- package/lib/NimbblSDK.d.ts +11 -34
- package/lib/NimbblSDK.js +66 -91
- package/lib/constants.d.ts +6 -9
- package/lib/constants.js +8 -12
- package/lib/index.d.ts +3 -3
- package/lib/index.js +3 -4
- package/lib/types.d.ts +0 -80
- package/nimbbl-mobile-react-native-sdk.podspec +1 -1
- package/package.json +16 -3
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/results.bin +0 -1
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/BuildConfig.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/NimbblCheckoutActivity$Companion.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/NimbblCheckoutActivity.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/NimbblReactNativeSDKModule$Companion.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/NimbblReactNativeSDKModule$createShopOrder$orderResult$1.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/NimbblReactNativeSDKModule.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/NimbblReactNativeSDKPackage.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/TestActivity$Companion.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/nimbbl/reactnative/TestActivity.dex +0 -0
- package/android/build/.transforms/2a0cc55152835fcf4fba7a298d35d4c4/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/b59c320b706dec67ea6e4de5e98939af/results.bin +0 -1
- package/android/build/.transforms/b59c320b706dec67ea6e4de5e98939af/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/nimbbl/reactnative/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -23
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/nimbbl-mobile-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/nimbbl/reactnative/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -36
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -23
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/nimbbl-mobile-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/NimbblCheckoutActivity$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/NimbblCheckoutActivity.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/NimbblReactNativeSDKModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/NimbblReactNativeSDKModule$createShopOrder$orderResult$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/NimbblReactNativeSDKModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/NimbblReactNativeSDKPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/TestActivity$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/nimbbl/reactnative/TestActivity.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -42
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/nimbbl-mobile-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/NimbblCheckoutActivity$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/NimbblCheckoutActivity.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/NimbblReactNativeSDKModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/NimbblReactNativeSDKModule$createShopOrder$orderResult$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/NimbblReactNativeSDKModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/NimbblReactNativeSDKPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/TestActivity$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/nimbbl/reactnative/TestActivity.class +0 -0
- package/android/src/main/java/com/nimbbl/reactnative/TestActivity.kt +0 -28
- package/lib/NimbblSDK.d.ts.map +0 -1
- package/lib/NimbblSDK.js.map +0 -1
- package/lib/__tests__/__mocks__/react-native.d.ts +0 -26
- package/lib/__tests__/__mocks__/react-native.d.ts.map +0 -1
- package/lib/__tests__/__mocks__/react-native.js +0 -23
- package/lib/__tests__/__mocks__/react-native.js.map +0 -1
- package/lib/__tests__/setup.d.ts +0 -1
- package/lib/__tests__/setup.d.ts.map +0 -1
- package/lib/__tests__/setup.js +0 -4
- package/lib/__tests__/setup.js.map +0 -1
- package/lib/constants.d.ts.map +0 -1
- package/lib/constants.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -23,6 +23,14 @@ npm install nimbbl-mobile-react-native-sdk
|
|
|
23
23
|
yarn add nimbbl-mobile-react-native-sdk
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
## Development Setup
|
|
27
|
+
|
|
28
|
+
For SDK developers and contributors:
|
|
29
|
+
|
|
30
|
+
- **[BUILD.md](BUILD.md)** - Quick build and run guide
|
|
31
|
+
- **[SETUP.md](SETUP.md)** - Comprehensive development setup
|
|
32
|
+
- **[Sample App](../nimbbl_react_native_sample_app/)** - Complete working example
|
|
33
|
+
|
|
26
34
|
|
|
27
35
|
|
|
28
36
|
## Compatibility
|
|
@@ -38,8 +46,11 @@ The Nimbbl React Native SDK is compatible with the following npm versions:
|
|
|
38
46
|
| `^1.0.0-alpha.2` | ✅ Supported | Enhanced error handling |
|
|
39
47
|
| `^1.0.0-alpha.3` | ✅ Supported | Enhanced error handling |
|
|
40
48
|
| `^1.0.0-alpha.12` | ✅ Supported | Latest alpha release |
|
|
41
|
-
| `^1.0.0` | ✅
|
|
42
|
-
| `^1.1
|
|
49
|
+
| `^1.0.0` | ✅ Supported | Initial stable release |
|
|
50
|
+
| `^1.0.1` | ✅ Supported | Bug fixes and improvements |
|
|
51
|
+
| `^1.1.0` | ✅ Supported | Production ready with environment URL initialization |
|
|
52
|
+
| `^1.1.1` | ✅ Supported | Bug fixes and improvements |
|
|
53
|
+
| `^1.2.0` | ✅ **Latest Stable** | **Updated to latest native SDK versions** |
|
|
43
54
|
| `^2.0.0` | 🔄 Coming Soon | Major version with breaking changes |
|
|
44
55
|
|
|
45
56
|
### React Native Version Support
|
|
@@ -104,9 +115,7 @@ import { NimbblSDK } from 'nimbbl-mobile-react-native-sdk';
|
|
|
104
115
|
const nimbblSDK = NimbblSDK.getSharedInstance();
|
|
105
116
|
|
|
106
117
|
// Initialize the SDK (no credentials required - matches iOS pattern)
|
|
107
|
-
await nimbblSDK.initialize(
|
|
108
|
-
environment: 'sandbox' // or 'production'
|
|
109
|
-
});
|
|
118
|
+
await nimbblSDK.initialize();
|
|
110
119
|
```
|
|
111
120
|
|
|
112
121
|
|
|
@@ -114,7 +123,7 @@ await nimbblSDK.initialize({
|
|
|
114
123
|
### 2. Process Payment
|
|
115
124
|
|
|
116
125
|
```javascript
|
|
117
|
-
// Process payment using checkout method
|
|
126
|
+
// Process payment using checkout method
|
|
118
127
|
const checkoutResult = await nimbblSDK.checkout({
|
|
119
128
|
orderToken: 'YOUR_ORDER_TOKEN', // Order token received from your server
|
|
120
129
|
paymentModeCode: '', // Leave empty for all payment modes
|
|
@@ -137,40 +146,36 @@ The main SDK class that provides all payment functionality.
|
|
|
137
146
|
#### Methods
|
|
138
147
|
|
|
139
148
|
- `getSharedInstance()` - Get shared SDK instance (singleton pattern)
|
|
140
|
-
- `initialize(
|
|
149
|
+
- `initialize()` - Initialize the SDK with default configuration
|
|
141
150
|
- `checkout(options)` - Process payment with order token
|
|
142
|
-
- `
|
|
143
|
-
- `
|
|
144
|
-
- `removeEventListener(eventName, callback)` - Remove event listener
|
|
145
|
-
- `removeAllEventListeners()` - Remove all event listeners
|
|
151
|
+
- `addCheckoutResponseListener(callback)` - Add unified checkout response listener (recommended)
|
|
152
|
+
- `removeCheckoutResponseListener(callback)` - Remove checkout response listener
|
|
146
153
|
|
|
147
154
|
### Event Handling
|
|
148
155
|
|
|
149
|
-
The SDK
|
|
156
|
+
The SDK uses a unified event handling approach for payment responses:
|
|
150
157
|
|
|
151
158
|
```javascript
|
|
152
|
-
import { NimbblSDK
|
|
159
|
+
import { NimbblSDK } from 'nimbbl-mobile-react-native-sdk';
|
|
153
160
|
|
|
154
161
|
const nimbblSDK = NimbblSDK.getSharedInstance();
|
|
155
162
|
|
|
156
|
-
// Initialize SDK
|
|
157
|
-
await nimbblSDK.initialize(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
console.log('Payment failed:', data);
|
|
169
|
-
// Handle failure - show error message
|
|
163
|
+
// Initialize SDK
|
|
164
|
+
await nimbblSDK.initialize();
|
|
165
|
+
|
|
166
|
+
// Use unified checkout response listener
|
|
167
|
+
nimbblSDK.addCheckoutResponseListener((data) => {
|
|
168
|
+
if (data.status === 'success') {
|
|
169
|
+
// Handle successful payment
|
|
170
|
+
// Handle success - navigate to success screen
|
|
171
|
+
} else {
|
|
172
|
+
// Handle failed payment
|
|
173
|
+
// Handle failure - show error message
|
|
174
|
+
}
|
|
170
175
|
});
|
|
171
176
|
|
|
172
|
-
// Optional: Clean up listeners when done
|
|
173
|
-
// nimbblSDK.
|
|
177
|
+
// Optional: Clean up listeners when done
|
|
178
|
+
// nimbblSDK.removeCheckoutResponseListener(callback);
|
|
174
179
|
```
|
|
175
180
|
|
|
176
181
|
## Configuration
|
|
@@ -179,30 +184,16 @@ nimbblSDK.addEventListener(EVENTS.PAYMENT_FAILED, (data) => {
|
|
|
179
184
|
|
|
180
185
|
```javascript
|
|
181
186
|
const config = {
|
|
182
|
-
environment: '
|
|
187
|
+
environment: 'production', // 'production' (default) or 'sandbox'
|
|
183
188
|
options: {
|
|
184
189
|
timeout: 30000,
|
|
185
|
-
enable_logging:
|
|
190
|
+
enable_logging: false,
|
|
186
191
|
enable_analytics: true,
|
|
187
192
|
api_base_url: 'https://api.nimbbl.tech/' // Optional: override default URL
|
|
188
193
|
}
|
|
189
194
|
};
|
|
190
195
|
```
|
|
191
196
|
|
|
192
|
-
## Constants
|
|
193
|
-
|
|
194
|
-
The SDK provides various constants for better development experience:
|
|
195
|
-
|
|
196
|
-
```javascript
|
|
197
|
-
import {
|
|
198
|
-
EVENTS,
|
|
199
|
-
ENVIRONMENTS,
|
|
200
|
-
ERROR_CODES,
|
|
201
|
-
ERROR_MESSAGES,
|
|
202
|
-
DEFAULT_CONFIG,
|
|
203
|
-
SDK_VERSION
|
|
204
|
-
} from 'nimbbl-mobile-react-native-sdk';
|
|
205
|
-
```
|
|
206
197
|
|
|
207
198
|
## Error Handling
|
|
208
199
|
|
|
@@ -216,7 +207,7 @@ try {
|
|
|
216
207
|
paymentFlow: ''
|
|
217
208
|
});
|
|
218
209
|
} catch (error) {
|
|
219
|
-
|
|
210
|
+
// Handle payment error
|
|
220
211
|
|
|
221
212
|
// Check error codes
|
|
222
213
|
if (error.code === ERROR_CODES.PAYMENT_FAILED) {
|
|
@@ -276,22 +267,19 @@ class PaymentManager {
|
|
|
276
267
|
}
|
|
277
268
|
|
|
278
269
|
async initialize() {
|
|
279
|
-
await this.nimbblSDK.initialize(
|
|
280
|
-
environment: 'sandbox'
|
|
281
|
-
});
|
|
270
|
+
await this.nimbblSDK.initialize();
|
|
282
271
|
}
|
|
283
272
|
|
|
284
273
|
setupEventListeners() {
|
|
285
|
-
//
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// Show error message
|
|
274
|
+
// Use unified checkout response listener
|
|
275
|
+
this.nimbblSDK.addCheckoutResponseListener((data) => {
|
|
276
|
+
if (data.status === 'success') {
|
|
277
|
+
// Handle successful payment
|
|
278
|
+
// Navigate to success screen
|
|
279
|
+
} else {
|
|
280
|
+
// Handle failed payment
|
|
281
|
+
// Show error message
|
|
282
|
+
}
|
|
295
283
|
});
|
|
296
284
|
}
|
|
297
285
|
|
|
@@ -383,12 +371,10 @@ For debugging purposes, you can check the SDK initialization status and handle e
|
|
|
383
371
|
const nimbblSDK = NimbblSDK.getSharedInstance();
|
|
384
372
|
|
|
385
373
|
try {
|
|
386
|
-
await nimbblSDK.initialize(
|
|
387
|
-
|
|
388
|
-
});
|
|
389
|
-
console.log('SDK initialized successfully');
|
|
374
|
+
await nimbblSDK.initialize();
|
|
375
|
+
// SDK initialized successfully
|
|
390
376
|
} catch (error) {
|
|
391
|
-
|
|
377
|
+
// Handle initialization error
|
|
392
378
|
}
|
|
393
379
|
```
|
|
394
380
|
|
|
@@ -459,7 +445,7 @@ For production applications, consider locking to specific versions:
|
|
|
459
445
|
```json
|
|
460
446
|
{
|
|
461
447
|
"dependencies": {
|
|
462
|
-
"nimbbl-mobile-react-native-sdk": "1.
|
|
448
|
+
"nimbbl-mobile-react-native-sdk": "1.1.1"
|
|
463
449
|
}
|
|
464
450
|
}
|
|
465
451
|
```
|
|
@@ -472,7 +458,57 @@ For production applications, consider locking to specific versions:
|
|
|
472
458
|
|
|
473
459
|
## Changelog
|
|
474
460
|
|
|
475
|
-
### v1.
|
|
461
|
+
### v1.2.0 (Latest Stable Release)
|
|
462
|
+
|
|
463
|
+
**🚀 Updated to Latest Native SDK Versions!**
|
|
464
|
+
|
|
465
|
+
#### ✨ New Features
|
|
466
|
+
- **Latest iOS SDK**: Updated to `nimbbl_mobile_kit_ios_webview_sdk: ~> 2.0.4`
|
|
467
|
+
- **Latest Android SDK**: Updated to `nimbbl_mobile_kit_android_webview_sdk: v4.0.3`
|
|
468
|
+
- **Enhanced Compatibility**: Full compatibility with latest native SDK features
|
|
469
|
+
- **Unified Event Handling**: New `addCheckoutResponseListener()` method for simplified event handling
|
|
470
|
+
- **Clean API**: Removed legacy `payment_success` and `payment_failed` events for cleaner codebase
|
|
471
|
+
- **iOS-Android Parity**: Complete feature parity between iOS and Android modules
|
|
472
|
+
- **Callback Support**: Direct callback support for better production reliability
|
|
473
|
+
|
|
474
|
+
#### 🔧 Improvements
|
|
475
|
+
- **Better Performance**: Leverages latest optimizations from native SDKs
|
|
476
|
+
- **Enhanced Security**: Includes latest security updates from native SDKs
|
|
477
|
+
- **Improved Stability**: Bug fixes and stability improvements from native SDKs
|
|
478
|
+
- **Future-Ready**: Prepared for upcoming native SDK features
|
|
479
|
+
- **Cross-Platform Consistency**: iOS and Android modules now have identical APIs
|
|
480
|
+
- **Production Ready**: Enhanced callback system for production environments
|
|
481
|
+
|
|
482
|
+
#### 🐛 Bug Fixes
|
|
483
|
+
- Resolved compatibility issues with older native SDK versions
|
|
484
|
+
- Fixed potential memory leaks in native bridge communication
|
|
485
|
+
- Improved error handling for edge cases
|
|
486
|
+
- Fixed iOS `setCheckoutCallback is not a function` error
|
|
487
|
+
- Resolved method signature conflicts in iOS native module
|
|
488
|
+
- Enhanced callback-based communication for better reliability
|
|
489
|
+
|
|
490
|
+
### v1.1.1
|
|
491
|
+
|
|
492
|
+
**🚀 Production Ready with Enhanced Features!**
|
|
493
|
+
|
|
494
|
+
#### ✨ New Features
|
|
495
|
+
- **Production Default**: SDK now defaults to production environment instead of sandbox
|
|
496
|
+
- **Automatic Event Listener Management**: SDK automatically manages event listeners for optimal performance
|
|
497
|
+
|
|
498
|
+
#### 🔧 Improvements
|
|
499
|
+
- **Simplified Integration**: No need to manually manage event listeners
|
|
500
|
+
- **Enhanced Error Handling**: Improved error messages and debugging capabilities
|
|
501
|
+
- **Performance Optimization**: Better memory management and event handling
|
|
502
|
+
- **TypeScript Support**: Comprehensive type definitions for better development experience
|
|
503
|
+
|
|
504
|
+
#### 🐛 Bug Fixes
|
|
505
|
+
- Resolved event listener memory leaks
|
|
506
|
+
- Fixed iOS native module integration issues
|
|
507
|
+
- Improved error handling for network failures
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
### v1.0.0 (Stable Release)
|
|
476
512
|
|
|
477
513
|
**🎉 First Stable Release - Production Ready!**
|
|
478
514
|
|
package/android/build.gradle
CHANGED
|
@@ -24,7 +24,7 @@ allprojects {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
group = 'com.nimbbl.reactnative'
|
|
27
|
-
version = '1.
|
|
27
|
+
version = '1.2.0'
|
|
28
28
|
|
|
29
29
|
android {
|
|
30
30
|
namespace 'com.nimbbl.reactnative'
|
|
@@ -35,7 +35,7 @@ android {
|
|
|
35
35
|
minSdkVersion 24
|
|
36
36
|
targetSdkVersion 36
|
|
37
37
|
versionCode 1
|
|
38
|
-
versionName "1.
|
|
38
|
+
versionName "1.2.0"
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
buildTypes {
|
|
@@ -65,7 +65,7 @@ dependencies {
|
|
|
65
65
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
66
66
|
|
|
67
67
|
// Nimbbl WebView SDK dependency (includes all necessary dependencies)
|
|
68
|
-
implementation '
|
|
68
|
+
implementation 'org.bitbucket.nimbbl-tech:nimbbl_mobile_kit_android_webview_sdk:v4.0.3'
|
|
69
69
|
|
|
70
70
|
// Add Retrofit and Coroutines dependencies for Android SDK
|
|
71
71
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
@@ -79,7 +79,7 @@ afterEvaluate {
|
|
|
79
79
|
from components.release
|
|
80
80
|
groupId = 'com.nimbbl.reactnative'
|
|
81
81
|
artifactId = 'nimbbl-react-native-sdk'
|
|
82
|
-
version = '1.
|
|
82
|
+
version = '1.2.0'
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -3,16 +3,10 @@ package com.nimbbl.reactnative
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Intent
|
|
5
5
|
import android.os.Bundle
|
|
6
|
-
import android.util.Log
|
|
7
|
-
import android.widget.TextView
|
|
8
|
-
import android.view.ViewGroup
|
|
9
|
-
import android.widget.LinearLayout
|
|
10
|
-
import android.graphics.Color
|
|
11
6
|
import tech.nimbbl.webviewsdk.core.NimbblCheckoutSDK
|
|
12
7
|
import tech.nimbbl.webviewsdk.models.NimbblCheckoutOptions
|
|
13
8
|
import tech.nimbbl.webviewsdk.models.interfaces.NimbblCheckoutPaymentListener
|
|
14
|
-
import
|
|
15
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
9
|
+
import org.json.JSONObject
|
|
16
10
|
|
|
17
11
|
class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
18
12
|
|
|
@@ -32,9 +26,6 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
32
26
|
walletCode: String = "",
|
|
33
27
|
paymentFlow: String = ""
|
|
34
28
|
) {
|
|
35
|
-
Log.d(TAG, "startCheckout method called with orderToken: $orderToken")
|
|
36
|
-
println("startCheckout method called with orderToken: $orderToken")
|
|
37
|
-
|
|
38
29
|
val intent = Intent(activity, NimbblCheckoutActivity::class.java).apply {
|
|
39
30
|
putExtra(EXTRA_ORDER_TOKEN, orderToken)
|
|
40
31
|
putExtra(EXTRA_PAYMENT_MODE_CODE, paymentModeCode)
|
|
@@ -43,43 +34,13 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
43
34
|
putExtra(EXTRA_PAYMENT_FLOW, paymentFlow)
|
|
44
35
|
}
|
|
45
36
|
|
|
46
|
-
Log.d(TAG, "Intent created, starting activity...")
|
|
47
|
-
println("Intent created, starting activity...")
|
|
48
37
|
activity.startActivity(intent)
|
|
49
|
-
Log.d(TAG, "Activity startActivity() called")
|
|
50
|
-
println("Activity startActivity() called")
|
|
51
38
|
}
|
|
52
39
|
}
|
|
53
40
|
|
|
54
41
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
55
42
|
super.onCreate(savedInstanceState)
|
|
56
43
|
|
|
57
|
-
Log.d(TAG, "NimbblCheckoutActivity created")
|
|
58
|
-
println("NimbblCheckoutActivity onCreate called")
|
|
59
|
-
|
|
60
|
-
// Create a simple UI to show the activity is launching
|
|
61
|
-
val layout = LinearLayout(this).apply {
|
|
62
|
-
orientation = LinearLayout.VERTICAL
|
|
63
|
-
layoutParams = ViewGroup.LayoutParams(
|
|
64
|
-
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
65
|
-
ViewGroup.LayoutParams.MATCH_PARENT
|
|
66
|
-
)
|
|
67
|
-
setBackgroundColor(Color.WHITE)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
val textView = TextView(this).apply {
|
|
71
|
-
text = "NimbblCheckoutActivity is loading...\nOrder Token: ${intent.getStringExtra(EXTRA_ORDER_TOKEN)}"
|
|
72
|
-
textSize = 16f
|
|
73
|
-
setTextColor(Color.BLACK)
|
|
74
|
-
setPadding(50, 100, 50, 50)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
layout.addView(textView)
|
|
78
|
-
setContentView(layout)
|
|
79
|
-
|
|
80
|
-
Log.d(TAG, "Simple UI set up")
|
|
81
|
-
println("Simple UI set up")
|
|
82
|
-
|
|
83
44
|
try {
|
|
84
45
|
// Get the checkout options from intent
|
|
85
46
|
val orderToken = intent.getStringExtra(EXTRA_ORDER_TOKEN)
|
|
@@ -88,25 +49,12 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
88
49
|
val walletCode = intent.getStringExtra(EXTRA_WALLET_CODE) ?: ""
|
|
89
50
|
val paymentFlow = intent.getStringExtra(EXTRA_PAYMENT_FLOW) ?: ""
|
|
90
51
|
|
|
91
|
-
Log.d(TAG, "Received order token: $orderToken")
|
|
92
|
-
Log.d(TAG, "Received payment mode code: $paymentModeCode")
|
|
93
|
-
Log.d(TAG, "Received bank code: $bankCode")
|
|
94
|
-
Log.d(TAG, "Received wallet code: $walletCode")
|
|
95
|
-
Log.d(TAG, "Received payment flow: $paymentFlow")
|
|
96
52
|
|
|
97
53
|
if (orderToken.isNullOrEmpty()) {
|
|
98
|
-
Log.e(TAG, "Order token is required")
|
|
99
54
|
finish()
|
|
100
55
|
return
|
|
101
56
|
}
|
|
102
57
|
|
|
103
|
-
Log.d(TAG, "Starting checkout with order token: $orderToken")
|
|
104
|
-
println("Starting checkout with order token: $orderToken")
|
|
105
|
-
|
|
106
|
-
// Use direct method calls instead of reflection
|
|
107
|
-
Log.d(TAG, "Using direct Android SDK calls...")
|
|
108
|
-
println("Using direct Android SDK calls...")
|
|
109
|
-
|
|
110
58
|
try {
|
|
111
59
|
// Create checkout options first (matching native sample app pattern)
|
|
112
60
|
val checkoutOptions = NimbblCheckoutOptions.Builder()
|
|
@@ -117,108 +65,104 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
117
65
|
.setWalletCode(walletCode)
|
|
118
66
|
.build()
|
|
119
67
|
|
|
120
|
-
Log.d(TAG, "Checkout options created successfully")
|
|
121
|
-
println("Checkout options created successfully")
|
|
122
|
-
|
|
123
68
|
// Initialize SDK and call checkout (matching native sample app pattern)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
NimbblCheckoutSDK.instance?.init(this)
|
|
128
|
-
NimbblCheckoutSDK.instance?.checkout(checkoutOptions)
|
|
129
|
-
|
|
130
|
-
Log.d(TAG, "NimbblCheckoutSDK init and checkout called successfully")
|
|
131
|
-
println("NimbblCheckoutSDK init and checkout called successfully")
|
|
132
|
-
|
|
133
|
-
Log.d(TAG, "Webview should appear now...")
|
|
134
|
-
println("Webview should appear now...")
|
|
69
|
+
NimbblCheckoutSDK.getInstance().init(this)
|
|
70
|
+
NimbblCheckoutSDK.getInstance().checkout(checkoutOptions)
|
|
135
71
|
|
|
136
72
|
} catch (e: Exception) {
|
|
137
|
-
Log.e(TAG, "Error calling Android SDK: ${e.message}", e)
|
|
138
|
-
println("Error calling Android SDK: ${e.message}")
|
|
139
|
-
e.printStackTrace()
|
|
140
73
|
finish()
|
|
141
74
|
}
|
|
142
75
|
|
|
143
76
|
} catch (e: Exception) {
|
|
144
|
-
Log.e(TAG, "Error in onCreate: ${e.message}", e)
|
|
145
|
-
println("Error in onCreate: ${e.message}")
|
|
146
|
-
e.printStackTrace()
|
|
147
77
|
finish()
|
|
148
78
|
}
|
|
149
79
|
}
|
|
150
80
|
|
|
151
81
|
|
|
152
82
|
|
|
153
|
-
override fun
|
|
83
|
+
override fun onCheckoutResponse(data: MutableMap<String, Any>) {
|
|
84
|
+
|
|
85
|
+
// Convert the data to proper JSON format
|
|
86
|
+
val jsonData = try {
|
|
87
|
+
val jsonObject = JSONObject()
|
|
88
|
+
data.forEach { (key, value) ->
|
|
89
|
+
when (value) {
|
|
90
|
+
is String -> {
|
|
91
|
+
// Replace "null" string with empty string
|
|
92
|
+
val cleanValue = if (value == "null") "" else value
|
|
93
|
+
jsonObject.put(key, cleanValue)
|
|
94
|
+
}
|
|
95
|
+
is Number -> jsonObject.put(key, value)
|
|
96
|
+
is Boolean -> jsonObject.put(key, value)
|
|
97
|
+
is Map<*, *> -> {
|
|
98
|
+
val nestedJson = JSONObject()
|
|
99
|
+
(value as Map<String, Any>).forEach { (nestedKey, nestedValue) ->
|
|
100
|
+
when (nestedValue) {
|
|
101
|
+
is String -> {
|
|
102
|
+
// Replace "null" string with empty string
|
|
103
|
+
val cleanValue = if (nestedValue == "null") "" else nestedValue
|
|
104
|
+
nestedJson.put(nestedKey, cleanValue)
|
|
105
|
+
}
|
|
106
|
+
is Number -> nestedJson.put(nestedKey, nestedValue)
|
|
107
|
+
is Boolean -> nestedJson.put(nestedKey, nestedValue)
|
|
108
|
+
else -> {
|
|
109
|
+
val cleanValue = if (nestedValue.toString() == "null") "" else nestedValue.toString()
|
|
110
|
+
nestedJson.put(nestedKey, cleanValue)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
jsonObject.put(key, nestedJson)
|
|
115
|
+
}
|
|
116
|
+
else -> {
|
|
117
|
+
val cleanValue = if (value.toString() == "null") "" else value.toString()
|
|
118
|
+
jsonObject.put(key, cleanValue)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
jsonObject.toString()
|
|
123
|
+
} catch (e: Exception) {
|
|
124
|
+
data.toString() // Fallback to original format
|
|
125
|
+
}
|
|
126
|
+
|
|
154
127
|
// Set result for the calling activity (NimbblReactNativeSDKModule)
|
|
155
128
|
val intent = Intent().apply {
|
|
156
|
-
putExtra("status", "
|
|
129
|
+
putExtra("status", data["status"]?.toString() ?: "failed")
|
|
157
130
|
putExtra("order_id", data["order_id"]?.toString() ?: "")
|
|
158
131
|
putExtra("payment_id", data["payment_id"]?.toString() ?: "")
|
|
159
|
-
putExtra("response",
|
|
132
|
+
putExtra("response", jsonData)
|
|
160
133
|
}
|
|
161
|
-
setResult(Activity.RESULT_OK, intent)
|
|
162
134
|
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
override fun onPaymentFailed(data: String) {
|
|
167
|
-
// Set result for the calling activity (NimbblReactNativeSDKModule)
|
|
168
|
-
val intent = Intent().apply {
|
|
169
|
-
putExtra("status", "failed")
|
|
170
|
-
putExtra("response", data)
|
|
171
|
-
}
|
|
172
|
-
setResult(Activity.RESULT_CANCELED, intent)
|
|
135
|
+
setResult(Activity.RESULT_OK, intent)
|
|
173
136
|
|
|
174
137
|
finish()
|
|
175
138
|
}
|
|
176
139
|
|
|
140
|
+
|
|
177
141
|
override fun onBackPressed() {
|
|
178
|
-
Log.d(TAG, "Back pressed - blocked to prevent accidental cancellation")
|
|
179
|
-
println("Back pressed - blocked to prevent accidental cancellation")
|
|
180
|
-
|
|
181
142
|
// Block the back button completely
|
|
182
143
|
// The WebView should handle its own back navigation internally
|
|
183
144
|
// Only success and failure events should be sent to the sample app
|
|
184
145
|
}
|
|
185
146
|
|
|
186
|
-
override fun onPause() {
|
|
187
|
-
super.onPause()
|
|
188
|
-
Log.d(TAG, "onPause called - cleaning up resources")
|
|
189
|
-
println("onPause called - cleaning up resources")
|
|
190
|
-
|
|
191
|
-
// Clean up any resources that might be causing leaks
|
|
192
|
-
try {
|
|
193
|
-
// The NimbblCheckoutSDK should handle its own cleanup
|
|
194
|
-
// but we can add additional cleanup here if needed
|
|
195
|
-
} catch (e: Exception) {
|
|
196
|
-
Log.e(TAG, "Error during onPause cleanup", e)
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
147
|
override fun onDestroy() {
|
|
201
148
|
super.onDestroy()
|
|
202
|
-
Log.d(TAG, "onDestroy called - final cleanup")
|
|
203
|
-
println("onDestroy called - final cleanup")
|
|
204
149
|
|
|
205
150
|
// Final cleanup to prevent memory leaks
|
|
206
151
|
try {
|
|
207
152
|
// Call cleanup on NimbblCheckoutSDK to properly unregister broadcast receivers
|
|
208
|
-
NimbblCheckoutSDK.
|
|
153
|
+
NimbblCheckoutSDK.getInstance().let { sdk ->
|
|
209
154
|
try {
|
|
210
155
|
// Try to call any cleanup method if available
|
|
211
156
|
val cleanupMethod = sdk.javaClass.getMethod("cleanup")
|
|
212
157
|
cleanupMethod.invoke(sdk)
|
|
213
|
-
Log.d(TAG, "NimbblCheckoutSDK cleanup called successfully")
|
|
214
158
|
} catch (e: NoSuchMethodException) {
|
|
215
|
-
|
|
159
|
+
// Cleanup method not found, skipping
|
|
216
160
|
} catch (e: Exception) {
|
|
217
|
-
|
|
161
|
+
// Error calling cleanup, ignore
|
|
218
162
|
}
|
|
219
163
|
}
|
|
220
164
|
} catch (e: Exception) {
|
|
221
|
-
|
|
165
|
+
// Error during cleanup, ignore
|
|
222
166
|
}
|
|
223
167
|
}
|
|
224
168
|
}
|