payme-mini-app 0.4.10 → 0.4.12

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.
@@ -74,7 +74,7 @@ dependencies {
74
74
  //noinspection GradleDynamicVersion
75
75
  implementation "com.facebook.react:react-native"
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
- implementation 'com.github.PayME-Miniapp:native-android:0.0.64'
77
+ implementation 'com.github.PayME-Miniapp:native-android:0.0.65'
78
78
  }
79
79
 
80
80
  if (isNewArchitectureEnabled()) {
@@ -55,6 +55,11 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
55
55
  payMEMiniApp?.getBalance(phone)
56
56
  }
57
57
 
58
+ @ReactMethod
59
+ fun getAccountInfo(phone: String) {
60
+ payMEMiniApp?.getAccountInfo(phone)
61
+ }
62
+
58
63
  @ReactMethod
59
64
  fun open(type: String, openingParam: ReadableMap) {
60
65
  val action = openingParam.getString("action") ?: "PAYME"
@@ -82,7 +87,7 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
82
87
  }
83
88
  var paymentData: PaymentData? = null
84
89
  var additionalData: DepositWithdrawTransferData? = null
85
- if (amount != null && transactionId != null && action === "PAY") {
90
+ if (amount != null && transactionId != null && action == "PAY") {
86
91
  paymentData = PaymentData(transactionId, amount, note, ipnUrl)
87
92
  }
88
93
  if (action == "DEPOSIT" || action == "WITHDRAW" || action == "TRANSFER") {
@@ -162,7 +167,7 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
162
167
  if (getActionOpenMiniApp(action) == ActionOpenMiniApp.OPEN) {
163
168
  return OpenMiniAppOpenData(phone)
164
169
  }
165
- if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAY) {
170
+ if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAY && paymentData != null) {
166
171
  return OpenMiniAppPaymentData(phone, paymentData!!)
167
172
  }
168
173
  if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAYME) {
@@ -171,16 +176,16 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
171
176
  if (getActionOpenMiniApp(action) == ActionOpenMiniApp.KYC) {
172
177
  return OpenMiniAppKYCData(phone)
173
178
  }
174
- if (getActionOpenMiniApp(action) == ActionOpenMiniApp.DEPOSIT) {
179
+ if (getActionOpenMiniApp(action) == ActionOpenMiniApp.DEPOSIT && additionalData != null) {
175
180
  return OpenMiniAppDepositData(phone, additionalData!!)
176
181
  }
177
- if (getActionOpenMiniApp(action) == ActionOpenMiniApp.WITHDRAW) {
182
+ if (getActionOpenMiniApp(action) == ActionOpenMiniApp.WITHDRAW && additionalData != null) {
178
183
  return OpenMiniAppWithdrawData(phone, additionalData!!)
179
184
  }
180
- if (getActionOpenMiniApp(action) == ActionOpenMiniApp.TRANSFER) {
185
+ if (getActionOpenMiniApp(action) == ActionOpenMiniApp.TRANSFER && additionalData != null) {
181
186
  return OpenMiniAppTransferData(phone, additionalData!!)
182
187
  }
183
- if (getActionOpenMiniApp(action) == ActionOpenMiniApp.SERVICE) {
188
+ if (getActionOpenMiniApp(action) == ActionOpenMiniApp.SERVICE && service != null) {
184
189
  return OpenMiniAppServiceData(phone, service!!)
185
190
  }
186
191
  return OpenMiniAppPayMEData()
@@ -6,6 +6,7 @@
6
6
  RCT_EXTERN_METHOD(initPayME:(NSString*)appId publicKey:(NSString)publicKey privateKey:(NSString)privateKey env:(NSString)env mode:(NSString)mode)
7
7
  RCT_EXTERN_METHOD(open:(NSString*)type param:(NSDictionary)param)
8
8
  RCT_EXTERN_METHOD(getBalance:(NSString*)phone)
9
+ RCT_EXTERN_METHOD(getAccountInfo:(NSString*)phone)
9
10
 
10
11
  + (BOOL)requiresMainQueueSetup
11
12
  {
@@ -59,6 +59,12 @@ class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
59
59
  }
60
60
  }
61
61
 
62
+ @objc func getAccountInfo(_ phone: String) {
63
+ DispatchQueue.main.sync {
64
+ self.payme.getAccountInformation(of: phone)
65
+ }
66
+ }
67
+
62
68
  override func supportedEvents() -> [String]! {
63
69
  return ["onError", "onResponse"]
64
70
  }
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PayMEMiniAppEvents = void 0;
7
+ exports.getAccountInfo = getAccountInfo;
7
8
  exports.getBalance = getBalance;
8
9
  exports.init = init;
9
10
  exports.open = open;
@@ -19,6 +20,9 @@ function open(type, openingParam) {
19
20
  function getBalance(phone) {
20
21
  return RNPayMEMiniApp.getBalance(phone);
21
22
  }
23
+ function getAccountInfo(phone) {
24
+ return RNPayMEMiniApp.getAccountInfo(phone);
25
+ }
22
26
  const PayMEMiniAppEvents = new _reactNative.NativeEventEmitter(RNPayMEMiniApp);
23
27
  exports.PayMEMiniAppEvents = PayMEMiniAppEvents;
24
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;AAAA;AAOA,MAAMA,cAAc,GAAGC,0BAAa,CAACD,cAAc;AAE5C,SAASE,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EAEb;EAAA,IADAC,IAAY,uEAAG,iBAAiB;EAEhC,OAAOP,cAAc,CAACQ,SAAS,CAACL,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,CAAC;AAC1E;AAEO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOX,cAAc,CAACS,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOb,cAAc,CAACY,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,MAAMC,kBAAkB,GAAG,IAAIC,+BAAkB,CAACf,cAAc,CAAC;AAAC"}
1
+ {"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA;AAOA,MAAMA,cAAc,GAAGC,0BAAa,CAACD,cAAc;AAE5C,SAASE,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EAEb;EAAA,IADAC,IAAY,uEAAG,iBAAiB;EAEhC,OAAOP,cAAc,CAACQ,SAAS,CAACL,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,CAAC;AAC1E;AAEO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOX,cAAc,CAACS,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOb,cAAc,CAACY,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,SAASC,cAAc,CAACD,KAAa,EAAE;EAC5C,OAAOb,cAAc,CAACc,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEO,MAAME,kBAAkB,GAAG,IAAIC,+BAAkB,CAAChB,cAAc,CAAC;AAAC"}
@@ -10,5 +10,8 @@ export function open(type, openingParam) {
10
10
  export function getBalance(phone) {
11
11
  return RNPayMEMiniApp.getBalance(phone);
12
12
  }
13
+ export function getAccountInfo(phone) {
14
+ return RNPayMEMiniApp.getAccountInfo(phone);
15
+ }
13
16
  export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
14
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAOhE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EAEb;EAAA,IADAC,IAAY,uEAAG,iBAAiB;EAEhC,OAAON,cAAc,CAACO,SAAS,CAACL,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,CAAC;AAC1E;AAEA,OAAO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOV,cAAc,CAACQ,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOZ,cAAc,CAACW,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,MAAMC,kBAAkB,GAAG,IAAIf,kBAAkB,CAACE,cAAc,CAAC"}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAOhE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EAEb;EAAA,IADAC,IAAY,uEAAG,iBAAiB;EAEhC,OAAON,cAAc,CAACO,SAAS,CAACL,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,CAAC;AAC1E;AAEA,OAAO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOV,cAAc,CAACQ,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOZ,cAAc,CAACW,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,SAASC,cAAc,CAACD,KAAa,EAAE;EAC5C,OAAOZ,cAAc,CAACa,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEA,OAAO,MAAME,kBAAkB,GAAG,IAAIhB,kBAAkB,CAACE,cAAc,CAAC"}
@@ -3,5 +3,6 @@ import type { PayMEEnv, PayMEOpeningParam, PayMEOpeningType } from './index.type
3
3
  export declare function init(appId: string, publicKey: string, privateKey: string, env: PayMEEnv, mode?: string): any;
4
4
  export declare function open(type: PayMEOpeningType, openingParam: PayMEOpeningParam): any;
5
5
  export declare function getBalance(phone: string): any;
6
+ export declare function getAccountInfo(phone: string): any;
6
7
  export declare const PayMEMiniAppEvents: NativeEventEmitter;
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,QAAQ,EACb,IAAI,GAAE,MAA0B,OAGjC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,QAAQ,EACb,IAAI,GAAE,MAA0B,OAGjC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,OAE3C;AAED,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payme-mini-app",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.tsx CHANGED
@@ -25,4 +25,8 @@ export function getBalance(phone: string) {
25
25
  return RNPayMEMiniApp.getBalance(phone);
26
26
  }
27
27
 
28
+ export function getAccountInfo(phone: string) {
29
+ return RNPayMEMiniApp.getAccountInfo(phone);
30
+ }
31
+
28
32
  export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);