@miden-npm/react 0.1.0 → 1.0.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/dist/index.d.cts CHANGED
@@ -24,13 +24,6 @@ type ConfirmCardPaymentParams = {
24
24
  email?: string;
25
25
  };
26
26
  };
27
- interface ISelectOption {
28
- label: string;
29
- value: string;
30
- countryCode?: string;
31
- bankLogoUrl?: string;
32
- selected?: boolean;
33
- }
34
27
 
35
28
  declare class MidenPGClient {
36
29
  private readonly cfg;
@@ -49,12 +42,22 @@ declare const MidenPGProvider: React.FC<React.PropsWithChildren<{
49
42
  declare const useMidenPGClient: () => MidenPGClient;
50
43
 
51
44
  interface IPaymentObject {
45
+ merchantName: string;
52
46
  amount: number;
53
47
  currency: string;
54
48
  email: string;
55
49
  phoneNumber: string;
56
50
  narration: string;
57
- redirectUrl: string;
51
+ redirectUrl?: string;
52
+ }
53
+ interface ISuccessObject {
54
+ paymentDate: string | null;
55
+ paymentId: string;
56
+ paymentStatus: string;
57
+ message?: string;
58
+ }
59
+ interface IErrorObject {
60
+ errorMessage: string;
58
61
  }
59
62
 
60
63
  declare function usePaymentIntents(): {
@@ -70,8 +73,9 @@ interface IBzpCheckoutButtonProps {
70
73
  environment?: "sandbox" | "production";
71
74
  paymentObject: IPaymentObject;
72
75
  mode?: "redirect" | "iframe";
76
+ onError?: (error: IErrorObject) => void;
73
77
  }
74
- declare function BzpCheckoutButton({ secretKey, environment, paymentObject, mode, }: IBzpCheckoutButtonProps): react_jsx_runtime.JSX.Element;
78
+ declare function BzpCheckoutButton({ secretKey, environment, paymentObject, mode, onError, }: IBzpCheckoutButtonProps): react_jsx_runtime.JSX.Element;
75
79
 
76
80
  interface IIframeStyle {
77
81
  width?: string;
@@ -84,10 +88,11 @@ interface IBzpCheckoutIframeProps {
84
88
  style?: IIframeStyle;
85
89
  url?: string;
86
90
  secretKey: string;
87
- environment: "sandbox" | "production";
91
+ environment?: "sandbox" | "production";
88
92
  paymentObject?: IPaymentObject;
93
+ onError?: (error: IErrorObject) => void;
89
94
  }
90
- declare function BzpCheckoutIframe({ style, url, secretKey, environment, paymentObject, }: IBzpCheckoutIframeProps): react_jsx_runtime.JSX.Element;
95
+ declare function BzpCheckoutIframe({ style, url, secretKey, environment, paymentObject, onError, }: IBzpCheckoutIframeProps): react_jsx_runtime.JSX.Element;
91
96
 
92
97
  interface CheckoutIframeStyle {
93
98
  [cssProp: string]: string | number;
@@ -105,10 +110,12 @@ interface CheckoutCardOptions {
105
110
  }
106
111
  interface IBzpCheckoutCardProps {
107
112
  secretKey: string;
108
- environment?: "sandbox" | "production";
113
+ environment: "sandbox" | "prod";
109
114
  paymentObject: IPaymentObject;
110
115
  options?: CheckoutCardOptions;
116
+ onPaymentAuthorized?: (data: ISuccessObject) => void;
117
+ onError?: (error: IErrorObject) => void;
111
118
  }
112
- declare function BzpCheckoutCard({ options, environment, paymentObject, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
119
+ declare function BzpCheckoutCard({ secretKey, options, environment, paymentObject, onPaymentAuthorized, onError, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
113
120
 
114
- export { BzpCheckoutButton, BzpCheckoutCard, BzpCheckoutIframe, type CheckoutCardOptions, type CheckoutIframeStyle, type ConfirmCardPaymentParams, type CreatePaymentIntentParams, type ISelectOption, MidenPGClient, type MidenPGConfig, MidenPGProvider, type PaymentIntent, useMidenPGClient, usePaymentIntents };
121
+ export { BzpCheckoutButton, BzpCheckoutCard, BzpCheckoutIframe, type CheckoutCardOptions, type CheckoutIframeStyle, type ConfirmCardPaymentParams, type CreatePaymentIntentParams, MidenPGClient, type MidenPGConfig, MidenPGProvider, type PaymentIntent, useMidenPGClient, usePaymentIntents };
package/dist/index.d.ts CHANGED
@@ -24,13 +24,6 @@ type ConfirmCardPaymentParams = {
24
24
  email?: string;
25
25
  };
26
26
  };
27
- interface ISelectOption {
28
- label: string;
29
- value: string;
30
- countryCode?: string;
31
- bankLogoUrl?: string;
32
- selected?: boolean;
33
- }
34
27
 
35
28
  declare class MidenPGClient {
36
29
  private readonly cfg;
@@ -49,12 +42,22 @@ declare const MidenPGProvider: React.FC<React.PropsWithChildren<{
49
42
  declare const useMidenPGClient: () => MidenPGClient;
50
43
 
51
44
  interface IPaymentObject {
45
+ merchantName: string;
52
46
  amount: number;
53
47
  currency: string;
54
48
  email: string;
55
49
  phoneNumber: string;
56
50
  narration: string;
57
- redirectUrl: string;
51
+ redirectUrl?: string;
52
+ }
53
+ interface ISuccessObject {
54
+ paymentDate: string | null;
55
+ paymentId: string;
56
+ paymentStatus: string;
57
+ message?: string;
58
+ }
59
+ interface IErrorObject {
60
+ errorMessage: string;
58
61
  }
59
62
 
60
63
  declare function usePaymentIntents(): {
@@ -70,8 +73,9 @@ interface IBzpCheckoutButtonProps {
70
73
  environment?: "sandbox" | "production";
71
74
  paymentObject: IPaymentObject;
72
75
  mode?: "redirect" | "iframe";
76
+ onError?: (error: IErrorObject) => void;
73
77
  }
74
- declare function BzpCheckoutButton({ secretKey, environment, paymentObject, mode, }: IBzpCheckoutButtonProps): react_jsx_runtime.JSX.Element;
78
+ declare function BzpCheckoutButton({ secretKey, environment, paymentObject, mode, onError, }: IBzpCheckoutButtonProps): react_jsx_runtime.JSX.Element;
75
79
 
76
80
  interface IIframeStyle {
77
81
  width?: string;
@@ -84,10 +88,11 @@ interface IBzpCheckoutIframeProps {
84
88
  style?: IIframeStyle;
85
89
  url?: string;
86
90
  secretKey: string;
87
- environment: "sandbox" | "production";
91
+ environment?: "sandbox" | "production";
88
92
  paymentObject?: IPaymentObject;
93
+ onError?: (error: IErrorObject) => void;
89
94
  }
90
- declare function BzpCheckoutIframe({ style, url, secretKey, environment, paymentObject, }: IBzpCheckoutIframeProps): react_jsx_runtime.JSX.Element;
95
+ declare function BzpCheckoutIframe({ style, url, secretKey, environment, paymentObject, onError, }: IBzpCheckoutIframeProps): react_jsx_runtime.JSX.Element;
91
96
 
92
97
  interface CheckoutIframeStyle {
93
98
  [cssProp: string]: string | number;
@@ -105,10 +110,12 @@ interface CheckoutCardOptions {
105
110
  }
106
111
  interface IBzpCheckoutCardProps {
107
112
  secretKey: string;
108
- environment?: "sandbox" | "production";
113
+ environment: "sandbox" | "prod";
109
114
  paymentObject: IPaymentObject;
110
115
  options?: CheckoutCardOptions;
116
+ onPaymentAuthorized?: (data: ISuccessObject) => void;
117
+ onError?: (error: IErrorObject) => void;
111
118
  }
112
- declare function BzpCheckoutCard({ options, environment, paymentObject, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
119
+ declare function BzpCheckoutCard({ secretKey, options, environment, paymentObject, onPaymentAuthorized, onError, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
113
120
 
114
- export { BzpCheckoutButton, BzpCheckoutCard, BzpCheckoutIframe, type CheckoutCardOptions, type CheckoutIframeStyle, type ConfirmCardPaymentParams, type CreatePaymentIntentParams, type ISelectOption, MidenPGClient, type MidenPGConfig, MidenPGProvider, type PaymentIntent, useMidenPGClient, usePaymentIntents };
121
+ export { BzpCheckoutButton, BzpCheckoutCard, BzpCheckoutIframe, type CheckoutCardOptions, type CheckoutIframeStyle, type ConfirmCardPaymentParams, type CreatePaymentIntentParams, MidenPGClient, type MidenPGConfig, MidenPGProvider, type PaymentIntent, useMidenPGClient, usePaymentIntents };