react-native-hyperpay-sdk 0.4.0 → 0.5.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
@@ -8,8 +8,6 @@
8
8
  OPPPaymentProvider *provider;
9
9
 
10
10
 
11
-
12
-
13
11
  RCT_EXPORT_MODULE(HyperPay)
14
12
 
15
13
  -(instancetype)init
@@ -34,7 +32,7 @@ RCT_EXPORT_MODULE(HyperPay)
34
32
  React Native functions
35
33
  */
36
34
 
37
- RCT_EXPORT_METHOD(createTransaction: (NSDictionary*)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
35
+ RCT_EXPORT_METHOD(createPaymentTransaction: (NSDictionary*)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
38
36
  NSError * _Nullable error;
39
37
 
40
38
  OPPCardPaymentParams *params = [OPPCardPaymentParams cardPaymentParamsWithCheckoutID:[options valueForKey:@"checkoutID"]
@@ -1 +1,24 @@
1
- export declare function multiply(a: number, b: number): Promise<number>;
1
+
2
+
3
+
4
+ export type CreateTransactionResponseType = {
5
+ status: 'pending',
6
+ checkoutId: string,
7
+ redirectURL: string
8
+ }
9
+
10
+ export type CreateTransactionParams = {
11
+ paymentBrand: string,
12
+ holderName: string,
13
+ cardNumber: string,
14
+ expiryYear: string,
15
+ expiryMonth: string,
16
+ cvv: string,
17
+ checkoutID: string,
18
+ shopperResultURL: string
19
+ }
20
+
21
+ export declare function
22
+ createPaymentTransaction(params: CreateTransactionParams):
23
+ Promise<CreateTransactionResponseType>;
24
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperpay-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.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
-
2
+ import { CreateTransactionResponseType, CreateTransactionParams } 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: '' }) +
@@ -9,14 +9,18 @@ const LINKING_ERROR =
9
9
  const HyperPay = NativeModules.HyperPay
10
10
  ? NativeModules.HyperPay
11
11
  : new Proxy(
12
- {},
13
- {
14
- get() {
15
- throw new Error(LINKING_ERROR);
16
- },
17
- }
18
- );
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ }
18
+ );
19
19
 
20
20
  export function multiply(a: number, b: number): Promise<number> {
21
21
  return HyperPay.multiply(a, b);
22
22
  }
23
+
24
+ export function createPaymentTransaction(params: CreateTransactionParams): Promise<CreateTransactionResponseType> {
25
+ return HyperPay.createPaymentTransaction(params);
26
+ }