react-native-hyperpay-sdk 0.26.0 → 0.27.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.
@@ -19,7 +19,7 @@ def safeExtGet(prop, fallback) {
19
19
  }
20
20
 
21
21
  android {
22
- compileSdkVersion safeExtGet('HyperPay_compileSdkVersion', 29)
22
+ compileSdkVersion safeExtGet('HyperPay_compileSdkVersion', 31)
23
23
  defaultConfig {
24
24
  minSdkVersion safeExtGet('HyperPay_minSdkVersion', 21)
25
25
  targetSdkVersion safeExtGet('HyperPay_targetSdkVersion', 29)
@@ -54,8 +54,19 @@ repositories {
54
54
  }
55
55
 
56
56
  dependencies {
57
- implementation fileTree(include: ["*.aar"], dir: "libs")
58
57
 
58
+ if (project.gradle.startParameter.taskNames.any { it.toLowerCase().contains('release') }) {
59
+ compileOnly files('libs/ipworks3ds_sdk_deploy.aar')
60
+ }
61
+ else {
62
+ compileOnly files('libs/ipworks3ds_sdk.aar')
63
+ }
64
+ compileOnly files('libs/oppwa.mobile-4.5.0-release.aar')
65
+ implementation "androidx.appcompat:appcompat:1.4.2"
66
+ implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
67
+ implementation "androidx.browser:browser:1.4.0"
68
+ implementation "androidx.fragment:fragment:1.5.5"
69
+ implementation "com.google.android.material:material:1.6.1"
59
70
  //noinspection GradleDynamicVersion
60
71
  implementation "com.facebook.react:react-native:+" // From node_modules
61
72
 
@@ -1,15 +1,35 @@
1
1
  package com.reactnativehyperpay;
2
2
 
3
+ import android.content.Context;
4
+ import android.util.Log;
5
+
3
6
  import androidx.annotation.NonNull;
4
7
 
5
8
  import com.facebook.react.bridge.Promise;
6
9
  import com.facebook.react.bridge.ReactApplicationContext;
7
10
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
11
  import com.facebook.react.bridge.ReactMethod;
12
+ import com.facebook.react.bridge.ReadableMap;
9
13
  import com.facebook.react.module.annotations.ReactModule;
14
+ import com.oppwa.mobile.connect.exception.PaymentError;
15
+ import com.oppwa.mobile.connect.exception.PaymentException;
16
+ import com.oppwa.mobile.connect.payment.BrandsValidation;
17
+ import com.oppwa.mobile.connect.payment.CheckoutInfo;
18
+ import com.oppwa.mobile.connect.payment.ImagesRequest;
19
+ import com.oppwa.mobile.connect.payment.PaymentParams;
20
+ import com.oppwa.mobile.connect.payment.card.CardPaymentParams;
21
+ import com.oppwa.mobile.connect.provider.Connect;
22
+ import com.oppwa.mobile.connect.provider.ITransactionListener;
23
+ import com.oppwa.mobile.connect.provider.OppPaymentProvider;
10
24
  import com.oppwa.mobile.connect.provider.Transaction;
25
+
11
26
  @ReactModule(name = HyperPayModule.NAME)
12
27
  public class HyperPayModule extends ReactContextBaseJavaModule {
28
+ private Context appContext;
29
+ private String shopperResultURL;
30
+ private String merchantIdentifier;
31
+ private String countryCode;
32
+ private String mode;
13
33
  public static final String NAME = "HyperPay";
14
34
 
15
35
  public HyperPayModule(ReactApplicationContext reactContext) {
@@ -22,13 +42,67 @@ public class HyperPayModule extends ReactContextBaseJavaModule {
22
42
  return NAME;
23
43
  }
24
44
 
25
-
26
45
  // Example method
27
46
  // See https://reactnative.dev/docs/native-modules-android
47
+
48
+ @ReactMethod
49
+ public ReadableMap setup(ReadableMap params, Promise promise) {
50
+ if (!params.getString("shopperResultURL").isEmpty())
51
+ shopperResultURL = params.getString("shopperResultURL");
52
+ if (!params.getString("merchantIdentifier").isEmpty())
53
+ merchantIdentifier = params.getString("merchantIdentifier");
54
+ if (!params.getString("countryCode").isEmpty())
55
+ countryCode = params.getString("countryCode");
56
+ if (!params.getString("mode").isEmpty())
57
+ countryCode = params.getString("mode");
58
+ return params;
59
+ }
60
+
28
61
  @ReactMethod
29
- public void multiply(int a, int b, Promise promise) {
30
- promise.resolve(a * b);
62
+ public void createPaymentTransaction(ReadableMap params, Promise promise) {
63
+
64
+ // PaymentParams paymentParams = new CardPaymentParams(
65
+ // params.getString("checkoutID"),
66
+ // params.getString("paymentBrand"),
67
+ // params.getString("cardNumber"),
68
+ // params.getString("holderName") ,
69
+ // params.getString("expiryMonth"),
70
+ // params.getString("expiryYear"),
71
+ // params.getString("cvv")
72
+ // );
73
+
74
+ // if (!params.getString("shopperResultURL").isEmpty()){
75
+ // shopperResultURL=params.getString("shopperResultURL");
76
+ // }
77
+ //
78
+ // paymentParams.setShopperResultUrl(shopperResultURL);
79
+ //
80
+ // Transaction transaction = null;
81
+ // ITransactionListener transactionListener = null;
82
+ //
83
+ //
84
+ // try {
85
+ // OppPaymentProvider paymentProvider = new OppPaymentProvider(appContext,
86
+ // Connect.ProviderMode.TEST);
87
+ //
88
+ // if (mode=="LiveMode"){
89
+ // paymentProvider.setProviderMode(Connect.ProviderMode.LIVE);
90
+ // }
91
+ //
92
+ // transaction = new Transaction(paymentParams);
93
+ // paymentProvider.submitTransaction(transaction, transactionListener);
94
+ // promise.resolve("Test");
95
+ //
96
+
97
+ //
98
+ // } catch (PaymentException e) {
99
+ // promise.reject(e);
100
+ // /* error occurred */
101
+ // }
102
+ Log.d("params", params.toString());
103
+
31
104
  }
32
105
 
33
106
  public static native int nativeMultiply(int a, int b);
107
+
34
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperpay-sdk",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "hyperpay",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",