react-native-hyperpay-sdk 0.5.0 → 0.6.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/ios/HyperPay.m CHANGED
@@ -6,12 +6,15 @@
6
6
  @implementation HyperPay
7
7
 
8
8
  OPPPaymentProvider *provider;
9
-
9
+ NSString *shopperResultURL = @"";
10
10
 
11
11
  RCT_EXPORT_MODULE(HyperPay)
12
12
 
13
13
  -(instancetype)init
14
14
  {
15
+
16
+
17
+
15
18
  self = [super init];
16
19
  if (self) {
17
20
  #ifdef DEBUG
@@ -32,6 +35,12 @@ RCT_EXPORT_MODULE(HyperPay)
32
35
  React Native functions
33
36
  */
34
37
 
38
+
39
+ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(setConfig: (NSDictionary*)options) {
40
+ shopperResultURL=[options valueForKey:@"shopperResultURL"];
41
+ return options;
42
+ }
43
+
35
44
  RCT_EXPORT_METHOD(createPaymentTransaction: (NSDictionary*)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
36
45
  NSError * _Nullable error;
37
46
 
@@ -49,7 +58,7 @@ RCT_EXPORT_METHOD(createPaymentTransaction: (NSDictionary*)options resolver:(RCT
49
58
  reject(@"createTransaction",error.localizedDescription, error);
50
59
 
51
60
  } else {
52
- params.shopperResultURL =[options valueForKey:@"shopperResultURL"];
61
+ params.shopperResultURL =shopperResultURL;
53
62
 
54
63
  OPPTransaction *transaction = [OPPTransaction transactionWithPaymentParams:params];
55
64
 
@@ -84,7 +93,7 @@ RCT_REMAP_METHOD(multiply,
84
93
  withRejecter:(RCTPromiseRejectBlock)reject)
85
94
  {
86
95
  NSNumber *result = @([a floatValue] * [b floatValue]);
87
-
96
+ shopperResultURL=@"Ragab";
88
97
  resolve(result);
89
98
  }
90
99
 
@@ -7,6 +7,9 @@ export type CreateTransactionResponseType = {
7
7
  redirectURL: string
8
8
  }
9
9
 
10
+ export type ConfigType = {
11
+ shopperResultURL: string
12
+ }
10
13
  export type CreateTransactionParams = {
11
14
  paymentBrand: string,
12
15
  holderName: string,
@@ -22,3 +25,8 @@ export declare function
22
25
  createPaymentTransaction(params: CreateTransactionParams):
23
26
  Promise<CreateTransactionResponseType>;
24
27
 
28
+
29
+ export declare function setConfig(params: ConfigType): ConfigType
30
+
31
+
32
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperpay-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "hyperpay",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { NativeModules, Platform } from 'react-native';
2
- import { CreateTransactionResponseType, CreateTransactionParams } from '../lib/typescript'
2
+ import type { CreateTransactionResponseType, CreateTransactionParams, ConfigType } from '../lib/typescript'
3
3
  const LINKING_ERROR =
4
4
  `The package 'react-native-hyperpay' doesn't seem to be linked. Make sure: \n\n` +
5
5
  Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
@@ -24,3 +24,8 @@ export function multiply(a: number, b: number): Promise<number> {
24
24
  export function createPaymentTransaction(params: CreateTransactionParams): Promise<CreateTransactionResponseType> {
25
25
  return HyperPay.createPaymentTransaction(params);
26
26
  }
27
+ export function setConfig(params: ConfigType): ConfigType {
28
+ return HyperPay.setConfig(params);
29
+ }
30
+
31
+