judokit-react-native 4.1.1 → 4.1.2
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/android/build.gradle
CHANGED
|
@@ -74,8 +74,6 @@ repositories {
|
|
|
74
74
|
mavenCentral()
|
|
75
75
|
google()
|
|
76
76
|
|
|
77
|
-
maven { url 'https://vocalinkzapp.jfrog.io/artifactory/merchant-library-maven/' }
|
|
78
|
-
|
|
79
77
|
def found = false
|
|
80
78
|
def defaultDir = null
|
|
81
79
|
def androidSourcesName = 'React Native sources'
|
|
@@ -153,7 +151,7 @@ dependencies {
|
|
|
153
151
|
implementation 'androidx.core:core-ktx:1.9.0'
|
|
154
152
|
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
|
155
153
|
|
|
156
|
-
implementation 'com.judopay:judokit-android:4.1.
|
|
154
|
+
implementation 'com.judopay:judokit-android:4.1.2'
|
|
157
155
|
|
|
158
156
|
//JUnit 5
|
|
159
157
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
|
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
package com.reactlibrary
|
|
2
2
|
|
|
3
|
-
import android.widget.Button
|
|
4
3
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
5
4
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
5
|
+
import com.judopay.judokit.android.ui.common.PayByBankButton
|
|
6
|
+
import com.facebook.react.bridge.Arguments
|
|
7
|
+
import com.facebook.react.bridge.WritableMap
|
|
8
|
+
import com.facebook.react.common.MapBuilder
|
|
9
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
10
|
+
import com.facebook.react.uimanager.events.Event
|
|
6
11
|
|
|
7
|
-
class
|
|
12
|
+
internal class OnPressEvent constructor(surfaceId: Int, viewId: Int):Event<OnPressEvent>(surfaceId, viewId) {
|
|
13
|
+
|
|
14
|
+
override fun getEventName(): String = EVENT_NAME
|
|
15
|
+
|
|
16
|
+
override fun getCoalescingKey(): Short = 0
|
|
17
|
+
|
|
18
|
+
override fun getEventData(): WritableMap? = Arguments.createMap()
|
|
19
|
+
|
|
20
|
+
companion object {
|
|
21
|
+
const val EVENT_NAME = "onPress"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
class JudoReactNativePBBAManager: SimpleViewManager<PayByBankButton>() {
|
|
8
26
|
|
|
9
27
|
override fun getName(): String {
|
|
10
28
|
return "RNPBBAButton"
|
|
11
29
|
}
|
|
12
30
|
|
|
13
|
-
override fun createViewInstance(reactContext: ThemedReactContext):
|
|
14
|
-
|
|
31
|
+
override fun createViewInstance(reactContext: ThemedReactContext): PayByBankButton {
|
|
32
|
+
val button = PayByBankButton(reactContext)
|
|
33
|
+
button.setOnClickListener {
|
|
34
|
+
val screenContext = it.context as ThemedReactContext
|
|
35
|
+
val eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(screenContext, it.id)
|
|
36
|
+
eventDispatcher?.dispatchEvent(
|
|
37
|
+
OnPressEvent(
|
|
38
|
+
screenContext.surfaceId,
|
|
39
|
+
it.id
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
return button
|
|
15
44
|
}
|
|
16
45
|
|
|
46
|
+
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> {
|
|
47
|
+
return MapBuilder.of(
|
|
48
|
+
OnPressEvent.EVENT_NAME,
|
|
49
|
+
MapBuilder.of("registrationName", "onPress"),
|
|
50
|
+
)
|
|
51
|
+
}
|
|
17
52
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "judokit-react-native",
|
|
3
3
|
"title": "Judopay React Native Module",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.2",
|
|
5
5
|
"description": "A React Native module for the Judopay native SDKs to take payments on iOS and Android.",
|
|
6
6
|
"main": "JudoPay.tsx",
|
|
7
7
|
"scripts": {
|